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: [email protected]
For additional commands, e-mail: [email protected]