users@glassfish.java.net

entity relation mappings - parent key voilated error

From: <glassfish_at_javadesktop.org>
Date: Wed, 28 Jan 2009 12:26:35 PST

Guys,

I have three tables as follows:

Table1
_______
ID | R_ID

Table 2
_______
ID

Table3
_______
ID

Now Table1->R_ID is mapped to Table2->ID and
Table2 -> ID is mapped to Table3 -> ID

R_ID is a generated by a Sequence in the Table1 entity...And I want it to be reflected the same in the Table2 and Table3. Thats the reason, I added foreign key constraint as shown above

Now when ever I do
em.persist(table1);
em.persist(table2);
em.persist(table3);

I am getting parent key not found error...what am I doing wrong...is there something wrong with my database design

-Amor
[Message sent by forum member 'amorous' (amorous)]

http://forums.java.net/jive/thread.jspa?messageID=328773