Hi there, I'm using JBoss 4.0.5 GA and I'm trying to map a POJO class into MySQL 5 Everything works fine except for the Boolean field which is empty. I tried different attempts but I'm probably missing something about. Would you have a look on my code and tell me why I'm getting that result?
Once I persist the class I print out the toString() in order to verify the properties object, actually the active prop. has the right false value. So why on the DB I get an empty value? [ March 25, 2007: Message edited by: Alessandro Ilardo ]
Object type Boolean will be used when the usecase permits the property value to be null. Having said that, i am not sure why you are seeing the value as false when you do a toString(). I would have expected it to be null.
Originally posted by Alessandro Ilardo: (don't ask me why).
No, i wont
Sometime back i had read an article which mentioned that MySQL doesnt fully support Boolean. They had recommended using TINYINT(1) as the data type in the ddl while creating the table. I am not completely sure if this the reason why you are seeing this issue, but you could give it a try by changing the data type to TINYINT(1) in your table.
I m facing a problem regarding boolean type mapping with mysql datatype while auto ddl'ing. The column type corresponding to boolean created by hibernate is BIT(1) instead of mysql boolean type (Tinyint or boolean).
Which version of MySql do you have in your application? Are you using the correct JDBC driver version? And what dialect have you specified in your hibernate configuration file? Can you post the hbm.xml which contains this boolean mapping?