Hello,
Can somebody please help me resolve this issue:
Hibernate version:
2.1.5
Mapping documents:
<class name="MainMessage" table="ParentMsg">
<id name="id" type="int" column="ID">
<generator class="native" />
</id>
<property name="version" type="int" column="VERSION" length="10" />
<property name="state" type="java.lang.String" column="STATE" not-null="true" length="1" />
<joined-subclass name="ChildMessage" table="ChildMsg" lazy="true">
<key column="VALUE_ID"/>
<property name=".......etc.. />
<set name="MessagesSet" sort="natural" order-by="MSG_ID">
<key column="MSG_ID" foreign-key="ID"/>
<one-to-many class="messages" />
</set>
</joined-subclass>
<query name="AllMessages">
<![CDATA[from MainMessage main
-------------------TO BE FILLED IN
where MessagesSet.someOtherId=?
]]>
</query>
</class>
I am looking for a query which can get me some data items from the MainMessage, some from ChildMessage and others from MessagesSet.
I am not sure how to set up the joins here. Or in other words how do I access the columns(properties) from the MessagesSet in the query above using MaintMessage, ChildMessage and MessagesSet all in the same query. The where clause actually contains columns belonging to the MessagesSet.
I keep getting some cglib errors or classcastexceptions, or "cannot resolve property" errors.
Name and version of the database you are using:
Oracle 9i
Debug level Hibernate log excerpt:
|