Hello everybody!
We moved a working application utilizing Hibernate 3.2.6 from Java 1.4 (SUN JRE) to Java 1.6 (SAP JRE) without changing mapping, queries, configuration etc.
After this migration, everything worked fine except one query with a where clause referring only one column of a composite id. This query did not throw any exception with Java 1.4 using org.hibernate.dialect.Oracle9Dialect:
Code:
Query q = session.createQuery("from dao.MyClass where col1 = :val1 and id.cls in (:clsList)");
With Java 1.6, I receive
Code:
java.sql.SQLSyntaxErrorException: ORA-00904: "ID"."CLS": invalid identifier
The associated mapping is
Code:
<class name="dao.MyClass" table="MYTABLE" schema="MYSCHEMA">
<composite-id name="id" class="dao.MyClassId">
<key-property name="cls" type="long">
<column name="CLS" precision="10" scale="0" />
</key-property>
<key-property name="oid" type="big_decimal">
<column name="OID" precision="20" scale="0" />
</key-property>
</composite-id>
<timestamp name="ts" column="TS" source="db"/>
<property name="col1" type="int">
<column name="COL1" precision="7" scale="0" not-null="true" />
</property>
...and lots of other properties...
</class>
Do you have any idea on what might be causing this ? Again, nothing was changed except the executing JRE (and maybe the JDBC connection pool defined in the application server).
Thanks a lot
Michael