Hibernate 3.2 / Spring 2.55 stack / oracle 9.2.0.8.0
I have a mapping of a domain object called 'Abc' which has a composite ID:
Code:
<hibernate-mapping>
<class lazy="true" table="ABC" name="Abc">
<composite-id name="id" class="AbcId">
<key-property name="q" column="Q" type="java.lang.Integer"/>
<key-property name="w" column="W" type="java.lang.Integer"/>
<key-property name="e" column="E" type="java.lang.String"/>
<key-property name="bad" column="BAD" type="java.lang.String"/>
</composite-id>
</class>
</hibernate-mapping>
I have another object called 'Audit' which has a many to one relationship with Abc:
Code:
<hibernate-mapping>
<class lazy="true" table="AUDIT" name="Audit">
<id name="id" type="big_decimal" column="ID">
<generator class="sequence">
<param name="sequence">AUDIT_SEQ</param>
</generator>
</id>
<many-to-one insert="false" update="false" class="Abc" fetch="select" name="abc">
<column name="Q"/>
<column name="W"/>
<column name="E"/>
<column name="BAD"/>
</many-to-one>
</class>
When I do a simple query of Audit (from Audit as a where a.id = ?)... i get the following exception:
INFO: could not read column value from result set: BAD13_6_; Fail to convert to internal representation
........
error code [17059]; Fail to convert to internal representation; nested exception is java.sql.SQLException: Fail to convert to internal representation
So it seems to have a problem with 'BAD'. Although when I do a direct query of 'Abc'... I have no problems.....
I have tried taking away the relationship to 'Abc' from Audit by just including Abc's Id components as properties in Audit. And that seems to query just fine...... although I need that relationship to retrieve other data from Abc.... and it just seems like its the right thing to do.
I can also tell you that 'BAD' is a varchar2(1)..... and I think if it maps back to a string it should still work.
Any ideas out there?
Thanks in advance