[jboss-cvs] JBossAS SVN: r95190 - in projects/metadata/trunk/src: main/resources/schema and 5 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 20 13:01:15 EDT 2009


Author: epbernard
Date: 2009-10-20 13:01:15 -0400 (Tue, 20 Oct 2009)
New Revision: 95190

Added:
   projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/SharedCacheMode.java
   projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/ValidationMode.java
   projects/metadata/trunk/src/main/resources/schema/persistence_2_0.xsd
   projects/metadata/trunk/src/test/java/org/jboss/test/metadata/jpa/v2/
   projects/metadata/trunk/src/test/java/org/jboss/test/metadata/jpa/v2/PersistenceMDUnitTestCase.java
   projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/
   projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testDefaultMetaData.xml
   projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testMultipleMetaData.xml
   projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testMultipleProperties.xml
Modified:
   projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/PersistenceUnitMetaData.java
   projects/metadata/trunk/src/test/resources/schema2class.properties
Log:
JBMETA-223 add support for JPA 2 parsing

Modified: projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/PersistenceUnitMetaData.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/PersistenceUnitMetaData.java	2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/PersistenceUnitMetaData.java	2009-10-20 17:01:15 UTC (rev 95190)
@@ -43,7 +43,8 @@
  *
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
- at XmlType(propOrder={"description", "provider", "jtaDataSource", "nonJtaDataSource", "mappingFiles", "jarFiles", "classes", "excludeUnlistedClasses", "properties"})
+ at XmlType(propOrder={"description", "provider", "jtaDataSource", "nonJtaDataSource", "mappingFiles",
+      "jarFiles", "classes", "excludeUnlistedClasses", "sharedCacheMode", "validationMode", "properties"})
 public class PersistenceUnitMetaData extends JBossObject implements Serializable
 {
    private String description;
@@ -57,7 +58,31 @@
    private Map<String, String> properties;
    private String name;
    private TransactionType transactionType;
+   private SharedCacheMode sharedCacheMode;
+   private ValidationMode validationMode;
 
+   @XmlElement
+   public SharedCacheMode getSharedCacheMode()
+   {
+      return sharedCacheMode;
+   }
+
+   public void setSharedCacheMode(SharedCacheMode sharedCacheMode)
+   {
+      this.sharedCacheMode = sharedCacheMode;
+   }
+
+   @XmlElement
+   public ValidationMode getValidationMode()
+   {
+      return validationMode;
+   }
+
+   public void setValidationMode(ValidationMode validationMode)
+   {
+      this.validationMode = validationMode;
+   }
+   
    public String getDescription()
    {
       return description;

Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/SharedCacheMode.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/SharedCacheMode.java	                        (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/SharedCacheMode.java	2009-10-20 17:01:15 UTC (rev 95190)
@@ -0,0 +1,16 @@
+package org.jboss.metadata.jpa.spec;
+
+import org.jboss.xb.annotations.JBossXmlEnum;
+
+/**
+ * @author Emmanuel Bernard
+ */
+ at JBossXmlEnum(ignoreCase = true)
+public enum SharedCacheMode
+{
+   ALL,
+   NONE,
+   ENABLE_SELECTIVE,
+   DISABLE_SELECTIVE,
+   UNSPECIFIED
+}

Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/ValidationMode.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/ValidationMode.java	                        (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/jpa/spec/ValidationMode.java	2009-10-20 17:01:15 UTC (rev 95190)
@@ -0,0 +1,14 @@
+package org.jboss.metadata.jpa.spec;
+
+import org.jboss.xb.annotations.JBossXmlEnum;
+
+/**
+ * @author Emmanuel Bernard
+ */
+ at JBossXmlEnum(ignoreCase = true)
+public enum ValidationMode
+{
+   AUTO,
+   CALLBACK,
+   NONE
+}

Added: projects/metadata/trunk/src/main/resources/schema/persistence_2_0.xsd
===================================================================
--- projects/metadata/trunk/src/main/resources/schema/persistence_2_0.xsd	                        (rev 0)
+++ projects/metadata/trunk/src/main/resources/schema/persistence_2_0.xsd	2009-10-20 17:01:15 UTC (rev 95190)
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- persistence.xml schema -->
+<xsd:schema targetNamespace="http://java.sun.com/xml/ns/persistence"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            xmlns:persistence="http://java.sun.com/xml/ns/persistence"
+            elementFormDefault="qualified"
+            attributeFormDefault="unqualified"
+            version="2.0">
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)persistence_2_0.xsd 1.0 October 1 2009
+    </xsd:documentation>
+  </xsd:annotation>
+  <xsd:annotation>
+    <xsd:documentation><![CDATA[
+     This is the XML Schema for the persistence configuration file.
+     The file must be named "META-INF/persistence.xml" in the
+     persistence archive.
+     Persistence configuration files must indicate
+     the persistence schema by using the persistence namespace:
+     http://java.sun.com/xml/ns/persistence
+     and indicate the version of the schema by
+     using the version element as shown below:
+      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
+        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>
+    ]]></xsd:documentation>
+  </xsd:annotation>
+  <xsd:simpleType name="versionType">
+    <xsd:restriction base="xsd:token">
+      <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <!-- **************************************************** -->
+  <xsd:element name="persistence">
+    <xsd:complexType>
+      <xsd:sequence>
+        <!-- **************************************************** -->
+        <xsd:element name="persistence-unit"
+                     minOccurs="1" maxOccurs="unbounded">
+          <xsd:complexType>
+            <xsd:annotation>
+              <xsd:documentation>
+                Configuration of a persistence unit.
+              </xsd:documentation>
+            </xsd:annotation>
+            <xsd:sequence>
+              <!-- **************************************************** -->
+              <xsd:element name="description" type="xsd:string"
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    Description of this persistence unit.
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+              <!-- **************************************************** -->
+              <xsd:element name="provider" type="xsd:string"
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    Provider class that supplies EntityManagers for this
+                    persistence unit.
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+              <!-- **************************************************** -->
+              <xsd:element name="jta-data-source" type="xsd:string"
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    The container-specific name of the JTA datasource to use.
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+              <!-- **************************************************** -->
+              <xsd:element name="non-jta-data-source" type="xsd:string"
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    The container-specific name of a non-JTA datasource to use.
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+              <!-- **************************************************** -->
+              <xsd:element name="mapping-file" type="xsd:string"
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    File containing mapping information. Loaded as a resource
+                    by the persistence provider.
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+              <!-- **************************************************** -->
+              <xsd:element name="jar-file" type="xsd:string"
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    Jar file that is to be scanned for managed classes.
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+              <!-- **************************************************** -->
+              <xsd:element name="class" type="xsd:string"
+                           minOccurs="0" maxOccurs="unbounded">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    Managed class to be included in the persistence unit and
+                    to scan for annotations. It should be annotated
+                    with either @Entity, @Embeddable or @MappedSuperclass.
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+              <!-- **************************************************** -->
+              <xsd:element name="exclude-unlisted-classes" type="xsd:boolean"
+                           default="true" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    When set to true then only listed classes and jars will
+                    be scanned for persistent classes, otherwise the
+                    enclosing jar or directory will also be scanned.
+                    Not applicable to Java SE persistence units.
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+              <!-- **************************************************** -->
+              <xsd:element name="shared-cache-mode"
+                           type="persistence:persistence-unit-caching-type"
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    Defines whether caching is enabled for the
+                    persistence unit if caching is supported by the
+                    persistence provider. When set to ALL, all entities
+                    will be cached. When set to NONE, no entities will
+                    be cached. When set to ENABLE_SELECTIVE, only entities
+                    specified as cacheable will be cached. When set to
+                    DISABLE_SELECTIVE, entities specified as not cacheable
+                    will not be cached. When not specified or when set to
+                    UNSPECIFIED, provider defaults may apply.
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+              <!-- **************************************************** -->
+              <xsd:element name="validation-mode"
+                           type="persistence:persistence-unit-validation-mode-type"
+                           minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    The validation mode to be used for the persistence unit.
+                  </xsd:documentation>
+                </xsd:annotation>
+              </xsd:element>
+              <!-- **************************************************** -->
+              <xsd:element name="properties" minOccurs="0">
+                <xsd:annotation>
+                  <xsd:documentation>
+                    A list of standard and vendor-specific properties
+                    and hints.
+                  </xsd:documentation>
+                </xsd:annotation>
+                <xsd:complexType>
+                  <xsd:sequence>
+                    <xsd:element name="property"
+                                 minOccurs="0" maxOccurs="unbounded">
+                      <xsd:annotation>
+                        <xsd:documentation>
+                          A name-value pair.
+                        </xsd:documentation>
+                      </xsd:annotation>
+                      <xsd:complexType>
+                        <xsd:attribute name="name" type="xsd:string"
+                                       use="required"/>
+                        <xsd:attribute name="value" type="xsd:string"
+                                       use="required"/>
+                      </xsd:complexType>
+                    </xsd:element>
+                  </xsd:sequence>
+                </xsd:complexType>
+              </xsd:element>
+            </xsd:sequence>
+            <!-- **************************************************** -->
+            <xsd:attribute name="name" type="xsd:string" use="required">
+              <xsd:annotation>
+                <xsd:documentation>
+                  Name used in code to reference this persistence unit.
+                </xsd:documentation>
+              </xsd:annotation>
+            </xsd:attribute>
+            <!-- **************************************************** -->
+            <xsd:attribute name="transaction-type"
+                           type="persistence:persistence-unit-transaction-type">
+              <xsd:annotation>
+                <xsd:documentation>
+                  Type of transactions used by EntityManagers from this
+                  persistence unit.
+                </xsd:documentation>
+              </xsd:annotation>
+            </xsd:attribute>
+          </xsd:complexType>
+        </xsd:element>
+      </xsd:sequence>
+      <xsd:attribute name="version" type="persistence:versionType"
+                     fixed="2.0" use="required"/>
+    </xsd:complexType>
+  </xsd:element>
+  <!-- **************************************************** -->
+  <xsd:simpleType name="persistence-unit-transaction-type">
+    <xsd:annotation>
+      <xsd:documentation>
+        public enum PersistenceUnitTransactionType {JTA, RESOURCE_LOCAL};
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="JTA"/>
+      <xsd:enumeration value="RESOURCE_LOCAL"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <!-- **************************************************** -->
+  <xsd:simpleType name="persistence-unit-caching-type">
+    <xsd:annotation>
+      <xsd:documentation>
+        public enum SharedCacheMode { ALL, NONE, ENABLE_SELECTIVE,
+        DISABLE_SELECTIVE, UNSPECIFIED};
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="ALL"/>
+      <xsd:enumeration value="NONE"/>
+      <xsd:enumeration value="ENABLE_SELECTIVE"/>
+      <xsd:enumeration value="DISABLE_SELECTIVE"/>
+      <xsd:enumeration value="UNSPECIFIED"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+  <!-- **************************************************** -->
+  <xsd:simpleType name="persistence-unit-validation-mode-type">
+    <xsd:annotation>
+      <xsd:documentation>
+        public enum ValidationMode { AUTO, CALLBACK, NONE};
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:restriction base="xsd:token">
+      <xsd:enumeration value="AUTO"/>
+      <xsd:enumeration value="CALLBACK"/>
+      <xsd:enumeration value="NONE"/>
+    </xsd:restriction>
+  </xsd:simpleType>
+</xsd:schema>
\ No newline at end of file

Added: projects/metadata/trunk/src/test/java/org/jboss/test/metadata/jpa/v2/PersistenceMDUnitTestCase.java
===================================================================
--- projects/metadata/trunk/src/test/java/org/jboss/test/metadata/jpa/v2/PersistenceMDUnitTestCase.java	                        (rev 0)
+++ projects/metadata/trunk/src/test/java/org/jboss/test/metadata/jpa/v2/PersistenceMDUnitTestCase.java	2009-10-20 17:01:15 UTC (rev 95190)
@@ -0,0 +1,116 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.metadata.jpa.v2;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.metadata.jpa.spec.PersistenceMetaData;
+import org.jboss.metadata.jpa.spec.PersistenceUnitMetaData;
+import org.jboss.metadata.jpa.spec.ValidationMode;
+import org.jboss.metadata.jpa.spec.SharedCacheMode;
+import org.jboss.test.metadata.javaee.AbstractJavaEEMetaDataTest;
+
+/**
+ * Test persistence metadata.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ * @author Emmanuel Bernard
+ *
+ * @version $Revision:$
+ */
+public class PersistenceMDUnitTestCase extends AbstractJavaEEMetaDataTest
+{
+   public PersistenceMDUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testDefaultMetaData() throws Throwable
+   {
+      List<PersistenceUnitMetaData> units = getPersistenceUnits(1);
+      PersistenceUnitMetaData unit = units.get(0);
+      testPersistenceUnitMetaData(unit, "manager", "java:/DefaultDS", Collections.singleton("persistence.jar"), "hibernate.hbm2ddl.auto", "create-drop");
+      assertEquals( ValidationMode.AUTO, unit.getValidationMode() );
+      assertEquals(SharedCacheMode.ENABLE_SELECTIVE, unit.getSharedCacheMode() );
+   }
+
+   public void testMultipleMetaData() throws Exception
+   {
+      List<PersistenceUnitMetaData> units = getPersistenceUnits(2);
+      PersistenceUnitMetaData unit = units.get(0);
+      testPersistenceUnitMetaData(unit, "manager", "java:/DefaultDS", Collections.singleton("persistence.jar"), "hibernate", "create-drop");
+      unit = units.get(1);
+      testPersistenceUnitMetaData(unit, "dev", "java:/MySqlDS", new HashSet<String>(Arrays.asList("dev.jar", "foobar.jar")), "hibernate", "validate");
+   }
+
+   public void testMultipleProperties() throws Exception
+   {
+      List<PersistenceUnitMetaData> units = getPersistenceUnits(1);
+      PersistenceUnitMetaData unit = units.get(0);
+      assertEquals("bookingDatabase", unit.getName());
+      assertEquals("org.hibernate.ejb.HibernatePersistence", unit.getProvider());
+      assertEquals("java:/bookingDatasource", unit.getJtaDataSource());
+
+      Map<String, String> properties = unit.getProperties();
+      assertNotNull(properties);
+      String p0 = properties.get("hibernate.hbm2ddl.auto");
+      assertEquals("create-drop", p0);
+      String p1 = properties.get("hibernate.show_sql");
+      assertEquals("true", p1);
+      String p2 = properties.get("hibernate.cache.provider_class");
+      assertEquals("org.hibernate.cache.HashtableCacheProvider", p2);
+      String p3 = properties.get("hibernate.transaction.manager_lookup_class");
+      assertEquals("org.hibernate.transaction.JBossTransactionManagerLookup", p3);
+   }
+
+   protected List<PersistenceUnitMetaData> getPersistenceUnits(int size) throws Exception
+   {
+      Class<PersistenceMetaData> expected = PersistenceMetaData.class;
+      PersistenceMetaData metadata = unmarshal(expected);
+      assertEquals("2.0", metadata.getVersion());
+      List<PersistenceUnitMetaData> units = metadata.getPersistenceUnits();
+      assertNotNull(units);
+      assertEquals(size, units.size());
+      return units;
+   }
+
+   protected void testPersistenceUnitMetaData(
+         PersistenceUnitMetaData unit,
+         String name,
+         String ds,
+         Set<String> jars,
+         String propertyKey,
+         String propertyValue)
+   {
+      assertEquals(name, unit.getName());
+      assertEquals(ds, unit.getJtaDataSource());
+      assertEquals(jars, unit.getJarFiles());
+      Map<String, String> properties = unit.getProperties();
+      assertNotNull(properties);
+      assertEquals(propertyValue, properties.get(propertyKey));
+   }
+}
\ No newline at end of file

Added: projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testDefaultMetaData.xml
===================================================================
--- projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testDefaultMetaData.xml	                        (rev 0)
+++ projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testDefaultMetaData.xml	2009-10-20 17:01:15 UTC (rev 95190)
@@ -0,0 +1,15 @@
+<?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"
+             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="manager">
+    <jta-data-source>java:/DefaultDS</jta-data-source>
+    <jar-file>persistence.jar</jar-file>
+    <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
+    <validation-mode>AUTO</validation-mode>
+    <properties>
+      <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+    </properties>
+  </persistence-unit>
+</persistence>

Added: projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testMultipleMetaData.xml
===================================================================
--- projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testMultipleMetaData.xml	                        (rev 0)
+++ projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testMultipleMetaData.xml	2009-10-20 17:01:15 UTC (rev 95190)
@@ -0,0 +1,21 @@
+<?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"
+   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="manager">
+      <jta-data-source>java:/DefaultDS</jta-data-source>
+      <jar-file>persistence.jar</jar-file>
+      <properties>
+         <property name="hibernate" value="create-drop"/>
+      </properties>
+   </persistence-unit>
+   <persistence-unit name="dev">
+      <jta-data-source>java:/MySqlDS</jta-data-source>
+      <jar-file>dev.jar</jar-file>
+      <jar-file>foobar.jar</jar-file>
+      <properties>
+         <property name="hibernate" value="validate"/>
+      </properties>
+   </persistence-unit>
+</persistence>

Added: projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testMultipleProperties.xml
===================================================================
--- projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testMultipleProperties.xml	                        (rev 0)
+++ projects/metadata/trunk/src/test/resources/org/jboss/test/metadata/jpa/v2/PersistenceMD_testMultipleProperties.xml	2009-10-20 17:01:15 UTC (rev 95190)
@@ -0,0 +1,17 @@
+<?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"
+    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="bookingDatabase">
+        <provider>org.hibernate.ejb.HibernatePersistence</provider>
+        <jta-data-source>java:/bookingDatasource</jta-data-source>
+        <properties>
+            <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+            <property name="hibernate.show_sql" value="true"/>
+            <!-- These are the default for JBoss EJB3, but not for HEM: -->
+            <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+            <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
+        </properties>
+    </persistence-unit>
+</persistence>

Modified: projects/metadata/trunk/src/test/resources/schema2class.properties
===================================================================
--- projects/metadata/trunk/src/test/resources/schema2class.properties	2009-10-20 16:33:24 UTC (rev 95189)
+++ projects/metadata/trunk/src/test/resources/schema2class.properties	2009-10-20 17:01:15 UTC (rev 95190)
@@ -45,6 +45,7 @@
 
 # JPA
 persistence_1_0.xsd org.jboss.metadata.jpa.spec.PersistenceMetaData
+persistence_2_0.xsd org.jboss.metadata.jpa.spec.PersistenceMetaData
 
 # RA
 connector_1_5.xsd org.jboss.metadata.rar.spec.JCA15MetaData




More information about the jboss-cvs-commits mailing list