Hi Georg,
By default OpenJPA does not create FK constraints in tables. One way to
change this behavior is to override the OpenJPA mapping defaults property
and set the
ForeignKeyDeleteAction=restrict.
Here's an example :
<property name="openjpa.jdbc.MappingDefaults"
value="ForeignKeyDeleteAction=restrict,
JoinForeignKeyDeleteAction=restrict"/>
There's an open issue about this problem :
https://issues.apache.org/jira/browse/OPENJPA-435 which provides a little
more information.
hth,
-mike
On Wed, Jul 2, 2008 at 9:04 AM, graffer <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> We are currently evaluating OpenJPA. We have a lot of OneToMany and
> ManyToOne relations.
>
> relevant part of persistence.xml:
> <property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO,
> Tool=INFO"/>
> <property name="openjpa.jdbc.DBDictionary" value="oracle(batchLimit=-1)"/>
> <property name="openjpa.jdbc.SynchronizeMappings"
> value="buildSchema(ForeignKeys=true)"/>
>
> When creating the tables on startup, no foreign keys are created.
> Using the SchemaBuilder also does not work.
>
> org.apache.openjpa.jdbc.meta.MappingTool -action buildSchema -foreignKeys
> true -sql d:/temp/create.sql
>
> creates a script without any foreign keys. Database used is Oracle 10g. Can
> anyone help with that issue?
>
> Thanks!
>
> Georg
>
> --
> View this message in context:
> http://n2.nabble.com/Foreign-keys-not-created%2C-Oracle-tp219733p219733.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>
>