openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jrba...@apache.org
Subject svn commit: r807686 - in /openjpa/trunk: openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/ openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/ openjpa-persistence/src/main/resources/org/apac...
Date Tue, 25 Aug 2009 16:14:00 GMT
Author: jrbauer
Date: Tue Aug 25 16:14:00 2009
New Revision: 807686

URL: http://svn.apache.org/viewvc?rev=807686&view=rev
Log:
OPENJPA-1262 ORM Schema updates for EA7

Modified:
    openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java
    openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingSerializer.java
    openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/named-constraint-orm.xml
    openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/orm_2_0-xsd.rsrc
    openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_meta.xml

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java?rev=807686&r1=807685&r2=807686&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingParser.java
Tue Aug 25 16:14:00 2009
@@ -1156,14 +1156,12 @@
     private boolean startUniqueConstraint(Attributes attrs) 
         throws SAXException {
         Unique unique = new Unique();
-        // TODO JRB: If the spec is corrected, get the unique constraint name
-		// via attribute
-		/*
+
         String name = attrs.getValue("name");
         if (StringUtils.isNotEmpty(name)) {
             unique.setName(name);
         }
-		*/
+
         pushElement(unique);
         return true;
     }

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingSerializer.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingSerializer.java?rev=807686&r1=807685&r2=807686&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingSerializer.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/XMLPersistenceMappingSerializer.java
Tue Aug 25 16:14:00 2009
@@ -567,12 +567,7 @@
 
     private void serializeUniqueConstraint(Unique unique) throws SAXException {
         if (StringUtils.isNotEmpty(unique.getName())) {
-        	//TODO JRB: If the spec is modified to use a name attribute
-        	// remove the element def and uncomment the attribute def
-        	startElement("name");
-        	addText(unique.getName());
-        	endElement("name");
-//            addAttribute("name", unique.getName());
+            addAttribute("name", unique.getName());
         }
         startElement("unique-constraint");
         Column[] columns = unique.getColumns();

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/named-constraint-orm.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/named-constraint-orm.xml?rev=807686&r1=807685&r2=807686&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/named-constraint-orm.xml
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/test/resources/org/apache/openjpa/persistence/jdbc/unique/named-constraint-orm.xml
Tue Aug 25 16:14:00 2009
@@ -30,20 +30,17 @@
 	<package>org.apache.openjpa.persistence.jdbc.unique</package>
 	<entity name="NamedUniqueA" class="NamedUniqueA">
 		<table name="NX_UNIQUE_A">
-			<unique-constraint>
-                <name>ucxa_f1_f2</name>
+			<unique-constraint name="ucxa_f1_f2">
 				<column-name>f1x</column-name>
 				<column-name>f2x</column-name>
 			</unique-constraint>
-			<unique-constraint>
-                <name>ucxa_f3_f4</name>
+			<unique-constraint name="ucxa_f3_f4">
 				<column-name>f3x</column-name>
 				<column-name>f4x</column-name>
 			</unique-constraint>
 		</table>
 		<secondary-table name="NX_UNIQUE_SECONDARY">
-			<unique-constraint>
-                <name>ucxa_sf1</name>
+			<unique-constraint name="ucxa_sf1">
 				<column-name>sf1x</column-name>
 			</unique-constraint>
 		</secondary-table>
@@ -79,8 +76,7 @@
 				<join-table name="NX_UNIQUE_JOINTABLE">
 					<join-column name="FK_A_XML" referenced-column-name="aid" nullable="false"/>
 					<inverse-join-column name="FK_B_XML" referenced-column-name="bid" nullable="false"/>
-					<unique-constraint>
-                        <name>ucxa_fka_fkb</name>
+					<unique-constraint name="ucxa_fka_fkb">
 						<column-name>FK_A_XML</column-name>
 						<column-name>FK_B_XML</column-name>
 					</unique-constraint>
@@ -91,8 +87,7 @@
 
 	<entity name="NamedUniqueB" class="NamedUniqueB">
 		<table name="NX_UNIQUE_B">
-			<unique-constraint>
-                <name>ucxb_f1_f2</name>
+			<unique-constraint name="ucxb_f1_f2">
 				<column-name>f1x</column-name>
 				<column-name>f2x</column-name>
 			</unique-constraint>
@@ -104,8 +99,7 @@
 				<table-generator name="testGeneratorXML"
 					table="NX_UNIQUE_GENERATOR" pk-column-name="GEN1_XML"
 					value-column-name="GEN2_XML">
-					<unique-constraint>
-                        <name>ucxb_gen1_gen2</name>
+					<unique-constraint name="ucxb_gen1_gen2">
 						<column-name>GEN1_XML</column-name>
 						<column-name>GEN2_XML</column-name>
 					</unique-constraint>
@@ -120,8 +114,7 @@
             <element-collection name="f3">
                 <column name="f3x" nullable="false"/>
                 <collection-table name="NX_U_COLL_TBL">
-                    <unique-constraint>
-                        <name>ucxb_f3</name>
+                    <unique-constraint name="ucxb_f3">
                         <column-name>f3x</column-name>
                     </unique-constraint>
                 </collection-table>

Modified: openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/orm_2_0-xsd.rsrc
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/orm_2_0-xsd.rsrc?rev=807686&r1=807685&r2=807686&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/orm_2_0-xsd.rsrc
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/orm_2_0-xsd.rsrc
Tue Aug 25 16:14:00 2009
@@ -7,7 +7,7 @@
     version="2.0">
     <xsd:annotation>
         <xsd:documentation>
-            @(#)orm_2_0.xsd 2.0 July 17 2009
+            @(#)orm_2_0.xsd 2.0 August 11 2009
         </xsd:documentation>
     </xsd:annotation>
     <xsd:annotation>
@@ -1646,11 +1646,10 @@
             </xsd:documentation>
         </xsd:annotation>
         <xsd:sequence>
-            <xsd:element name="name" type="xsd:string"
-                minOccurs="0" />
             <xsd:element name="column-name" type="xsd:string"
                 maxOccurs="unbounded" />
         </xsd:sequence>
+        <xsd:attribute name="name" type="xsd:string" />
     </xsd:complexType>
     <!-- **************************************************** -->
     <xsd:complexType name="version">

Modified: openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_meta.xml
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_meta.xml?rev=807686&r1=807685&r2=807686&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_meta.xml (original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_meta.xml Tue Aug 25 16:14:00
2009
@@ -2042,7 +2042,7 @@
     version="2.0"&gt;
     &lt;xsd:annotation&gt;
         &lt;xsd:documentation&gt;
-            @(#)orm_2_0.xsd 2.0 July 17 2009
+            @(#)orm_2_0.xsd 2.0 August 11 2009
         &lt;/xsd:documentation&gt;
     &lt;/xsd:annotation&gt;
     &lt;xsd:annotation&gt;
@@ -3683,11 +3683,10 @@
             &lt;/xsd:documentation&gt;
         &lt;/xsd:annotation&gt;
         &lt;xsd:sequence&gt;
-            &lt;xsd:element name="name" type="xsd:string"
-                minOccurs="0" /&gt;
             &lt;xsd:element name="column-name" type="xsd:string"
                 maxOccurs="unbounded" /&gt;
         &lt;/xsd:sequence&gt;
+        &lt;xsd:attribute name="name" type="xsd:string" /&gt;        
     &lt;/xsd:complexType&gt;
     &lt;!-- **************************************************** --&gt;
     &lt;xsd:complexType name="version"&gt;



Mime
View raw message