Re: pessimistic locking

2007-01-12 Thread Marc Prud'hommeaux
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

@ForeignKey not allowed for @ManyToMany

2007-01-12 Thread Vlad Tatavu
Is there a reason why @ForeignKey is not allowed for @ManyToMany? Vlad

Re: @ForeignKey not allowed for @ManyToMany

2007-01-12 Thread Abe White
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,

Re: @ForeignKey not allowed for @ManyToMany

2007-01-12 Thread Vlad Tatavu
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

RE: MappingTool does not create not null column for @ManyToOne(optional=false)

2007-01-12 Thread Patrick Linskey
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

RE: MappingTool does not create not null column for @ManyToOne(optional=false)

2007-01-12 Thread Vlad Tatavu
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