-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Influence of Java version on generated SQL ?
PostPosted: Mon Mar 10, 2014 12:41 pm 
Newbie

Joined: Mon Mar 16, 2009 11:40 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.