Hi,
Using latest Hibernate 2, I have a mapping file with this entry:
<property name="Core" type="boolean" column="iscore"/>
Now in my code I do a query expressed in OQL:
"select grp from " + SportletGroup.class.getName() + " grp where grp.Core='" + Boolean.TRUE + "'"
This works fine when using hsqldb, however it seems that using MySQL a boolean gets mapped to a tinyint, so that the query will work only if "1" is used instead of "Boolean.TRUE", however this will then break the query under hsqldb. Is there any db agnostic way to handle boolean types, or maybe I should declare the field as an integer?
Thanks, Jason
|