I think you also want to set openjpa.Optimistic to false. That
will default to non-optimistic transactions.
Setting the other properties (openjpa.LockManager,
openjpa.ReadLockLevel, openjpa.WriteLockLevel) are probably
unnecessary.
On Jan 12, 2007, at 11:56 AM, Ritika Maheshwari
Is there a reason why @ForeignKey is not allowed for @ManyToMany?
Vlad
Is there a reason why @ForeignKey is not allowed for @ManyToMany?
Because the field value is a collection, not a reference. You want
to use @ElementForeignKey.
___
Notice: This email message, together with any attachments,
I wouldn't say that's obvious, but it make sense and it works. Thanks!
Vlad
Abe White [EMAIL PROTECTED]
12/01/2007 03:24 PM
Please respond to
open-jpa-dev@incubator.apache.org
To
open-jpa-dev@incubator.apache.org
cc
Subject
Re: @ForeignKey not allowed for @ManyToMany
Is there a
See AnnotationPersistenceMetaDataParser.java:1201: if optional is false,
then OpenJPA (not the database) will throw an exception if a null is
specified. This is not propagated to foreign key constraints; those
should be configured via the @ForeignKey annotation, by setting the
updateAction
I don't have the OpenJPA code, so I cannot look at it.
You are right, OpenJPA will enforce the constraint in Java, but I expect
the MappingTool to apply the NOT NULL to the database for the attribute
that is annotated with @ManyToOne - not to the remote attribute.
Example:
@Entity
public class