Hi - I'm using Oracle 10g, Hibernate 2.1 and Spring framework 1.15, and have a currency table with a currency column of CHAR(3).
My mapping file maps this field as a String, length 3.
<property name="description" type="java.lang.String" access="field" column="CURRENCY_TYPE_CODE" length="3" not-null="true" />
In my code, I am finding the currency using the find method:
return getHibernateTemplate().find("from CurrencyType ct where ct.description = ?", description);
This returns a list of CurrencyType objects, however, the Currency code field always seems to be padded to 12 chars - e.g. USD with 9 trailing spaces
I have tried changing the field to a VARCHAR2, which works fine, however for efficiency, we would prefer to use CHAR. Am I missing something in my mapping, or will this not actually work with a CHAR data type?
Thanks
|