Author: eric
Date: Fri Jan 14 12:35:47 2011
New Revision: 1058984

URL: http://svn.apache.org/viewvc?rev=1058984&view=rev
Log:
Example to overwrite the JPA annotations (MAILBOX-13)

Added:
    
james/server/trunk/container-spring/src/main/config/examples/META-INF/jpa-mappings.xml
Modified:
    
james/server/trunk/container-spring/src/main/config/examples/META-INF/persistence.xml

Added: 
james/server/trunk/container-spring/src/main/config/examples/META-INF/jpa-mappings.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/container-spring/src/main/config/examples/META-INF/jpa-mappings.xml?rev=1058984&view=auto
==============================================================================
--- 
james/server/trunk/container-spring/src/main/config/examples/META-INF/jpa-mappings.xml
 (added)
+++ 
james/server/trunk/container-spring/src/main/config/examples/META-INF/jpa-mappings.xml
 Fri Jan 14 12:35:47 2011
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.    
+-->
+
+<!-- Use this file to overwriting the annotations defined in the JPA domain 
classes -->
+
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm";
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm 
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd";
+    version="2.0">
+    
+    <entity class="org.apache.james.mailbox.jpa.mail.model.JPAHeader">
+
+        <table name="JAMES_MAIL_HEADER"/>
+        
+        <attributes>
+            <basic name="value">
+                <column name="HEADER_VALUE" length="8000" />
+            </basic>
+        </attributes>
+
+    </entity>
+    
+</entity-mappings>

Modified: 
james/server/trunk/container-spring/src/main/config/examples/META-INF/persistence.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/container-spring/src/main/config/examples/META-INF/persistence.xml?rev=1058984&r1=1058983&r2=1058984&view=diff
==============================================================================
--- 
james/server/trunk/container-spring/src/main/config/examples/META-INF/persistence.xml
 (original)
+++ 
james/server/trunk/container-spring/src/main/config/examples/META-INF/persistence.xml
 Fri Jan 14 12:35:47 2011
@@ -24,6 +24,9 @@
     version="2.0">
 
     <persistence-unit name="James" transaction-type="RESOURCE_LOCAL">
+    
+    <!-- Use the mappings to overwriting the annotations defined in the JPA 
domain classes -->
+    <mapping-file>META-INF/jpa-mappings.xml</mapping-file>
 
         <!-- Mailbox stuff-->
         <class>org.apache.james.mailbox.jpa.mail.model.JPAHeader</class>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to