Hi! Also, you will find "child & father" ideas in thread [1]. The FAQ [2] mentions it too.
As for IDENTITY with Oracle, you could try the emulation feature [3]. It emulates auto-increment columns by using triggers. Regards, Milosz [1] http://n2.nabble.com/Inconsistent-behaviour-with-Bi-directional-One-to-Many-Mapping.-tp2570464p2570464.html [2] http://openjpa.apache.org/faq.html [3] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_dbsetup_dbsupport_oracle > Hi, > > Which version of OpenJPA are you using? > > OpenJPA does not assume there are any constraints in the database unless you > add the @ForeignKey annotation or configure OpenJPA to read constraints from > the database. As a result we can sometimes do inserts out of order.. I tried > to make this less likely to happen (without changing the underlying > assumption about constraints) in OPENJPA-817 [1]. It isn't perfect but it > should help for your scenario. > > [1] http://issues.apache.org/jira/browse/OPENJPA-817 > > -mike > > On Mon, Jun 22, 2009 at 6:03 AM, wang yu wrote: > > > Hello, > > If I use GenerationType.AUTO or GenerationType.TABLE for PK field and > > let OpenJPA persist some entities cascade , in some cases, OpenJPA > > will try to persist child entity before the father entity. > > How to resolve this issue? > > > > I must use GenerationType.AUTO for oracle because it doesn't support > > GenerationType.IDENTITY naturally. > > Or do I have a chance to use GenerationType.IDENTITY for Pk fields > > of oracle database? > > > > I have attached the log information in attached file. > > > > Thanks! > > > > Regards, > > Yu Wang > > >
