You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by er...@apache.org on 2010/06/12 19:58:03 UTC

svn commit: r954039 - /james/server/trunk/spring-deployment/src/main/config/james/META-INF/persistence.xml

Author: eric
Date: Sat Jun 12 17:58:02 2010
New Revision: 954039

URL: http://svn.apache.org/viewvc?rev=954039&view=rev
Log:
Tell openjpa to create the database foreign keys.

Modified:
    james/server/trunk/spring-deployment/src/main/config/james/META-INF/persistence.xml

Modified: james/server/trunk/spring-deployment/src/main/config/james/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/spring-deployment/src/main/config/james/META-INF/persistence.xml?rev=954039&r1=954038&r2=954039&view=diff
==============================================================================
--- james/server/trunk/spring-deployment/src/main/config/james/META-INF/persistence.xml (original)
+++ james/server/trunk/spring-deployment/src/main/config/james/META-INF/persistence.xml Sat Jun 12 17:58:02 2010
@@ -2,7 +2,9 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
     version="2.0">
+
     <persistence-unit name="James" transaction-type="RESOURCE_LOCAL">
+
         <!-- Mailbox stuff-->
         <class>org.apache.james.imap.jpa.mail.model.JPAHeader</class>
         <class>org.apache.james.imap.jpa.mail.model.JPAMailbox</class>
@@ -31,7 +33,12 @@
         <properties>
             <!--  create tables on startup -->
             <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
-        
+            <!--  create foreign keys on startup -->
+            <property name="openjpa.jdbc.MappingDefaults" value="ForeignKeyDeleteAction=restrict, JoinForeignKeyDeleteAction=restrict"/>
+            <!--  reorder SQL statements to satisfy database foreign key constraints -->
+			<property name="openjpa.jdbc.SchemaFactory" value="native(ForeignKeys=true)"/>
         </properties>
+
     </persistence-unit>
+
 </persistence>



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org