on 06-24-2004 4:52 PM
Hello,
i'm trying to do a mapping the following way:
Node (1:n) Node where the Node should have the following
accessors:
getChildNodes() : Set
getParentalNode() : Node
I do have the getChildNodes mapping working, but cannot get the parental relation established due to problems with the Node.map file containing the following:
<relationship-field name="parentalNode" multiplicity="one">
<foreign-key name="NODE_TO_PARENTALNODE"
foreign-key-table="TPB_NODE"
primary-key-table="TPB_NODE">
<column-pair foreign-key-column="ID"
primary-key-column="PARENT_ID"/>
</foreign-key>
</relationship-field>
Using this the checker complains about
javax.jdo.JDOFatalUserException: Error in mapping model of class Node: Relationship of field parentalNode: Primary key column PARENT_ID of relationship's foreign key and target class's com.vw.tpb.node.model.Node primary key columns do not match.
Well. When i do a 1:n relation to myself how should i create two primary keys then ?
Anybody some ideas on this one ?
regards, Udo
Hi Udo,
for the reference from child to parent, the column "ID" should be the primary key colum, whereas the column "PARENT_ID" should be the foreign key column.
Best regards,
Adrian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.