openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From garpinc <>
Subject Re: is it possible to save just the primary key of an object reference?
Date Sat, 11 Aug 2012 15:04:12 GMT
To clarify..
Let's say I have 3 tables..

table A
table AxrefB
table B

and I also have table C which a foreign key to the primary key of A and B
i.e: A(Cpk1), AxrefB(Apk,Cpk2), B(Cpk2)

What I want to do is have a relaxed foreign key constraint so I can save
AxrefB before saving B

So the process would be 
1) I'm saving an A so I create a C1 and assign it to A
2) but A also has a relationship to B so to save that relationship currently
I'd have to create C2 and assign it to B and then assign B to A's collection
and when I save A, B would also be saved.

What I want to do is create C2 and somehow just persist AxrefB.
Then later when i'm persisting B I look for C2 using other criteria that
relates B to C2 and then assign C2 to B and finally save B.

So is there a way to map this?

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message