cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r425934 - in /incubator/cayenne/main/trunk/cayenne-jpa/src: main/java/org/apache/cayenne/jpa/conf/ main/java/org/apache/cayenne/jpa/map/ test/java/org/apache/cayenne/jpa/entity/ test/resources/xml-samples/
Date Thu, 27 Jul 2006 02:57:50 GMT
Author: aadamchik
Date: Wed Jul 26 19:57:49 2006
New Revision: 425934

URL: http://svn.apache.org/viewvc?rev=425934&view=rev
Log:
refactoring jpa attribute superclass
checking in valid ORM XML test sample

Added:
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaAttribute.java
      - copied, changed from r425931, incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaAttributeDetail.java
Removed:
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaAttributeDetail.java
Modified:
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaBasic.java
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbeddableAttribute.java
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbedded.java
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbeddedId.java
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaId.java
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaRelationship.java
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaTransient.java
    incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaVersion.java
    incubator/cayenne/main/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/entity/MockMappedSuperclass3.java
    incubator/cayenne/main/trunk/cayenne-jpa/src/test/resources/xml-samples/orm-schema-headers-full.xml

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapAnnotationLoader.java
Wed Jul 26 19:57:49 2006
@@ -48,7 +48,7 @@
 
 import org.apache.cayenne.jpa.JpaProviderException;
 import org.apache.cayenne.jpa.map.JpaAbstractEntity;
-import org.apache.cayenne.jpa.map.JpaAttributeDetail;
+import org.apache.cayenne.jpa.map.JpaAttribute;
 import org.apache.cayenne.jpa.map.JpaClassDescriptor;
 import org.apache.cayenne.jpa.map.JpaManagedClass;
 import org.apache.cayenne.jpa.map.JpaPropertyDescriptor;
