I'm developing a Bet service with Java and MySql using Spring and Hibernate, but I have a question about a mapping:
In my database I have bet types (questions) like: ¿Who will win the match? and bet options for each type like: 1, X, 2. Each option has a boolean indicator to show if an option is a winner option or not. So, the mapping in MySql for this attribute is a boolean like this: 1 if the option is winner, 0 if the option is looser, and null if the option is not yet neither winner or looser
So, in my service layer, how can I check if the winner attribute in an option is null? I've tried option.getIsWinner() != null but boolean is a primitive type so it can be null. Any idea on this?
Thanks.