hello,
can we have a composite id composed of two other composite ids?
like:
<composite-id name="id" class="objects.edgeID">
<key-many-to-one name="SRC_NODE_ID" class="objects.nodeID">
<column name="SRC_NODE_ID"/>
<column name="SRC_GRAPH_ID"/>
</key-many-to-one>
<key-many-to-one name="DST_NODE_ID" class="objects.nodeID">
<column name="DST_NODE_ID"/>
<column name="DST_GRAPH_ID"/>
</key-many-to-one>
</composite-id>
I have an edge object with a composite id of edgeID. this edgeID is composed of two other nodeID objects, where nodeID is also composite key for object node.
with the above mapping I get the error:
An association from the table EDGES refers to an unmapped class: objects.nodeID
objects.node.ID is unmapped but from node.hbm.xml:
<class name="objects.node" table="NODES">
<composite-id name="id" class="objects.nodeID">
<key-property name="GRAPH_ID" type="java.lang.Integer">
<column name="GRAPH_ID" not-null="true" />
</key-property>
<key-property name="SURROGATE_ID" type="java.lang.Long">
<column name="SURROGATE_ID" not-null="true" />
</key-property>
</composite-id>
how am i supposed to do this? am i supposed to create a mapping for the nodeID class?
thanks,
-
|