openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart Bedoll <bed...@us.ibm.com>
Subject Is there a known issue with one-to-many/many-to-one object mapping ?
Date Fri, 12 Oct 2007 23:24:01 GMT


I am trying to store a simple parent/child object model in our Oracle DB.
With openjpa 1.0 snapshot (from july) this works 60% of the time.  The
other 40% of the time the Insert  sql for the child object is executed
before the Insert sql of the parent. Thus, the parent key not found sql
exception occurs. I moved up to openjpa 1.0 release and it now happens
every time.  I followed the example in the Users manual example 12.17 using
Company as the parent and Magazine as the child object.

Child object has this annotation:

@ManyToOne(fetch=FetchType.LAZY, cascade=CascadeType.PERSIST)
@JoinColumn(name="PUB_ID")
private Company publisher;


Parent object has this annotation:

@OneToMany(mappedBy="publisher", cascade=CascadeType.PERSIST)
private Collection<Magazine> mags;
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message