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 clas

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 appropri

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

2007-01-12 Thread Vlad Tatavu
If I use @ManyToOne(optional=false) to annotate an attribute, the MappingTool does not create a NOT NULL column in the corresponding table. Bug? Vlad

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: @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,

@ForeignKey not allowed for @ManyToMany

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

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 Mahesh

pessimistic locking

2007-01-12 Thread Ritika Maheshwari
I have the following properties defined in my persistence.xml Even then the sql for the query em.createQuery("select object(o) from Neworders o where o.no_w_id=:warehouseId and o.no_d_id=:districtId ") does not have the With RS USE AND KEEP UPDATE LOCKS. However if I make the followi