Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.1
Mapping documents:
<class name="com.inetpsa.dao.Lctqtcp2" table="LCTQTCP2" schema="LANCELOT">
<composite-id name="id" class="com.inetpsa.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.inetpsa.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.inetpsa.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;
Bonjour,
J'aimerai obtenir le même résultat que cette requette
session.createCriteria(Lctqtcp2.class).setFetchMode("lctqtle1", FetchMode.JOIN).list() >OK
avec celle - ci mais je n' y arrive pas.. ??? Pourquoi ? 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
Merci...