Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

Re: Inconsistent execution order of INSERT statements using
cascading persist

Pinaki Poddar

2008-08-07

Replies: Find Java Web Hosting

Author LoginPost Reply

Hi,
> Would using the OpenJPA "ForeignKey" annotation be a sufficient work
> around for not being able to use the native schema factory?

Good idea. Should work as well as this annotation tells OpenJPA that a
'logical' foreign key exists.
Have not tried/tested though. Let us know if this solves your problem.

> Also, if I use the operation-order update manager, would I need to
> explicitly insert the parent entity and child entities separately, or
> would the cascading persist work in that manner?

The cascade will insert parent first and child later if Parent.children is
annotated with CascadeType.PERSIST/ALL. The cascading scheme and sql
ordering strategy are not aware of each other but in this case they will be
consistent.


--
Sent from the OpenJPA Users mailing list archive at Nabble.com.

©2008 gg3721.com - Jax Systems, LLC, U.S.A.