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 <[email protected]> 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
>

Reply via email to