Hibernate version:
3.1
Mapping documents:
<class name="com.inet.dao.Lctqtcp2" table="LCTQTCP2" schema="LANCELOT">
<composite-id name="id" class="com.inet.dao.Lctqtcp2Id">
<key-property name="cpId" type="character">
<column name="CP_ID" length="1" />
</key-property>
<key-property name="leId" type="string">
<column name="LE_ID" length="32" />
</key-property>
</composite-id>
<many-to-one name="lctqtle1" class="com.inet.dao.Lctqtle1" update="false" insert="false" fetch="select">
<column name="LE_ID" length="32" not-null="true" />
</many-to-one>
<many-to-one name="lctqtcp1" class="com.inet.dao.Lctqtcp1" update="false" insert="false" fetch="select">
<column name="CP_ID" length="1" not-null="true" />
</many-to-one>
</class>
Full stack trace of any exception that occurs:
Hibernate: SELECT cp2.*, le1.* FROM Lctqtcp2 cp2, Lctqtle1 le1 WHERE cp2.LE_ID=le1.LE_ID
Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object;
Hi,
I would like to have the same result with this request
session.createCriteria(Lctqtcp2.class).setFetchMode("lctqtle1", FetchMode.JOIN).list() >OK
and this another one but it doesn't work ??? Why not ? addJoin ?
session.createSQLQuery("SELECT cp2.*, le1.* FROM Lctqtcp2 cp2, Lctqtle1 le1 WHERE cp2.LE_ID=le1.LE_ID") .addEntity(Lctqtcp2.class) .addJoin("Lctqtle1","Lctqtcp2.lctqtle1") .list(); > KO
Thanks...
|