Full Hibernate class names for ormtype property

Figured I would share a little tidbit I found the other day.  While working with a MySQL database, I kept having to define boolean property types as ormtype=int in my cfc’s, then later changing the column in the database to a more proper set, this was very annoying.  I came across a post on stackoverflow stating in a java class, you could define the property type as org.hibernate.type.BooleanType.

It was only then it struck me that this could work in cfc’s, since in the Application.cfc ormsettings dialect you can use the full class path there.  Took just a couple of seconds to open up my object, change the value, lo and below, it works perfectly, you can use the full class names for ormtype and further avoid any headaches.  Wish I knew about this sooner.

property name="someBooleanThing" ormtype="org.hibernate.type.BooleanType" type="boolean" dbdefault="0" default="false";

For a full list of types and other hibernate goodies, open up your hibernate3.jar, located in cf-install\lib\.

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

WordPress Appliance - Powered by TurnKey Linux