Tuesday, April 15, 2008

Oracle CHAR(10) and Hibernate

Had a problem today with the Oracle database where the table was defined with a column of datatype CHAR(10) . The application was connecting to the database through hibernate and the hibernate mappings had a definition of String for this column

<class name="blah" table="BLAH_IN">
<property name="test" type="string" column="TEST">
</property>
</class>


where the table was
CREATE TABLE BLAH_IN
( "TEST" CHAR(10 BYTE));

Searches using the Criteria in hibernate for this field would not return a result because of the type difference. hence I had to create a UserType

The creation of this is well documeted in

http://www.hibernate.org/90.html

Saved my day

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home