views:

502

answers:

2

When to use each? To what do they map in the database?

+1  A: 

from Hibernate: http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#mapping-types-basictypes

boolean, yes_no and true_false are all alternative encodings for a Java boolean or java.lang.Boolean.

mlathe
+2  A: 

Follow true_false, when we use true/false or T/F at database level. In case you are using Y/N or yes/no at database level, yes_no is the way to go.

By the way, got to know that there are some issues with these, which result in unexpected value. For example here and here, Few seems fixed already in successive updates, though.

PS: Its best to use ENUMs. You will find it much more maintainable down the road.

Adeel Ansari