Hi!
I don't mean to be rude... but this is the forum for the .NET version of Hibernate... and your question is Java related... so I think it should be posted in :
http://forum.hibernate.org/viewforum.php?f=1
Quote:
I have a java class, with a member called "nativeFlag", which is of type java.lang.Boolean. (which means that it's nullable). In the mapping file, I haven't explicitly mentioned any type for nativeFlag.
IMHO having nullable booleans is not advisable... the reason to use "boolean" is because you want to have 2 values "true", and "false" and if you allow a boolean to be nullable... then you have "true", "false" and "unknown" and... well, that is no longer a binary decision... if you are going to have 3 choices for that flag... I really recommend you not to use boolean (from a bussines object model point of view)
Quote:
When my table is created, the "nativeFlag" field is stored as a "tinyint" column in my Sybase DB.
Haven't used Hibernate with Sybase DB... so I just guess that Sybase DB does not have a "bit" type (as SQLServer)
Quote:
Now, when the value in nativeFlag is NULL, I want NULL to be inserted in my DB. However, always 0 gets inserted.
How do I insert NULL in the table, if "nativeFlag" is null?
You mapping file indicates that the field is nullable?