users@glassfish.java.net

automatic creation of foreign key constraint using open JPA

From: <glassfish_at_javadesktop.org>
Date: Sat, 15 Dec 2007 23:31:43 PST

Hi all

is there some property which must be added into persistance.xml to automatically create a foreign key constraint along with automatic schema generation

my xml is
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
        <persistence-unit name="perunit">
        <jta-data-source>
            jdbc/pds
        </jta-data-source>
        <class>panther.SessionBeans.Customer</class>
        <class>panther.SessionBeans.Record</class>
        <properties>
        <property name="openjpa.jdbc.SynchronizeMappings"
        value="buildSchema(ForeignKeys=true)"/>
        </properties>
        </persistence-unit>
        </persistence>


there is a one many relation between customer and record

Thanks
Pramod k
[Message sent by forum member 'pramodk83' (pramodk83)]

http://forums.java.net/jive/thread.jspa?messageID=250279