users@glassfish.java.net

JPA: EmbeddedId and CascadeType.PERSIST

From: <glassfish_at_javadesktop.org>
Date: Fri, 11 Apr 2008 04:52:37 PDT

Hi,

persisting in cascade is very handy but I can't seem to make it work for classes using an EmbeddedId.
Suppose I have 2 classes: DocumentSequence and DocumentSequenceItem. A DocumentSequence can contain 1 or more DocumentSequenceItems. The primary key of a DocumentSequenceItem is a composed key of the unique id of the DocumentSequence and a sequencenumber.
Is it possible to persist a DocumentSequence containing one or more DocumentSequenceItems in cascade? When I try it I get a referential constraint violations!

I attached both files DocumentSequence.java and DocumentSequenceItem.java

Thanks in advance.

Kind regards,
Dirk Daems
[Message sent by forum member 'dirkdaems' (dirkdaems)]

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