@@ -316,8 +316,8 @@
         public void push(Object object) {
 
             // do descriptor injection...
-            if (object instanceof JpaAttributeDetail) {
-                JpaAttributeDetail attribute = (JpaAttributeDetail) object;
+            if (object instanceof JpaAttribute) {
+                JpaAttribute attribute = (JpaAttribute) object;
                 attribute.setName(propertyDescriptor.getName());
                 attribute.setPropertyDescriptor(propertyDescriptor);
             }

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/conf/EntityMapDefaultsProcessor.java
Wed Jul 26 19:57:49 2006
@@ -26,7 +26,7 @@
 
 import org.apache.cayenne.jpa.JpaProviderException;
 import org.apache.cayenne.jpa.map.AccessType;
-import org.apache.cayenne.jpa.map.JpaAttributeDetail;
+import org.apache.cayenne.jpa.map.JpaAttribute;
 import org.apache.cayenne.jpa.map.JpaAttributes;
 import org.apache.cayenne.jpa.map.JpaBasic;
 import org.apache.cayenne.jpa.map.JpaClassDescriptor;
@@ -212,8 +212,8 @@
         public boolean onStartNode(ProjectPath path) {
             JpaColumn column = (JpaColumn) path.getObject();
 
-            JpaAttributeDetail parent = (JpaAttributeDetail) path
-                    .firstInstanceOf(JpaAttributeDetail.class);
+            JpaAttribute parent = (JpaAttribute) path
+                    .firstInstanceOf(JpaAttribute.class);
 
             if (column.getName() == null) {
                 column.setName(parent.getName());

Copied: incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaAttribute.java
(from r425931, incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaAttributeDetail.java)
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaAttribute.java?p2=incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaAttribute.java&p1=incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaAttributeDetail.java&r1=425931&r2=425934&rev=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaAttributeDetail.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaAttribute.java
Wed Jul 26 19:57:49 2006
@@ -19,7 +19,7 @@
 
 package org.apache.cayenne.jpa.map;
 
-public abstract class JpaAttributeDetail {
+public abstract class JpaAttribute {
 
     protected String name;
     protected JpaPropertyDescriptor propertyDescriptor;

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaBasic.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaBasic.java?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaBasic.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaBasic.java
Wed Jul 26 19:57:49 2006
@@ -26,7 +26,7 @@
 
 import org.apache.cayenne.util.TreeNodeChild;
 
-public class JpaBasic extends JpaAttributeDetail {
+public class JpaBasic extends JpaAttribute {
 
     protected FetchType fetch = FetchType.EAGER;
     protected boolean optional;

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbeddableAttribute.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbeddableAttribute.java?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbeddableAttribute.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbeddableAttribute.java
Wed Jul 26 19:57:49 2006
@@ -30,7 +30,7 @@
  * 
  * @author Andrus Adamchik
  */
-public class JpaEmbeddableAttribute extends JpaAttributeDetail {
+public class JpaEmbeddableAttribute extends JpaAttribute {
 
     protected boolean lob;
     protected JpaBasic basic;

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbedded.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbedded.java?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbedded.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbedded.java
Wed Jul 26 19:57:49 2006
@@ -23,7 +23,7 @@
 
 import org.apache.cayenne.util.TreeNodeChild;
 
-public class JpaEmbedded extends JpaAttributeDetail {
+public class JpaEmbedded extends JpaAttribute {
 
     protected Collection<JpaAttributeOverride> attributeOverrides;
 

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbeddedId.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbeddedId.java?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbeddedId.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaEmbeddedId.java
Wed Jul 26 19:57:49 2006
@@ -24,7 +24,7 @@
 
 import org.apache.cayenne.util.TreeNodeChild;
 
-public class JpaEmbeddedId extends JpaAttributeDetail {
+public class JpaEmbeddedId extends JpaAttribute {
 
     protected Collection<JpaAttributeOverride> attributeOverrides;
 

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaId.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaId.java?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaId.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaId.java
Wed Jul 26 19:57:49 2006
@@ -23,7 +23,7 @@
 
 import org.apache.cayenne.util.TreeNodeChild;
 
-public class JpaId extends JpaAttributeDetail {
+public class JpaId extends JpaAttribute {
 
     protected JpaColumn column;
     protected JpaGeneratedValue generatedValue;

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaRelationship.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaRelationship.java?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaRelationship.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaRelationship.java
Wed Jul 26 19:57:49 2006
@@ -24,7 +24,7 @@
 import javax.persistence.CascadeType;
 import javax.persistence.FetchType;
 
-public abstract class JpaRelationship extends JpaAttributeDetail {
+public abstract class JpaRelationship extends JpaAttribute {
 
     protected String targetEntityName;
     protected FetchType fetch;

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaTransient.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaTransient.java?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaTransient.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaTransient.java
Wed Jul 26 19:57:49 2006
@@ -18,6 +18,6 @@
  ****************************************************************/
 package org.apache.cayenne.jpa.map;
 
-public class JpaTransient extends JpaAttributeDetail {
+public class JpaTransient extends JpaAttribute {
 
 }

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaVersion.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaVersion.java?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaVersion.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/main/java/org/apache/cayenne/jpa/map/JpaVersion.java
Wed Jul 26 19:57:49 2006
@@ -22,7 +22,7 @@
 
 import org.apache.cayenne.util.TreeNodeChild;
 
-public class JpaVersion extends JpaAttributeDetail {
+public class JpaVersion extends JpaAttribute {
 
     protected JpaColumn column;
     protected TemporalType temporal;

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/entity/MockMappedSuperclass3.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/entity/MockMappedSuperclass3.java?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/entity/MockMappedSuperclass3.java
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/test/java/org/apache/cayenne/jpa/entity/MockMappedSuperclass3.java
Wed Jul 26 19:57:49 2006
@@ -20,8 +20,6 @@
 
 package org.apache.cayenne.jpa.entity;
 
-import javax.persistence.AttributeOverride;
-import javax.persistence.AttributeOverrides;
 import javax.persistence.Basic;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
@@ -110,10 +108,4 @@
 
     @OrderBy(value = "x ASC")
     protected int attribute16;
-
-    @AttributeOverrides( {
-            @AttributeOverride(name = "attribute1", column = @Column(name = "ao_column1")),
-            @AttributeOverride(name = "attribute2", column = @Column(name = "ao_column2"))
-    })
-    protected int attribute17;
 }

Modified: incubator/cayenne/main/trunk/cayenne-jpa/src/test/resources/xml-samples/orm-schema-headers-full.xml
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/cayenne-jpa/src/test/resources/xml-samples/orm-schema-headers-full.xml?rev=425934&r1=425933&r2=425934&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/cayenne-jpa/src/test/resources/xml-samples/orm-schema-headers-full.xml
(original)
+++ incubator/cayenne/main/trunk/cayenne-jpa/src/test/resources/xml-samples/orm-schema-headers-full.xml
Wed Jul 26 19:57:49 2006
@@ -27,11 +27,225 @@
        http://java.sun.com/xml/ns/persistence/orm/orm_1_0.xsd" version="1.0">
 	
 	<description>Test Description</description>
+	
+	<persistence-unit-metadata>
+		<persistence-unit-defaults>
+			<entity-listeners>
+				<entity-listener class="org.apache.cayenne.jpa.entity.MockEntityListener1">
+					<pre-persist method-name="prePersist"/>
+					<post-persist method-name="postPersist"/>
+					<pre-remove method-name="preRemove"/>
+					<post-remove method-name="postRemove"/>
+					<pre-update method-name="preUpdate"/>
+					<post-update method-name="postUpdate"/>
+					<post-load method-name="postLoad"/>
+				</entity-listener>
+			
+				<entity-listener class="org.apache.cayenne.jpa.entity.MockEntityListener2">
+					<post-persist method-name="postPersist"/>
+				</entity-listener>
+			</entity-listeners>
+		</persistence-unit-defaults>
+	</persistence-unit-metadata>
+	
 	<package>default_package</package>
 	<schema>default_schema</schema>
 	<catalog>default_catalog</catalog>
 	<access>FIELD</access>
 	
+	<!-- SEQUENCE GENERATORS -->
+	<sequence-generator name="sg-name" sequence-name="seq-name" initial-value="5" allocation-size="10"/>
+	<sequence-generator name="sg-name2"/>
+	
+	<!-- TABLE GENERATORS -->
+	<table-generator name="table-generator" table="auto_pk_table" catalog="catalog1" schema="schema1"
+			pk-column-name="next_id" value-column-name="x" pk-column-value="y" initial-value="4" allocation-size="20">
+		<unique-constraint>
+			<column-name>pk1</column-name>
+		</unique-constraint>
+	</table-generator>
+	<table-generator name="table-generator2"/>
+	
+	<!-- NAMED QUERIES -->
+	<named-query name="query1">
+		<query>select x</query>
+		<hint name="hint1" value="value1"/>
+		<hint name="hint2" value="value2"/>
+	</named-query>
+		
+	<named-query name="query2">
+		<query>select y</query>
+	</named-query>
+		
+	<!-- NAMED NATIVE QUERIES -->
+	<named-native-query name="query3" result-class="org.apache.cayenne.jpa.entity.MockResultClass"
result-set-mapping="rs-mapping1">
+		<query>select z</query>
+		<hint name="hint3" value="value3"/>
+		<hint name="hint4" value="value4"/>
+	</named-native-query>
+	
+	<named-native-query name="query4">
+		<query>select a</query>
+	</named-native-query>
+	
+	<!-- SQL RESULT SET MAPPINGS -->
+	<sql-result-set-mapping name="result-map1">
+		<entity-result entity-class="org.apache.cayenne.jpa.entity.MockEntityX" discriminator-column="column1">
+			<field-result name="field1" column="column1"/>
+			<field-result name="field2" column="column2"/>
+		</entity-result>
+		<entity-result entity-class="org.apache.cayenne.jpa.entity.MockEntityY" discriminator-column="column2">
+			<field-result name="field3" column="column3"/>
+			<field-result name="field4" column="column4"/>
+		</entity-result>
+		<column-result name="column-result1"/>
+		<column-result name="column-result2"/>
+	</sql-result-set-mapping>
+	
+	<sql-result-set-mapping name="result-map2"/>
+	
+	<!-- MAPPED SUPERCLASSES -->
+	<mapped-superclass class="org.apache.cayenne.jpa.entity.MockMappedSuperclass1" access="FIELD">
+		<id-class class="org.apache.cayenne.jpa.entity.MockIdClass"/>
+	
+		<exclude-default-listeners/>
+		<exclude-superclass-listeners/>
+	
+		<entity-listeners>
+			<entity-listener class="org.apache.cayenne.jpa.entity.MockEntityListener1">
+				<pre-persist method-name="prePersist"/>
+				<post-persist method-name="postPersist"/>
+				<pre-remove method-name="preRemove"/>
+				<post-remove method-name="postRemove"/>
+				<pre-update method-name="preUpdate"/>
+				<post-update method-name="postUpdate"/>
+				<post-load method-name="postLoad"/>
+			</entity-listener>
+		</entity-listeners>
+		
+		<pre-persist method-name="eprePersist"/>
+		<post-persist method-name="epostPersist"/>
+		<pre-remove method-name="epreRemove"/>
+		<post-remove method-name="epostRemove"/>
+		<pre-update method-name="epreUpdate"/>
+		<post-update method-name="epostUpdate"/>
+		<post-load method-name="epostLoad"/>
+	</mapped-superclass>
+	
+	<!-- EMBEDDED Id -->
+	<mapped-superclass class="org.apache.cayenne.jpa.entity.MockMappedSuperclass2">
+		<attributes>
+		<embedded-id name="embeddedId">
+			<attribute-override name="attribute1">
+				<column name="ao_column1"/>
+			</attribute-override>
+			<attribute-override name="attribute2">
+				<column name="ao_column2"/>
+			</attribute-override>
+		</embedded-id>
+		</attributes>
+	</mapped-superclass>
+	
+	<!-- Mapped Superclass w/Attributes -->
+	<mapped-superclass class="org.apache.cayenne.jpa.entity.MockMappedSuperclass3">
+	
+		<attributes>	
+			<!-- basic attribute -->			
+			<basic fetch="EAGER" optional="true" name="attribute1"/>
+		
+			<!-- basic with column attribute -->
+			<basic name="attribute9">
+				<column name="column9"/>
+			</basic>
+			
+			<!-- basic lob attribute -->
+			<basic name="attribute12">
+				<lob/>
+			</basic>
+			
+			<!-- basic temporal attribute -->
+			<basic name="attribute13">
+				<temporal>DATE</temporal>
+			</basic>
+			
+			<!-- basic enumerated attribute -->
+			<basic name="attribute14">
+				<enumerated>ORDINAL</enumerated>
+			</basic>
+			
+			<!-- version attribute -->
+			<version name="attribute2"/>
+		
+			<!-- many-to-one attribute -->
+			<many-to-one name="attribute5" target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1"
fetch="LAZY" optional="true">
+				<cascade>
+					<cascade-persist/>
+					<cascade-merge/>
+				</cascade>
+			</many-to-one>
+			
+			<!-- one-to-many attribute -->
+			<one-to-many name="attribute4" target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity2"
fetch="LAZY" mapped-by="mb2">
+				<cascade>
+					<cascade-persist/>
+					<cascade-merge/>
+				</cascade>
+			</one-to-many>
+			
+			<!-- join-column attribute -->
+			<one-to-many name="attribute10">
+				<join-column name="join-column-10" referenced-column-name="x-ref" unique="true" nullable="true"
+					insertable="true" updatable="true" column-definition="x-def" table="jt1"/>
+			</one-to-many>
+		
+			<!-- join-table attribute -->
+			<one-to-many name="attribute11">
+				<join-table name="jtable1" catalog="catalog1" schema="schema1">
+					<join-column name="join_column1"/>
+					<join-column name="join_column2"/>
+					<inverse-join-column name="ijoin_column1"/>
+					<inverse-join-column name="ijoin_column2"/>
+					<unique-constraint>
+						<column-name>pk1</column-name>
+					</unique-constraint>
+				</join-table>
+			</one-to-many>
+			
+			<!-- one-to-one attribute -->
+			<one-to-one name="attribute3" target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1"

+				   fetch="LAZY" optional="true" mapped-by="mb1">
+				<cascade>
+					<cascade-persist/>
+					<cascade-merge/>
+				</cascade>
+			</one-to-one>
+		
+			<!-- many-to-many attribute -->
+			<many-to-many name="attribute6" target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1"
fetch="LAZY" mapped-by="mb4">
+				<cascade>
+					<cascade-persist/>
+					<cascade-merge/>
+				</cascade>
+			</many-to-many>
+			
+			<!-- map-key attribute -->
+			<many-to-many name="attribute15">
+				<map-key name="mk"/>
+			</many-to-many>
+			
+			<!-- order-by attribute -->
+			<many-to-many name="attribute16">
+				<order-by>x ASC</order-by>
+			</many-to-many>
+		
+			<!-- embedded attribute -->
+			<embedded name="attribute7"/>
+		
+			<!-- transient attribute -->
+			<transient name="attribute8"/>
+		</attributes>
+	</mapped-superclass>
+	
 	<!-- ENTITIES -->
 	
 	<!-- no inheritance -->
@@ -130,12 +344,14 @@
 		<post-update method-name="epostUpdate"/>
 		<post-load method-name="epostLoad"/>
 		
-		<id name="id1">
-			<column name="id_column" unique="true" nullable="true" insertable="true" updatable="true"

-				 table="id_table" length="3" precision="4" scale="5"/>
-			<generated-value strategy="SEQUENCE" generator="id-generator"/>
-			<temporal>TIME</temporal>
-		</id>
+		<attributes>
+			<id name="id1">
+				<column name="id_column" unique="true" nullable="true" insertable="true" updatable="true"

+				 	table="id_table" length="3" precision="4" scale="5"/>
+				<generated-value strategy="SEQUENCE" generator="id-generator"/>
+				<temporal>TIME</temporal>
+			</id>
+		</attributes>
 	</entity>
 	
 	<!-- JOINED inheritance -->
@@ -164,360 +380,138 @@
 	
 	<!-- EMBEDDED Id -->
 	<entity name="MockEntity4" class="org.apache.cayenne.jpa.entity.MockEntity4">
-		<embedded-id name="embeddedId">
-			<attribute-override name="attribute1">
-				<column name="ao_column1"/>
-			</attribute-override>
-			<attribute-override name="attribute2">
-				<column name="ao_column2"/>
-			</attribute-override>
+		<attributes>
+			<embedded-id name="embeddedId">
+				<attribute-override name="attribute1">
+					<column name="ao_column1"/>
+				</attribute-override>
+				<attribute-override name="attribute2">
+					<column name="ao_column2"/>
+				</attribute-override>
 		</embedded-id>
+		</attributes>
 	</entity>
 	
 	<!-- Entity with Attributes -->
 	<entity name="MockEntity5" class="org.apache.cayenne.jpa.entity.MockEntity5">
-		<!-- basic attribute -->
-		<attribute name="attribute1">
-			<basic fetch="EAGER" optional="true"/>
-		</attribute>
-		
-		<!-- version attribute -->
-		<attribute name="attribute2">
-			<version/>
-		</attribute>
-		
-		<!-- one-to-one attribute -->
-		<attribute name="attribute3">
-			<one-to-one target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1" 
-				   fetch="LAZY" optional="true" mapped-by="mb1">
-				<cascade>MERGE</cascade>
-				<cascade>PERSIST</cascade>
-			</one-to-one>
-		</attribute>
+	
+		<attribute-override name="attribute1">
+				<column name="ao_column1"/>
+		</attribute-override>
+		<attribute-override name="attribute2">
+				<column name="ao_column2"/>
+		</attribute-override>
 		
-		<!-- one-to-many attribute -->
-		<attribute name="attribute4">
-			<one-to-many target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity2" fetch="LAZY"
mapped-by="mb2">
-				<cascade>MERGE</cascade>
-				<cascade>PERSIST</cascade>
-			</one-to-many>
-		</attribute>
+		<attributes>
+			<!-- basic attribute -->
+			<basic fetch="EAGER" optional="true" name="attribute1"/>
+		
+			<!-- basic with column attribute -->
+			<basic name="attribute9">
+				<column name="column9"/>
+			</basic>
+			
+			<!-- basic lob attribute -->
+			<basic name="attribute12">
+				<lob/>
+			</basic>
+			
+			<!-- basic temporal attribute -->
+			<basic name="attribute13">
+				<temporal>DATE</temporal>
+			</basic>
+			
+			<!-- basic enumerated attribute -->
+			<basic name="attribute14">
+				<enumerated>ORDINAL</enumerated>
+			</basic>
+			
+			<!-- version attribute -->
+			<version name="attribute2"/>
 		
-		<!-- many-to-one attribute -->
-		<attribute name="attribute5">
-			<many-to-one target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1" fetch="LAZY"
optional="true">
-				<cascade>MERGE</cascade>
-				<cascade>PERSIST</cascade>
+			<!-- many-to-one attribute -->
+			<many-to-one name="attribute5" target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1"
fetch="LAZY" optional="true">
+				<cascade>
+					<cascade-persist/>
+					<cascade-merge/>
+				</cascade>
 			</many-to-one>
-		</attribute>
+			
+			<!-- one-to-many attribute -->
+			<one-to-many name="attribute4" target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity2"
fetch="LAZY" mapped-by="mb2">
+				<cascade>
+					<cascade-persist/>
+					<cascade-merge/>
+				</cascade>
+			</one-to-many>
+			
+			<!-- join-column attribute -->
+			<one-to-many name="attribute10">
+				<join-column name="join-column-10" referenced-column-name="x-ref" unique="true" nullable="true"
+					insertable="true" updatable="true" column-definition="x-def" table="jt1"/>
+			</one-to-many>
+		
+			<!-- join-table attribute -->
+			<one-to-many name="attribute11">
+				<join-table name="jtable1" catalog="catalog1" schema="schema1">
+					<join-column name="join_column1"/>
+					<join-column name="join_column2"/>
+					<inverse-join-column name="ijoin_column1"/>
+					<inverse-join-column name="ijoin_column2"/>
+					<unique-constraint>
+						<column-name>pk1</column-name>
+					</unique-constraint>
+				</join-table>
+			</one-to-many>
+			
+			<!-- one-to-one attribute -->
+			<one-to-one name="attribute3" target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1"

+				   fetch="LAZY" optional="true" mapped-by="mb1">
+				<cascade>
+					<cascade-persist/>
+					<cascade-merge/>
+				</cascade>
+			</one-to-one>
 		
-		<!-- many-to-many attribute -->
-		<attribute name="attribute6">
-			<many-to-many target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1" fetch="LAZY"
mapped-by="mb4">
-				<cascade>MERGE</cascade>
-				<cascade>PERSIST</cascade>
+			<!-- many-to-many attribute -->
+			<many-to-many name="attribute6" target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1"
fetch="LAZY" mapped-by="mb4">
+				<cascade>
+					<cascade-persist/>
+					<cascade-merge/>
+				</cascade>
+			</many-to-many>
+			
+			<!-- map-key attribute -->
+			<many-to-many name="attribute15">
+				<map-key name="mk"/>
+			</many-to-many>
+			
+			<!-- order-by attribute -->
+			<many-to-many name="attribute16">
+				<order-by>x ASC</order-by>
 			</many-to-many>
-		</attribute>
 		
-		<!-- embedded attribute -->
-		<attribute name="attribute7">
-			<embedded>true</embedded>
-		</attribute>
-		
-		<!-- transient attribute -->
-		<attribute name="attribute8">
-			<transient>true</transient>
-		</attribute>
-		
-		<!-- column attribute -->
-		<attribute name="attribute9">
-			<column name="column9"/>
-		</attribute>
-		
-		<!-- join-column attribute -->
-		<attribute name="attribute10">
-			<join-column name="join-column-10" referenced-column-name="x-ref" unique="true" nullable="true"
-				insertable="true" updatable="true" column-definition="x-def" table="jt1"/>
-		</attribute>
-		
-		<!-- join-table attribute -->
-		<attribute name="attribute11">
-			<join-table name="jtable1" catalog="catalog1" schema="schema1">
-				<join-column name="join_column1"/>
-				<join-column name="join_column2"/>
-				<inverse-join-column name="ijoin_column1"/>
-				<inverse-join-column name="ijoin_column2"/>
-				<unique-constraint>
-					<column-name>pk1</column-name>
-				</unique-constraint>
-			</join-table>
-		</attribute>
-		
-		<!-- lob attribute -->
-		<attribute name="attribute12">
-			<lob/>
-		</attribute>
-		
-		<!-- temporal attribute -->
-		<attribute name="attribute13">
-			<temporal>DATE</temporal>
-		</attribute>
-		
-		<!-- enumerated attribute -->
-		<attribute name="attribute14">
-			<enumerated>ORDINAL</enumerated>
-		</attribute>
-		
-		<!-- map-key attribute -->
-		<attribute name="attribute15">
-			<map-key name="mk"/>
-		</attribute>
-		
-		<!-- order-by attribute -->
-		<attribute name="attribute16">
-			<order-by>x ASC</order-by>
-		</attribute>
+			<!-- embedded attribute -->
+			<embedded name="attribute7"/>
 		
-		<!-- attribute override -->
-		<attribute name="attribute17">
-			<attribute-override name="attribute1">
-				<column name="ao_column1"/>
-			</attribute-override>
-			<attribute-override name="attribute2">
-				<column name="ao_column2"/>
-			</attribute-override>
-		</attribute>
+			<!-- transient attribute -->
+			<transient name="attribute8"/>
+		</attributes>
 	</entity>
 	
 	<!-- EMBEDDABLES -->
 	
 	<embeddable class="org.apache.cayenne.jpa.entity.MockEmbed1" access="FIELD">
-		<embeddable-attribute name="ea1">
-			<basic fetch="EAGER" optional="true"/>
-			<lob/>
-			<temporal>DATE</temporal>
-			<enumerated>ORDINAL</enumerated>
-			<column name="column9"/>
-		</embeddable-attribute>
-		
-		<embeddable-attribute name="ea2"/>
+		<attributes>
+			<basic fetch="EAGER" optional="true" name="ea1">
+				<column name="column9"/>
+				<lob/>
+			</basic>
+
+			<transient name="ea2"/>
+		</attributes>
 	</embeddable>
 	
 	<embeddable class="org.apache.cayenne.jpa.entity.MockEmbded2"/>
-
-	<!-- MAPPED SUPERCLASSES -->
-	<mapped-superclass class="org.apache.cayenne.jpa.entity.MockMappedSuperclass1" access="FIELD">
-		<id-class class="org.apache.cayenne.jpa.entity.MockIdClass"/>
-	
-		<exclude-default-listeners>true</exclude-default-listeners>
-		<exclude-superclass-listeners>true</exclude-superclass-listeners>
-	
-		<entity-listener class="org.apache.cayenne.jpa.entity.MockEntityListener1">
-				<pre-persist method-name="prePersist"/>
-				<post-persist method-name="postPersist"/>
-				<pre-remove method-name="preRemove"/>
-				<post-remove method-name="postRemove"/>
-				<pre-update method-name="preUpdate"/>
-				<post-update method-name="postUpdate"/>
-				<post-load method-name="postLoad"/>
-		</entity-listener>
-		
-		<pre-persist method-name="eprePersist"/>
-		<post-persist method-name="epostPersist"/>
-		<pre-remove method-name="epreRemove"/>
-		<post-remove method-name="epostRemove"/>
-		<pre-update method-name="epreUpdate"/>
-		<post-update method-name="epostUpdate"/>
-		<post-load method-name="epostLoad"/>
-	</mapped-superclass>
-	
-	<!-- EMBEDDED Id -->
-	<mapped-superclass class="org.apache.cayenne.jpa.entity.MockMappedSuperclass2">
-		<embedded-id name="embeddedId">
-			<attribute-override name="attribute1">
-				<column name="ao_column1"/>
-			</attribute-override>
-			<attribute-override name="attribute2">
-				<column name="ao_column2"/>
-			</attribute-override>
-		</embedded-id>
-	</mapped-superclass>
-	
-	<!-- Mapped Superclass w/Attributes -->
-	<mapped-superclass class="org.apache.cayenne.jpa.entity.MockMappedSuperclass3">
-			<!-- basic attribute -->
-		<attribute name="attribute1">
-			<basic fetch="EAGER" optional="true"/>
-		</attribute>
-		
-		<!-- version attribute -->
-		<attribute name="attribute2">
-			<version/>
-		</attribute>
-		
-		<!-- one-to-one attribute -->
-		<attribute name="attribute3">
-			<one-to-one target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1" 
-				   fetch="LAZY" optional="true" mapped-by="mb1">
-				<cascade>MERGE</cascade>
-				<cascade>PERSIST</cascade>
-			</one-to-one>
-		</attribute>
-		
-		<!-- one-to-many attribute -->
-		<attribute name="attribute4">
-			<one-to-many target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity2" fetch="LAZY"
mapped-by="mb2">
-				<cascade>MERGE</cascade>
-				<cascade>PERSIST</cascade>
-			</one-to-many>
-		</attribute>
-		
-		<!-- many-to-one attribute -->
-		<attribute name="attribute5">
-			<many-to-one target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1" fetch="LAZY"
optional="true">
-				<cascade>MERGE</cascade>
-				<cascade>PERSIST</cascade>
-			</many-to-one>
-		</attribute>
-		
-		<!-- many-to-many attribute -->
-		<attribute name="attribute6">
-			<many-to-many target-entity="org.apache.cayenne.jpa.entity.MockTargetEntity1" fetch="LAZY"
mapped-by="mb4">
-				<cascade>MERGE</cascade>
-				<cascade>PERSIST</cascade>
-			</many-to-many>
-		</attribute>
-		
-		<!-- embedded attribute -->
-		<attribute name="attribute7">
-			<embedded>true</embedded>
-		</attribute>
-		
-		<!-- transient attribute -->
-		<attribute name="attribute8">
-			<transient>true</transient>
-		</attribute>
-		
-		<!-- column attribute -->
-		<attribute name="attribute9">
-			<column name="column9"/>
-		</attribute>
-		
-		<!-- join-column attribute -->
-		<attribute name="attribute10">
-			<join-column name="join-column-10" referenced-column-name="x-ref" unique="true" nullable="true"
-				insertable="true" updatable="true" column-definition="x-def" table="jt1"/>
-		</attribute>
-		
-		<!-- join-table attribute -->
-		<attribute name="attribute11">
-			<join-table name="jtable1" catalog="catalog1" schema="schema1">
-				<join-column name="join_column1"/>
-				<join-column name="join_column2"/>
-				<inverse-join-column name="ijoin_column1"/>
-				<inverse-join-column name="ijoin_column2"/>
-				<unique-constraint>
-					<column-name>pk1</column-name>
-				</unique-constraint>
-			</join-table>
-		</attribute>
-		
-		<!-- lob attribute -->
-		<attribute name="attribute12">
-			<lob/>
-		</attribute>
-		
-		<!-- temporal attribute -->
-		<attribute name="attribute13">
-			<temporal>DATE</temporal>
-		</attribute>
-		
-		<!-- enumerated attribute -->
-		<attribute name="attribute14">
-			<enumerated>ORDINAL</enumerated>
-		</attribute>
-		
-		<!-- map-key attribute -->
-		<attribute name="attribute15">
-			<map-key name="mk"/>
-		</attribute>
-		
-		<!-- order-by attribute -->
-		<attribute name="attribute16">
-			<order-by>x ASC</order-by>
-		</attribute>
-		
-		<!-- attribute override -->
-		<attribute name="attribute17">
-			<attribute-override name="attribute1">
-				<column name="ao_column1"/>
-			</attribute-override>
-			<attribute-override name="attribute2">
-				<column name="ao_column2"/>
-			</attribute-override>
-		</attribute>
-	</mapped-superclass>
-	
-	<!-- NAMED QUERIES -->
-	<named-query name="query1" query="select x">
-		<hint name="hint1" value="value1"/>
-		<hint name="hint2" value="value2"/>
-	</named-query>
-		
-	<named-query name="query2" query="select y"/>
-		
-	<!-- NAMED NATIVE QUERIES -->
-	<named-native-query name="query3" query="select z" result-class="org.apache.cayenne.jpa.entity.MockResultClass"
result-set-mapping="rs-mapping1">
-		<hint name="hint3" value="value3"/>
-		<hint name="hint4" value="value4"/>
-	</named-native-query>
-		
-	<named-native-query name="query4" query="select a"/>
-	
-	<!-- SQL RESULT SET MAPPINGS -->
-	<sql-result-set-mapping name="result-map1">
-		<entity-result entity-class="org.apache.cayenne.jpa.entity.MockEntityX" discriminator-column="column1">
-			<field-result name="field1" column="column1"/>
-			<field-result name="field2" column="column2"/>
-		</entity-result>
-		<entity-result entity-class="org.apache.cayenne.jpa.entity.MockEntityY" discriminator-column="column2">
-			<field-result name="field3" column="column3"/>
-			<field-result name="field4" column="column4"/>
-		</entity-result>
-		<column-result name="column-result1"/>
-		<column-result name="column-result2"/>
-	</sql-result-set-mapping>
-	
-	<sql-result-set-mapping name="result-map2"/>
-	
-	<!-- SEQUENCE GENERATORS -->
-	<sequence-generator name="sg-name" sequence-name="seq-name" initial-value="5" allocation-size="10"/>
-	<sequence-generator name="sg-name2"/>
-	
-	<!-- TABLE GENERATORS -->
-	<table-generator name="table-generator" table="auto_pk_table" catalog="catalog1" schema="schema1"
-			pk-column-name="next_id" value-column-name="x" pk-column-value="y" initial-value="4" allocation-size="20">
-		<unique-constraint>
-			<column-name>pk1</column-name>
-		</unique-constraint>
-	</table-generator>
-	<table-generator name="table-generator2"/>
-	
-	<!-- DEFAULT ENTITY LISTENERS -->
-	<default-entity-listeners>
-		<entity-listener class="org.apache.cayenne.jpa.entity.MockEntityListener1">
-			<pre-persist method-name="prePersist"/>
-			<post-persist method-name="postPersist"/>
-			<pre-remove method-name="preRemove"/>
-			<post-remove method-name="postRemove"/>
-			<pre-update method-name="preUpdate"/>
-			<post-update method-name="postUpdate"/>
-			<post-load method-name="postLoad"/>
-		</entity-listener>
-			
-		<entity-listener class="org.apache.cayenne.jpa.entity.MockEntityListener2">
-			<post-persist method-name="postPersist"/>
-		</entity-listener>
-	</default-entity-listeners>
 	
 </entity-mappings>



Mime
View raw message