Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Fullbright2013-07-08 17:05:43 +0000
committerPaul Fullbright2013-07-08 17:06:42 +0000
commit959e886d890c18fa5682e2dac86c302230f61fa8 (patch)
tree8c3f8a0652c79313200237c5cd88b7b3dea1eaab
parent46cc00bceda89ffe238d1ce7b169485259daf198 (diff)
downloadwebtools.dali-959e886d890c18fa5682e2dac86c302230f61fa8.tar.gz
webtools.dali-959e886d890c18fa5682e2dac86c302230f61fa8.tar.xz
webtools.dali-959e886d890c18fa5682e2dac86c302230f61fa8.zip
Refactored ID type mapping hierarchy and primary key API (bug 313204)
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/model/orm.ecore26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/OrmPackage.java1062
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntity.java291
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlIdTypeMapping.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlMappedSuperclass.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/BaseEmbeddedMapping.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/Entity.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/IdClassReference.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/IdTypeMapping.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/PersistentType.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TypeMapping.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmMappedSuperclass.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/persistence/PersistenceUnit.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/MappingTools.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEmbeddable.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEmbeddedIdMapping.java1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaIdTypeMapping.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaMappedSuperclass.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaTypeMapping.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/GenericJavaIdClassReference.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JavaNullTypeMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEmbeddable.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEntity.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmIdTypeMapping.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMappedSuperclass.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTypeMapping.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/GenericOrmIdClassReference.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/AbstractPrimaryKeyValidator.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaMapsIdDerivedIdentityStrategy2_0.java267
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMultitenancyImpl2_3.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmMultitenancyImpl2_3.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentTypeImpl.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkVirtualJavaPersistentType.java99
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java38
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java10
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java5
48 files changed, 2199 insertions, 1828 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/model/orm.ecore b/jpa/plugins/org.eclipse.jpt.jpa.core/model/orm.ecore
index 836708c9c7..0e5b0d619e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/model/orm.ecore
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/model/orm.ecore
@@ -150,7 +150,7 @@
<eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable" eSuperTypes="#//AbstractXmlTypeMapping"/>
<eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded" eSuperTypes="#//AbstractXmlEmbedded #//v2_0/XmlEmbedded_2_0 #//v2_1/XmlEmbedded_2_1"/>
<eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedId" eSuperTypes="#//AbstractXmlEmbedded"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity" eSuperTypes="#//AbstractXmlTypeMapping #//XmlQueryContainer #//XmlGeneratorContainer #//XmlEventMethodContainer #//XmlAttributeOverrideContainer #//XmlAssociationOverrideContainer #//v2_0/XmlEntity_2_0 #//XmlIdClassContainer #//v2_1/XmlEntity_2_1">
+ <eClassifiers xsi:type="ecore:EClass" name="XmlEntity" eSuperTypes="#//AbstractXmlTypeMapping #//XmlIdTypeMapping #//XmlQueryContainer #//XmlGeneratorContainer #//XmlEventMethodContainer #//XmlAttributeOverrideContainer #//XmlAssociationOverrideContainer #//v2_0/XmlEntity_2_0 #//v2_1/XmlEntity_2_1">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="table" eType="#//XmlTable"
containment="true" resolveProxies="false"/>
@@ -165,12 +165,6 @@
containment="true" resolveProxies="false"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="sqlResultSetMappings" upperBound="-1"
eType="#//XmlSqlResultSetMapping" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeSuperclassListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" eType="#//EntityListeners"
- containment="true" resolveProxies="false"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="EntityListener" eSuperTypes="#//XmlEventMethodContainer #//v2_0/XmlEntityListener_2_0">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="className" lowerBound="1"
@@ -261,6 +255,15 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="idClass" eType="#//XmlClassReference"
containment="true" resolveProxies="false"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="XmlIdTypeMapping" abstract="true" interface="true"
+ eSuperTypes="#//XmlTypeMapping #//XmlIdClassContainer">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultListeners"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeSuperclassListeners"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" eType="#//EntityListeners"
+ containment="true" resolveProxies="false"/>
+ </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="XmlIndex" eSuperTypes="#//v2_1/XmlIndex_2_1"/>
<eClassifiers xsi:type="ecore:EClass" name="Inheritance">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="strategy" eType="#//InheritanceType"
@@ -296,14 +299,7 @@
interface="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="mappedBy" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass" eSuperTypes="#//AbstractXmlTypeMapping #//XmlIdClassContainer">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeSuperclassListeners"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="entityListeners" eType="#//EntityListeners"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass" eSuperTypes="#//AbstractXmlTypeMapping #//XmlIdTypeMapping"/>
<eClassifiers xsi:type="ecore:EClass" name="XmlNamedAttributeNode" eSuperTypes="#//v2_1/XmlNamedAttributeNode_2_1"/>
<eClassifiers xsi:type="ecore:EClass" name="XmlNamedEntityGraph" eSuperTypes="#//v2_1/XmlNamedEntityGraph_2_1"/>
<eClassifiers xsi:type="ecore:EClass" name="XmlNamedSubgraph" eSuperTypes="#//v2_1/XmlNamedSubgraph_2_1"/>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/OrmPackage.java b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/OrmPackage.java
index 9128f28a77..e95a20cc38 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/OrmPackage.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/OrmPackage.java
@@ -849,7 +849,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlManagedType()
* @generated
*/
- public static final int XML_MANAGED_TYPE = 60;
+ public static final int XML_MANAGED_TYPE = 61;
/**
* The feature id for the '<em><b>Class Name</b></em>' attribute.
@@ -1087,7 +1087,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlTypeMapping()
* @generated
*/
- public static final int XML_TYPE_MAPPING = 101;
+ public static final int XML_TYPE_MAPPING = 102;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlTypeMapping <em>Abstract Xml Type Mapping</em>}' class.
@@ -1295,7 +1295,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOverride()
* @generated
*/
- public static final int XML_OVERRIDE = 78;
+ public static final int XML_OVERRIDE = 79;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2653,6 +2653,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_EMBEDDED_ID_FEATURE_COUNT = ABSTRACT_XML_EMBEDDED_FEATURE_COUNT + 0;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping <em>Xml Id Type Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping()
+ * @generated
+ */
+ public static final int XML_ID_TYPE_MAPPING = 53;
+
+ /**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlEntity <em>Xml Entity</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2708,274 +2718,274 @@ public class OrmPackage extends EPackageImpl
public static final int XML_ENTITY__ATTRIBUTES = ABSTRACT_XML_TYPE_MAPPING__ATTRIBUTES;
/**
- * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
+ * The feature id for the '<em><b>Id Class</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 0;
+ public static final int XML_ENTITY__ID_CLASS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 0;
/**
- * The feature id for the '<em><b>Named Queries</b></em>' containment reference list.
+ * The feature id for the '<em><b>Exclude Default Listeners</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__NAMED_QUERIES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 1;
+ public static final int XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 1;
/**
- * The feature id for the '<em><b>Named Native Queries</b></em>' containment reference list.
+ * The feature id for the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__NAMED_NATIVE_QUERIES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 2;
+ public static final int XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 2;
/**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
+ * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__SEQUENCE_GENERATOR = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 3;
+ public static final int XML_ENTITY__ENTITY_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 3;
/**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
+ * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__TABLE_GENERATOR = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 4;
+ public static final int XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 4;
/**
- * The feature id for the '<em><b>Pre Persist</b></em>' containment reference.
+ * The feature id for the '<em><b>Named Queries</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__PRE_PERSIST = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 5;
+ public static final int XML_ENTITY__NAMED_QUERIES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 5;
/**
- * The feature id for the '<em><b>Post Persist</b></em>' containment reference.
+ * The feature id for the '<em><b>Named Native Queries</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__POST_PERSIST = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 6;
+ public static final int XML_ENTITY__NAMED_NATIVE_QUERIES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 6;
/**
- * The feature id for the '<em><b>Pre Remove</b></em>' containment reference.
+ * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__PRE_REMOVE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 7;
+ public static final int XML_ENTITY__SEQUENCE_GENERATOR = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 7;
/**
- * The feature id for the '<em><b>Post Remove</b></em>' containment reference.
+ * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__POST_REMOVE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 8;
+ public static final int XML_ENTITY__TABLE_GENERATOR = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 8;
/**
- * The feature id for the '<em><b>Pre Update</b></em>' containment reference.
+ * The feature id for the '<em><b>Pre Persist</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__PRE_UPDATE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 9;
+ public static final int XML_ENTITY__PRE_PERSIST = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 9;
/**
- * The feature id for the '<em><b>Post Update</b></em>' containment reference.
+ * The feature id for the '<em><b>Post Persist</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__POST_UPDATE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 10;
+ public static final int XML_ENTITY__POST_PERSIST = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 10;
/**
- * The feature id for the '<em><b>Post Load</b></em>' containment reference.
+ * The feature id for the '<em><b>Pre Remove</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__POST_LOAD = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 11;
+ public static final int XML_ENTITY__PRE_REMOVE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 11;
/**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
+ * The feature id for the '<em><b>Post Remove</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__ATTRIBUTE_OVERRIDES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 12;
+ public static final int XML_ENTITY__POST_REMOVE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 12;
/**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
+ * The feature id for the '<em><b>Pre Update</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__ASSOCIATION_OVERRIDES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 13;
+ public static final int XML_ENTITY__PRE_UPDATE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 13;
/**
- * The feature id for the '<em><b>Cacheable</b></em>' attribute.
+ * The feature id for the '<em><b>Post Update</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__CACHEABLE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 14;
+ public static final int XML_ENTITY__POST_UPDATE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 14;
/**
- * The feature id for the '<em><b>Id Class</b></em>' containment reference.
+ * The feature id for the '<em><b>Post Load</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__ID_CLASS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 15;
+ public static final int XML_ENTITY__POST_LOAD = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 15;
/**
- * The feature id for the '<em><b>Primary Key Foreign Key</b></em>' containment reference.
+ * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__PRIMARY_KEY_FOREIGN_KEY = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 16;
+ public static final int XML_ENTITY__ATTRIBUTE_OVERRIDES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 16;
/**
- * The feature id for the '<em><b>Converts</b></em>' containment reference list.
+ * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__CONVERTS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 17;
+ public static final int XML_ENTITY__ASSOCIATION_OVERRIDES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 17;
/**
- * The feature id for the '<em><b>Named Entity Graphs</b></em>' containment reference list.
+ * The feature id for the '<em><b>Cacheable</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__NAMED_ENTITY_GRAPHS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 18;
+ public static final int XML_ENTITY__CACHEABLE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 18;
/**
- * The feature id for the '<em><b>Name</b></em>' attribute.
+ * The feature id for the '<em><b>Primary Key Foreign Key</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__NAME = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 19;
+ public static final int XML_ENTITY__PRIMARY_KEY_FOREIGN_KEY = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 19;
/**
- * The feature id for the '<em><b>Table</b></em>' containment reference.
+ * The feature id for the '<em><b>Converts</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__TABLE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 20;
+ public static final int XML_ENTITY__CONVERTS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 20;
/**
- * The feature id for the '<em><b>Secondary Tables</b></em>' containment reference list.
+ * The feature id for the '<em><b>Named Entity Graphs</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__SECONDARY_TABLES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 21;
+ public static final int XML_ENTITY__NAMED_ENTITY_GRAPHS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 21;
/**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
+ * The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 22;
+ public static final int XML_ENTITY__NAME = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 22;
/**
- * The feature id for the '<em><b>Inheritance</b></em>' containment reference.
+ * The feature id for the '<em><b>Table</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__INHERITANCE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 23;
+ public static final int XML_ENTITY__TABLE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 23;
/**
- * The feature id for the '<em><b>Discriminator Value</b></em>' attribute.
+ * The feature id for the '<em><b>Secondary Tables</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__DISCRIMINATOR_VALUE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 24;
+ public static final int XML_ENTITY__SECONDARY_TABLES = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 24;
/**
- * The feature id for the '<em><b>Discriminator Column</b></em>' containment reference.
+ * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__DISCRIMINATOR_COLUMN = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 25;
+ public static final int XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 25;
/**
- * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
+ * The feature id for the '<em><b>Inheritance</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__SQL_RESULT_SET_MAPPINGS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 26;
+ public static final int XML_ENTITY__INHERITANCE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 26;
/**
- * The feature id for the '<em><b>Exclude Default Listeners</b></em>' attribute.
+ * The feature id for the '<em><b>Discriminator Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 27;
+ public static final int XML_ENTITY__DISCRIMINATOR_VALUE = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 27;
/**
- * The feature id for the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
+ * The feature id for the '<em><b>Discriminator Column</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 28;
+ public static final int XML_ENTITY__DISCRIMINATOR_COLUMN = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 28;
/**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
+ * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_ENTITY__ENTITY_LISTENERS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 29;
+ public static final int XML_ENTITY__SQL_RESULT_SET_MAPPINGS = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 29;
/**
* The number of structural features of the '<em>Xml Entity</em>' class.
@@ -3284,7 +3294,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getInheritance()
* @generated
*/
- public static final int INHERITANCE = 54;
+ public static final int INHERITANCE = 55;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumn <em>Xml Join Column</em>}' class.
@@ -3294,7 +3304,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlJoinColumn()
* @generated
*/
- public static final int XML_JOIN_COLUMN = 55;
+ public static final int XML_JOIN_COLUMN = 56;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}' class.
@@ -3304,7 +3314,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlJoinTable()
* @generated
*/
- public static final int XML_JOIN_TABLE = 57;
+ public static final int XML_JOIN_TABLE = 58;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.Lob <em>Lob</em>}' class.
@@ -3314,7 +3324,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getLob()
* @generated
*/
- public static final int LOB = 59;
+ public static final int LOB = 60;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
@@ -3324,7 +3334,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlManyToMany()
* @generated
*/
- public static final int XML_MANY_TO_MANY = 61;
+ public static final int XML_MANY_TO_MANY = 62;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class.
@@ -3334,7 +3344,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlManyToOne()
* @generated
*/
- public static final int XML_MANY_TO_ONE = 62;
+ public static final int XML_MANY_TO_ONE = 63;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.MapKey <em>Map Key</em>}' class.
@@ -3344,7 +3354,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getMapKey()
* @generated
*/
- public static final int MAP_KEY = 63;
+ public static final int MAP_KEY = 64;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlMappedByMapping <em>Xml Mapped By Mapping</em>}' class.
@@ -3354,7 +3364,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlMappedByMapping()
* @generated
*/
- public static final int XML_MAPPED_BY_MAPPING = 64;
+ public static final int XML_MAPPED_BY_MAPPING = 65;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
@@ -3364,7 +3374,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlMappedSuperclass()
* @generated
*/
- public static final int XML_MAPPED_SUPERCLASS = 65;
+ public static final int XML_MAPPED_SUPERCLASS = 66;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlQuery <em>Xml Query</em>}' class.
@@ -3374,7 +3384,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlQuery()
* @generated
*/
- public static final int XML_QUERY = 91;
+ public static final int XML_QUERY = 92;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedNativeQuery <em>Xml Named Native Query</em>}' class.
@@ -3384,7 +3394,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedNativeQuery()
* @generated
*/
- public static final int XML_NAMED_NATIVE_QUERY = 69;
+ public static final int XML_NAMED_NATIVE_QUERY = 70;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery <em>Xml Named Query</em>}' class.
@@ -3394,7 +3404,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedQuery()
* @generated
*/
- public static final int XML_NAMED_QUERY = 70;
+ public static final int XML_NAMED_QUERY = 71;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNullAttributeMapping <em>Xml Null Attribute Mapping</em>}' class.
@@ -3404,7 +3414,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNullAttributeMapping()
* @generated
*/
- public static final int XML_NULL_ATTRIBUTE_MAPPING = 72;
+ public static final int XML_NULL_ATTRIBUTE_MAPPING = 73;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
@@ -3414,7 +3424,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOneToMany()
* @generated
*/
- public static final int XML_ONE_TO_MANY = 73;
+ public static final int XML_ONE_TO_MANY = 74;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class.
@@ -3424,7 +3434,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOneToOne()
* @generated
*/
- public static final int XML_ONE_TO_ONE = 74;
+ public static final int XML_ONE_TO_ONE = 75;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}' class.
@@ -3434,7 +3444,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOrderColumn()
* @generated
*/
- public static final int XML_ORDER_COLUMN = 77;
+ public static final int XML_ORDER_COLUMN = 78;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class.
@@ -3444,7 +3454,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults()
* @generated
*/
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS = 79;
+ public static final int XML_PERSISTENCE_UNIT_DEFAULTS = 80;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class.
@@ -3454,7 +3464,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata()
* @generated
*/
- public static final int XML_PERSISTENCE_UNIT_METADATA = 80;
+ public static final int XML_PERSISTENCE_UNIT_METADATA = 81;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PostLoad <em>Post Load</em>}' class.
@@ -3464,7 +3474,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPostLoad()
* @generated
*/
- public static final int POST_LOAD = 82;
+ public static final int POST_LOAD = 83;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PostPersist <em>Post Persist</em>}' class.
@@ -3474,7 +3484,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPostPersist()
* @generated
*/
- public static final int POST_PERSIST = 83;
+ public static final int POST_PERSIST = 84;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PostRemove <em>Post Remove</em>}' class.
@@ -3484,7 +3494,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPostRemove()
* @generated
*/
- public static final int POST_REMOVE = 84;
+ public static final int POST_REMOVE = 85;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PostUpdate <em>Post Update</em>}' class.
@@ -3494,7 +3504,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPostUpdate()
* @generated
*/
- public static final int POST_UPDATE = 85;
+ public static final int POST_UPDATE = 86;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PrePersist <em>Pre Persist</em>}' class.
@@ -3504,7 +3514,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPrePersist()
* @generated
*/
- public static final int PRE_PERSIST = 86;
+ public static final int PRE_PERSIST = 87;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PreRemove <em>Pre Remove</em>}' class.
@@ -3514,7 +3524,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPreRemove()
* @generated
*/
- public static final int PRE_REMOVE = 87;
+ public static final int PRE_REMOVE = 88;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PreUpdate <em>Pre Update</em>}' class.
@@ -3524,7 +3534,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPreUpdate()
* @generated
*/
- public static final int PRE_UPDATE = 88;
+ public static final int PRE_UPDATE = 89;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlPrimaryKeyJoinColumn <em>Xml Primary Key Join Column</em>}' class.
@@ -3534,7 +3544,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumn()
* @generated
*/
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN = 89;
+ public static final int XML_PRIMARY_KEY_JOIN_COLUMN = 90;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}' class.
@@ -3544,7 +3554,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlQueryContainer()
* @generated
*/
- public static final int XML_QUERY_CONTAINER = 92;
+ public static final int XML_QUERY_CONTAINER = 93;
/**
* The feature id for the '<em><b>Version</b></em>' attribute.
@@ -4114,7 +4124,351 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIndex()
* @generated
*/
- public static final int XML_INDEX = 53;
+ public static final int XML_INDEX = 54;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumnContainer <em>Xml Join Column Container</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumnContainer
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlJoinColumnContainer()
+ * @generated
+ */
+ public static final int XML_JOIN_COLUMN_CONTAINER = 57;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlReferenceTable <em>Xml Reference Table</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlReferenceTable
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlReferenceTable()
+ * @generated
+ */
+ public static final int XML_REFERENCE_TABLE = 82;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTableContainer <em>Xml Join Table Container</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTableContainer
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlJoinTableContainer()
+ * @generated
+ */
+ public static final int XML_JOIN_TABLE_CONTAINER = 59;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedAttributeNode <em>Xml Named Attribute Node</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlNamedAttributeNode
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedAttributeNode()
+ * @generated
+ */
+ public static final int XML_NAMED_ATTRIBUTE_NODE = 67;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedEntityGraph <em>Xml Named Entity Graph</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlNamedEntityGraph
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedEntityGraph()
+ * @generated
+ */
+ public static final int XML_NAMED_ENTITY_GRAPH = 68;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedSubgraph <em>Xml Named Subgraph</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlNamedSubgraph
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedSubgraph()
+ * @generated
+ */
+ public static final int XML_NAMED_SUBGRAPH = 69;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedStoredProcedureQuery <em>Xml Named Stored Procedure Query</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlNamedStoredProcedureQuery
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedStoredProcedureQuery()
+ * @generated
+ */
+ public static final int XML_NAMED_STORED_PROCEDURE_QUERY = 72;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlStoredProcedureParameter <em>Xml Stored Procedure Parameter</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlStoredProcedureParameter
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlStoredProcedureParameter()
+ * @generated
+ */
+ public static final int XML_STORED_PROCEDURE_PARAMETER = 98;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlQueryHint <em>Xml Query Hint</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlQueryHint
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlQueryHint()
+ * @generated
+ */
+ public static final int XML_QUERY_HINT = 94;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlSecondaryTable
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlSecondaryTable()
+ * @generated
+ */
+ public static final int XML_SECONDARY_TABLE = 95;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator <em>Xml Sequence Generator</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlSequenceGenerator()
+ * @generated
+ */
+ public static final int XML_SEQUENCE_GENERATOR = 96;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlTable <em>Xml Table</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlTable
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlTable()
+ * @generated
+ */
+ public static final int XML_TABLE = 99;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlTableGenerator()
+ * @generated
+ */
+ public static final int XML_TABLE_GENERATOR = 100;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlTransient
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlTransient()
+ * @generated
+ */
+ public static final int XML_TRANSIENT = 101;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint <em>Xml Unique Constraint</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlUniqueConstraint()
+ * @generated
+ */
+ public static final int XML_UNIQUE_CONSTRAINT = 103;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlVersion
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlVersion()
+ * @generated
+ */
+ public static final int XML_VERSION = 104;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlOrderable <em>Xml Orderable</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlOrderable
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOrderable()
+ * @generated
+ */
+ public static final int XML_ORDERABLE = 76;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlOrderBy <em>Xml Order By</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlOrderBy
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOrderBy()
+ * @generated
+ */
+ public static final int XML_ORDER_BY = 77;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlPrimaryKeyJoinColumnContainer <em>Xml Primary Key Join Column Container</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlPrimaryKeyJoinColumnContainer
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumnContainer()
+ * @generated
+ */
+ public static final int XML_PRIMARY_KEY_JOIN_COLUMN_CONTAINER = 91;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlSqlResultSetMapping <em>Xml Sql Result Set Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlSqlResultSetMapping
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlSqlResultSetMapping()
+ * @generated
+ */
+ public static final int XML_SQL_RESULT_SET_MAPPING = 97;
+
+ /**
+ * The feature id for the '<em><b>Class Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_TYPE_MAPPING__CLASS_NAME = XML_MANAGED_TYPE__CLASS_NAME;
+
+ /**
+ * The feature id for the '<em><b>Description</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_TYPE_MAPPING__DESCRIPTION = XML_MANAGED_TYPE__DESCRIPTION;
+
+ /**
+ * The feature id for the '<em><b>Access</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_TYPE_MAPPING__ACCESS = XML_MANAGED_TYPE_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_TYPE_MAPPING__METADATA_COMPLETE = XML_MANAGED_TYPE_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Attributes</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_TYPE_MAPPING__ATTRIBUTES = XML_MANAGED_TYPE_FEATURE_COUNT + 2;
+
+ /**
+ * The number of structural features of the '<em>Xml Type Mapping</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_TYPE_MAPPING_FEATURE_COUNT = XML_MANAGED_TYPE_FEATURE_COUNT + 3;
+
+ /**
+ * The feature id for the '<em><b>Class Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ID_TYPE_MAPPING__CLASS_NAME = XML_TYPE_MAPPING__CLASS_NAME;
+
+ /**
+ * The feature id for the '<em><b>Description</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ID_TYPE_MAPPING__DESCRIPTION = XML_TYPE_MAPPING__DESCRIPTION;
+
+ /**
+ * The feature id for the '<em><b>Access</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ID_TYPE_MAPPING__ACCESS = XML_TYPE_MAPPING__ACCESS;
+
+ /**
+ * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ID_TYPE_MAPPING__METADATA_COMPLETE = XML_TYPE_MAPPING__METADATA_COMPLETE;
+
+ /**
+ * The feature id for the '<em><b>Attributes</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ID_TYPE_MAPPING__ATTRIBUTES = XML_TYPE_MAPPING__ATTRIBUTES;
+
+ /**
+ * The feature id for the '<em><b>Id Class</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ID_TYPE_MAPPING__ID_CLASS = XML_TYPE_MAPPING_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Exclude Default Listeners</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ID_TYPE_MAPPING__EXCLUDE_DEFAULT_LISTENERS = XML_TYPE_MAPPING_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ID_TYPE_MAPPING__EXCLUDE_SUPERCLASS_LISTENERS = XML_TYPE_MAPPING_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ID_TYPE_MAPPING__ENTITY_LISTENERS = XML_TYPE_MAPPING_FEATURE_COUNT + 3;
+
+ /**
+ * The number of structural features of the '<em>Xml Id Type Mapping</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ID_TYPE_MAPPING_FEATURE_COUNT = XML_TYPE_MAPPING_FEATURE_COUNT + 4;
/**
* The feature id for the '<em><b>Description</b></em>' attribute.
@@ -4261,16 +4615,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_JOIN_COLUMN_FEATURE_COUNT = ABSTRACT_XML_BASE_COLUMN_FEATURE_COUNT + 1;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumnContainer <em>Xml Join Column Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumnContainer
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlJoinColumnContainer()
- * @generated
- */
- public static final int XML_JOIN_COLUMN_CONTAINER = 56;
-
- /**
* The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -4289,16 +4633,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_JOIN_COLUMN_CONTAINER_FEATURE_COUNT = 1;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlReferenceTable <em>Xml Reference Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlReferenceTable
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlReferenceTable()
- * @generated
- */
- public static final int XML_REFERENCE_TABLE = 81;
-
- /**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -4389,16 +4723,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_JOIN_TABLE_FEATURE_COUNT = ABSTRACT_XML_REFERENCE_TABLE_FEATURE_COUNT + 4;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTableContainer <em>Xml Join Table Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTableContainer
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlJoinTableContainer()
- * @generated
- */
- public static final int XML_JOIN_TABLE_CONTAINER = 58;
-
- /**
* The feature id for the '<em><b>Join Table</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -4831,16 +5155,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_MAPPED_SUPERCLASS_FEATURE_COUNT = ABSTRACT_XML_TYPE_MAPPING_FEATURE_COUNT + 4;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedAttributeNode <em>Xml Named Attribute Node</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlNamedAttributeNode
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedAttributeNode()
- * @generated
- */
- public static final int XML_NAMED_ATTRIBUTE_NODE = 66;
-
- /**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -4877,16 +5191,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_NAMED_ATTRIBUTE_NODE_FEATURE_COUNT = OrmV2_1Package.XML_NAMED_ATTRIBUTE_NODE_21_FEATURE_COUNT + 0;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedEntityGraph <em>Xml Named Entity Graph</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlNamedEntityGraph
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedEntityGraph()
- * @generated
- */
- public static final int XML_NAMED_ENTITY_GRAPH = 67;
-
- /**
* The feature id for the '<em><b>Named Attribute Nodes</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -4941,16 +5245,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_NAMED_ENTITY_GRAPH_FEATURE_COUNT = OrmV2_1Package.XML_NAMED_ENTITY_GRAPH_21_FEATURE_COUNT + 0;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedSubgraph <em>Xml Named Subgraph</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlNamedSubgraph
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedSubgraph()
- * @generated
- */
- public static final int XML_NAMED_SUBGRAPH = 68;
-
- /**
* The feature id for the '<em><b>Named Attribute Nodes</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5140,16 +5434,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_NAMED_QUERY_FEATURE_COUNT = XML_QUERY_FEATURE_COUNT + 2;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedStoredProcedureQuery <em>Xml Named Stored Procedure Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlNamedStoredProcedureQuery
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY = 71;
-
- /**
* The feature id for the '<em><b>Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5222,16 +5506,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_NAMED_STORED_PROCEDURE_QUERY_FEATURE_COUNT = XML_QUERY_FEATURE_COUNT + 4;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlStoredProcedureParameter <em>Xml Stored Procedure Parameter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlStoredProcedureParameter
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlStoredProcedureParameter()
- * @generated
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER = 97;
-
- /**
* The feature id for the '<em><b>Access</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5610,96 +5884,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_ONE_TO_ONE_FEATURE_COUNT = ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING_FEATURE_COUNT + 6;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlQueryHint <em>Xml Query Hint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlQueryHint
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlQueryHint()
- * @generated
- */
- public static final int XML_QUERY_HINT = 93;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlSecondaryTable
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlSecondaryTable()
- * @generated
- */
- public static final int XML_SECONDARY_TABLE = 94;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator <em>Xml Sequence Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlSequenceGenerator()
- * @generated
- */
- public static final int XML_SEQUENCE_GENERATOR = 95;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlTable <em>Xml Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlTable
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlTable()
- * @generated
- */
- public static final int XML_TABLE = 98;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlTableGenerator()
- * @generated
- */
- public static final int XML_TABLE_GENERATOR = 99;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlTransient
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlTransient()
- * @generated
- */
- public static final int XML_TRANSIENT = 100;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint <em>Xml Unique Constraint</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlUniqueConstraint()
- * @generated
- */
- public static final int XML_UNIQUE_CONSTRAINT = 102;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlVersion
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlVersion()
- * @generated
- */
- public static final int XML_VERSION = 103;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlOrderable <em>Xml Orderable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlOrderable
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOrderable()
- * @generated
- */
- public static final int XML_ORDERABLE = 75;
-
- /**
* The feature id for the '<em><b>Order Column</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5727,16 +5911,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_ORDERABLE_FEATURE_COUNT = OrmV2_0Package.XML_ORDERABLE_20_FEATURE_COUNT + 1;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlOrderBy <em>Xml Order By</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlOrderBy
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOrderBy()
- * @generated
- */
- public static final int XML_ORDER_BY = 76;
-
- /**
* The feature id for the '<em><b>Value</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6160,16 +6334,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_PRIMARY_KEY_JOIN_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlPrimaryKeyJoinColumnContainer <em>Xml Primary Key Join Column Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlPrimaryKeyJoinColumnContainer
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumnContainer()
- * @generated
- */
- public static final int XML_PRIMARY_KEY_JOIN_COLUMN_CONTAINER = 90;
-
- /**
* The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6404,16 +6568,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_SEQUENCE_GENERATOR_FEATURE_COUNT = XML_GENERATOR_FEATURE_COUNT + 3;
/**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlSqlResultSetMapping <em>Xml Sql Result Set Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlSqlResultSetMapping
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlSqlResultSetMapping()
- * @generated
- */
- public static final int XML_SQL_RESULT_SET_MAPPING = 96;
-
- /**
* The feature id for the '<em><b>Description</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6711,60 +6865,6 @@ public class OrmPackage extends EPackageImpl
public static final int XML_TRANSIENT_FEATURE_COUNT = ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
/**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING__CLASS_NAME = XML_MANAGED_TYPE__CLASS_NAME;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING__DESCRIPTION = XML_MANAGED_TYPE__DESCRIPTION;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING__ACCESS = XML_MANAGED_TYPE_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING__METADATA_COMPLETE = XML_MANAGED_TYPE_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING__ATTRIBUTES = XML_MANAGED_TYPE_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Type Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING_FEATURE_COUNT = XML_MANAGED_TYPE_FEATURE_COUNT + 3;
-
- /**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6871,7 +6971,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getDiscriminatorType()
* @generated
*/
- public static final int DISCRIMINATOR_TYPE = 104;
+ public static final int DISCRIMINATOR_TYPE = 105;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.EnumType <em>Enum Type</em>}' enum.
@@ -6881,7 +6981,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getEnumType()
* @generated
*/
- public static final int ENUM_TYPE = 105;
+ public static final int ENUM_TYPE = 106;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.FetchType <em>Fetch Type</em>}' enum.
@@ -6891,7 +6991,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getFetchType()
* @generated
*/
- public static final int FETCH_TYPE = 106;
+ public static final int FETCH_TYPE = 107;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.GenerationType <em>Generation Type</em>}' enum.
@@ -6901,7 +7001,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getGenerationType()
* @generated
*/
- public static final int GENERATION_TYPE = 107;
+ public static final int GENERATION_TYPE = 108;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.InheritanceType <em>Inheritance Type</em>}' enum.
@@ -6911,7 +7011,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getInheritanceType()
* @generated
*/
- public static final int INHERITANCE_TYPE = 108;
+ public static final int INHERITANCE_TYPE = 109;
/**
* The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.TemporalType <em>Temporal Type</em>}' enum.
@@ -6921,7 +7021,7 @@ public class OrmPackage extends EPackageImpl
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getTemporalType()
* @generated
*/
- public static final int TEMPORAL_TYPE = 109;
+ public static final int TEMPORAL_TYPE = 110;
/**
* <!-- begin-user-doc -->
@@ -7292,6 +7392,13 @@ public class OrmPackage extends EPackageImpl
* <!-- end-user-doc -->
* @generated
*/
+ private EClass xmlIdTypeMappingEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass xmlIndexEClass = null;
/**
@@ -9118,48 +9225,6 @@ public class OrmPackage extends EPackageImpl
}
/**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Listeners</em>'.
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#isExcludeDefaultListeners()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_ExcludeDefaultListeners()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(8);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Superclass Listeners</em>'.
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#isExcludeSuperclassListeners()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_ExcludeSuperclassListeners()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(9);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#getEntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#getEntityListeners()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_EntityListeners()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(10);
- }
-
- /**
* Returns the meta object for class '{@link org.eclipse.jpt.jpa.core.resource.orm.EntityListener <em>Entity Listener</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -9822,6 +9887,65 @@ public class OrmPackage extends EPackageImpl
/**
+ * Returns the meta object for class '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping <em>Xml Id Type Mapping</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Xml Id Type Mapping</em>'.
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping
+ * @generated
+ */
+ public EClass getXmlIdTypeMapping()
+ {
+ return xmlIdTypeMappingEClass;
+ }
+
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Exclude Default Listeners</em>'.
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#isExcludeDefaultListeners()
+ * @see #getXmlIdTypeMapping()
+ * @generated
+ */
+ public EAttribute getXmlIdTypeMapping_ExcludeDefaultListeners()
+ {
+ return (EAttribute)xmlIdTypeMappingEClass.getEStructuralFeatures().get(0);
+ }
+
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Exclude Superclass Listeners</em>'.
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#isExcludeSuperclassListeners()
+ * @see #getXmlIdTypeMapping()
+ * @generated
+ */
+ public EAttribute getXmlIdTypeMapping_ExcludeSuperclassListeners()
+ {
+ return (EAttribute)xmlIdTypeMappingEClass.getEStructuralFeatures().get(1);
+ }
+
+
+ /**
+ * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#getEntityListeners <em>Entity Listeners</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Entity Listeners</em>'.
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#getEntityListeners()
+ * @see #getXmlIdTypeMapping()
+ * @generated
+ */
+ public EReference getXmlIdTypeMapping_EntityListeners()
+ {
+ return (EReference)xmlIdTypeMappingEClass.getEStructuralFeatures().get(2);
+ }
+
+
+ /**
* Returns the meta object for class '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIndex <em>Xml Index</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -10111,48 +10235,6 @@ public class OrmPackage extends EPackageImpl
}
/**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Listeners</em>'.
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass#isExcludeDefaultListeners()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EAttribute getXmlMappedSuperclass_ExcludeDefaultListeners()
- {
- return (EAttribute)xmlMappedSuperclassEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Superclass Listeners</em>'.
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass#isExcludeSuperclassListeners()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EAttribute getXmlMappedSuperclass_ExcludeSuperclassListeners()
- {
- return (EAttribute)xmlMappedSuperclassEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass#getEntityListeners <em>Entity Listeners</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Entity Listeners</em>'.
- * @see org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass#getEntityListeners()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_EntityListeners()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(2);
- }
-
- /**
* Returns the meta object for class '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedAttributeNode <em>Xml Named Attribute Node</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -11432,9 +11514,6 @@ public class OrmPackage extends EPackageImpl
createEAttribute(xmlEntityEClass, XML_ENTITY__DISCRIMINATOR_VALUE);
createEReference(xmlEntityEClass, XML_ENTITY__DISCRIMINATOR_COLUMN);
createEReference(xmlEntityEClass, XML_ENTITY__SQL_RESULT_SET_MAPPINGS);
- createEAttribute(xmlEntityEClass, XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS);
- createEAttribute(xmlEntityEClass, XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS);
- createEReference(xmlEntityEClass, XML_ENTITY__ENTITY_LISTENERS);
entityListenerEClass = createEClass(ENTITY_LISTENER);
createEAttribute(entityListenerEClass, ENTITY_LISTENER__CLASS_NAME);
@@ -11497,6 +11576,11 @@ public class OrmPackage extends EPackageImpl
xmlIdClassContainerEClass = createEClass(XML_ID_CLASS_CONTAINER);
createEReference(xmlIdClassContainerEClass, XML_ID_CLASS_CONTAINER__ID_CLASS);
+ xmlIdTypeMappingEClass = createEClass(XML_ID_TYPE_MAPPING);
+ createEAttribute(xmlIdTypeMappingEClass, XML_ID_TYPE_MAPPING__EXCLUDE_DEFAULT_LISTENERS);
+ createEAttribute(xmlIdTypeMappingEClass, XML_ID_TYPE_MAPPING__EXCLUDE_SUPERCLASS_LISTENERS);
+ createEReference(xmlIdTypeMappingEClass, XML_ID_TYPE_MAPPING__ENTITY_LISTENERS);
+
xmlIndexEClass = createEClass(XML_INDEX);
inheritanceEClass = createEClass(INHERITANCE);
@@ -11530,9 +11614,6 @@ public class OrmPackage extends EPackageImpl
createEAttribute(xmlMappedByMappingEClass, XML_MAPPED_BY_MAPPING__MAPPED_BY);
xmlMappedSuperclassEClass = createEClass(XML_MAPPED_SUPERCLASS);
- createEAttribute(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS);
- createEAttribute(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS);
xmlNamedAttributeNodeEClass = createEClass(XML_NAMED_ATTRIBUTE_NODE);
@@ -11752,13 +11833,13 @@ public class OrmPackage extends EPackageImpl
xmlEmbeddedEClass.getESuperTypes().add(theOrmV2_1Package.getXmlEmbedded_2_1());
xmlEmbeddedIdEClass.getESuperTypes().add(this.getAbstractXmlEmbedded());
xmlEntityEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping());
+ xmlEntityEClass.getESuperTypes().add(this.getXmlIdTypeMapping());
xmlEntityEClass.getESuperTypes().add(this.getXmlQueryContainer());
xmlEntityEClass.getESuperTypes().add(this.getXmlGeneratorContainer());
xmlEntityEClass.getESuperTypes().add(this.getXmlEventMethodContainer());
xmlEntityEClass.getESuperTypes().add(this.getXmlAttributeOverrideContainer());
xmlEntityEClass.getESuperTypes().add(this.getXmlAssociationOverrideContainer());
xmlEntityEClass.getESuperTypes().add(theOrmV2_0Package.getXmlEntity_2_0());
- xmlEntityEClass.getESuperTypes().add(this.getXmlIdClassContainer());
xmlEntityEClass.getESuperTypes().add(theOrmV2_1Package.getXmlEntity_2_1());
entityListenerEClass.getESuperTypes().add(this.getXmlEventMethodContainer());
entityListenerEClass.getESuperTypes().add(theOrmV2_0Package.getXmlEntityListener_2_0());
@@ -11773,6 +11854,8 @@ public class OrmPackage extends EPackageImpl
xmlIdEClass.getESuperTypes().add(this.getColumnMapping());
xmlIdEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
xmlIdEClass.getESuperTypes().add(this.getXmlGeneratorContainer());
+ xmlIdTypeMappingEClass.getESuperTypes().add(this.getXmlTypeMapping());
+ xmlIdTypeMappingEClass.getESuperTypes().add(this.getXmlIdClassContainer());
xmlIndexEClass.getESuperTypes().add(theOrmV2_1Package.getXmlIndex_2_1());
xmlJoinColumnEClass.getESuperTypes().add(this.getAbstractXmlBaseColumn());
xmlJoinColumnEClass.getESuperTypes().add(this.getXmlBaseJoinColumn());
@@ -11784,7 +11867,7 @@ public class OrmPackage extends EPackageImpl
xmlManyToOneEClass.getESuperTypes().add(this.getAbstractXmlSingleRelationshipMapping());
xmlManyToOneEClass.getESuperTypes().add(theOrmV2_1Package.getXmlManyToOne_2_1());
xmlMappedSuperclassEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlIdClassContainer());
+ xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlIdTypeMapping());
xmlNamedAttributeNodeEClass.getESuperTypes().add(theOrmV2_1Package.getXmlNamedAttributeNode_2_1());
xmlNamedEntityGraphEClass.getESuperTypes().add(theOrmV2_1Package.getXmlNamedEntityGraph_2_1());
xmlNamedSubgraphEClass.getESuperTypes().add(theOrmV2_1Package.getXmlNamedSubgraph_2_1());
@@ -11978,9 +12061,6 @@ public class OrmPackage extends EPackageImpl
initEAttribute(getXmlEntity_DiscriminatorValue(), theXMLTypePackage.getString(), "discriminatorValue", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getXmlEntity_DiscriminatorColumn(), this.getXmlDiscriminatorColumn(), null, "discriminatorColumn", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getXmlEntity_SqlResultSetMappings(), this.getXmlSqlResultSetMapping(), null, "sqlResultSetMappings", null, 0, -1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntity_ExcludeDefaultListeners(), theXMLTypePackage.getBoolean(), "excludeDefaultListeners", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntity_ExcludeSuperclassListeners(), theXMLTypePackage.getBoolean(), "excludeSuperclassListeners", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_EntityListeners(), this.getEntityListeners(), null, "entityListeners", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(entityListenerEClass, EntityListener.class, "EntityListener", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getEntityListener_ClassName(), theXMLTypePackage.getString(), "className", null, 1, 1, EntityListener.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -12043,6 +12123,11 @@ public class OrmPackage extends EPackageImpl
initEClass(xmlIdClassContainerEClass, XmlIdClassContainer.class, "XmlIdClassContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getXmlIdClassContainer_IdClass(), this.getXmlClassReference(), null, "idClass", null, 0, 1, XmlIdClassContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(xmlIdTypeMappingEClass, XmlIdTypeMapping.class, "XmlIdTypeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getXmlIdTypeMapping_ExcludeDefaultListeners(), theXMLTypePackage.getBoolean(), "excludeDefaultListeners", null, 0, 1, XmlIdTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getXmlIdTypeMapping_ExcludeSuperclassListeners(), theXMLTypePackage.getBoolean(), "excludeSuperclassListeners", null, 0, 1, XmlIdTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getXmlIdTypeMapping_EntityListeners(), this.getEntityListeners(), null, "entityListeners", null, 0, 1, XmlIdTypeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
initEClass(xmlIndexEClass, XmlIndex.class, "XmlIndex", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(inheritanceEClass, Inheritance.class, "Inheritance", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -12076,9 +12161,6 @@ public class OrmPackage extends EPackageImpl
initEAttribute(getXmlMappedByMapping_MappedBy(), theXMLTypePackage.getString(), "mappedBy", null, 0, 1, XmlMappedByMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(xmlMappedSuperclassEClass, XmlMappedSuperclass.class, "XmlMappedSuperclass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMappedSuperclass_ExcludeDefaultListeners(), theXMLTypePackage.getBoolean(), "excludeDefaultListeners", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlMappedSuperclass_ExcludeSuperclassListeners(), theXMLTypePackage.getBoolean(), "excludeSuperclassListeners", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_EntityListeners(), this.getEntityListeners(), null, "entityListeners", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(xmlNamedAttributeNodeEClass, XmlNamedAttributeNode.class, "XmlNamedAttributeNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -13095,30 +13177,6 @@ public class OrmPackage extends EPackageImpl
public static final EReference XML_ENTITY__SQL_RESULT_SET_MAPPINGS = eINSTANCE.getXmlEntity_SqlResultSetMappings();
/**
- * The meta object literal for the '<em><b>Exclude Default Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS = eINSTANCE.getXmlEntity_ExcludeDefaultListeners();
-
- /**
- * The meta object literal for the '<em><b>Exclude Superclass Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS = eINSTANCE.getXmlEntity_ExcludeSuperclassListeners();
-
- /**
- * The meta object literal for the '<em><b>Entity Listeners</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__ENTITY_LISTENERS = eINSTANCE.getXmlEntity_EntityListeners();
-
- /**
* The meta object literal for the '{@link org.eclipse.jpt.jpa.core.resource.orm.EntityListener <em>Entity Listener</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -13529,6 +13587,40 @@ public class OrmPackage extends EPackageImpl
public static final EReference XML_ID_CLASS_CONTAINER__ID_CLASS = eINSTANCE.getXmlIdClassContainer_IdClass();
/**
+ * The meta object literal for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping <em>Xml Id Type Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping()
+ * @generated
+ */
+ public static final EClass XML_ID_TYPE_MAPPING = eINSTANCE.getXmlIdTypeMapping();
+
+ /**
+ * The meta object literal for the '<em><b>Exclude Default Listeners</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute XML_ID_TYPE_MAPPING__EXCLUDE_DEFAULT_LISTENERS = eINSTANCE.getXmlIdTypeMapping_ExcludeDefaultListeners();
+
+ /**
+ * The meta object literal for the '<em><b>Exclude Superclass Listeners</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute XML_ID_TYPE_MAPPING__EXCLUDE_SUPERCLASS_LISTENERS = eINSTANCE.getXmlIdTypeMapping_ExcludeSuperclassListeners();
+
+ /**
+ * The meta object literal for the '<em><b>Entity Listeners</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EReference XML_ID_TYPE_MAPPING__ENTITY_LISTENERS = eINSTANCE.getXmlIdTypeMapping_EntityListeners();
+
+ /**
* The meta object literal for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIndex <em>Xml Index</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -13723,30 +13815,6 @@ public class OrmPackage extends EPackageImpl
public static final EClass XML_MAPPED_SUPERCLASS = eINSTANCE.getXmlMappedSuperclass();
/**
- * The meta object literal for the '<em><b>Exclude Default Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS = eINSTANCE.getXmlMappedSuperclass_ExcludeDefaultListeners();
-
- /**
- * The meta object literal for the '<em><b>Exclude Superclass Listeners</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS = eINSTANCE.getXmlMappedSuperclass_ExcludeSuperclassListeners();
-
- /**
- * The meta object literal for the '<em><b>Entity Listeners</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS = eINSTANCE.getXmlMappedSuperclass_EntityListeners();
-
- /**
* The meta object literal for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedAttributeNode <em>Xml Named Attribute Node</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntity.java
index 468ee8aaa3..860afdd182 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntity.java
@@ -29,11 +29,7 @@ import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlCacheable_2_0;
import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlEntity_2_0;
import org.eclipse.jpt.jpa.core.resource.orm.v2_1.JPA2_1;
import org.eclipse.jpt.jpa.core.resource.orm.v2_1.OrmV2_1Package;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_1.XmlConvert_2_1;
import org.eclipse.jpt.jpa.core.resource.orm.v2_1.XmlEntity_2_1;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_1.XmlForeignKey_2_1;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_1.XmlNamedEntityGraph_2_1;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_1.XmlNamedStoredProcedureQuery_2_1;
import org.eclipse.jpt.jpa.core.resource.orm.v2_1.XmlQueryContainer_2_1;
import org.eclipse.wst.common.internal.emf.resource.Translator;
@@ -59,9 +55,6 @@ import org.eclipse.wst.common.internal.emf.resource.Translator;
* <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#getDiscriminatorValue <em>Discriminator Value</em>}</li>
* <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#getDiscriminatorColumn <em>Discriminator Column</em>}</li>
* <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlEntity#getEntityListeners <em>Entity Listeners</em>}</li>
* </ul>
* </p>
*
@@ -69,10 +62,70 @@ import org.eclipse.wst.common.internal.emf.resource.Translator;
* @model kind="class"
* @generated
*/
-public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContainer, XmlGeneratorContainer, XmlEventMethodContainer, XmlAttributeOverrideContainer, XmlAssociationOverrideContainer, XmlEntity_2_0, XmlIdClassContainer, XmlEntity_2_1
+public class XmlEntity extends AbstractXmlTypeMapping implements XmlIdTypeMapping, XmlQueryContainer, XmlGeneratorContainer, XmlEventMethodContainer, XmlAttributeOverrideContainer, XmlAssociationOverrideContainer, XmlEntity_2_0, XmlEntity_2_1
{
/**
+ * The cached value of the '{@link #getIdClass() <em>Id Class</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getIdClass()
+ * @generated
+ * @ordered
+ */
+ protected XmlClassReference idClass;
+
+ /**
+ * The default value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isExcludeDefaultListeners()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean EXCLUDE_DEFAULT_LISTENERS_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isExcludeDefaultListeners()
+ * @generated
+ * @ordered
+ */
+ protected boolean excludeDefaultListeners = EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isExcludeSuperclassListeners()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isExcludeSuperclassListeners()
+ * @generated
+ * @ordered
+ */
+ protected boolean excludeSuperclassListeners = EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
+
+ /**
+ * The cached value of the '{@link #getEntityListeners() <em>Entity Listeners</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getEntityListeners()
+ * @generated
+ * @ordered
+ */
+ protected EntityListeners entityListeners;
+
+ /**
* The cached value of the '{@link #getNamedStoredProcedureQueries() <em>Named Stored Procedure Queries</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -233,16 +286,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
protected Boolean cacheable = CACHEABLE_EDEFAULT;
/**
- * The cached value of the '{@link #getIdClass() <em>Id Class</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIdClass()
- * @generated
- * @ordered
- */
- protected XmlClassReference idClass;
-
- /**
* The cached value of the '{@link #getPrimaryKeyForeignKey() <em>Primary Key Foreign Key</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -373,56 +416,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
protected EList<XmlSqlResultSetMapping> sqlResultSetMappings;
/**
- * The default value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultListeners()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_DEFAULT_LISTENERS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeDefaultListeners() <em>Exclude Default Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultListeners()
- * @generated
- * @ordered
- */
- protected boolean excludeDefaultListeners = EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
-
- /**
- * The default value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeSuperclassListeners()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeSuperclassListeners() <em>Exclude Superclass Listeners</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeSuperclassListeners()
- * @generated
- * @ordered
- */
- protected boolean excludeSuperclassListeners = EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getEntityListeners() <em>Entity Listeners</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEntityListeners()
- * @generated
- * @ordered
- */
- protected EntityListeners entityListeners;
-
- /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -1135,7 +1128,7 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
* <!-- end-user-doc -->
* @return the value of the '<em>Exclude Default Listeners</em>' attribute.
* @see #setExcludeDefaultListeners(boolean)
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlEntity_ExcludeDefaultListeners()
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping_ExcludeDefaultListeners()
* @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
* @generated
*/
@@ -1170,7 +1163,7 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
* <!-- end-user-doc -->
* @return the value of the '<em>Exclude Superclass Listeners</em>' attribute.
* @see #setExcludeSuperclassListeners(boolean)
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlEntity_ExcludeSuperclassListeners()
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping_ExcludeSuperclassListeners()
* @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
* @generated
*/
@@ -1205,7 +1198,7 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
* <!-- end-user-doc -->
* @return the value of the '<em>Entity Listeners</em>' containment reference.
* @see #setEntityListeners(EntityListeners)
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlEntity_EntityListeners()
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping_EntityListeners()
* @model containment="true"
* @generated
*/
@@ -1766,6 +1759,10 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
{
switch (featureID)
{
+ case OrmPackage.XML_ENTITY__ID_CLASS:
+ return basicSetIdClass(null, msgs);
+ case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
+ return basicSetEntityListeners(null, msgs);
case OrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
return ((InternalEList<?>)getNamedStoredProcedureQueries()).basicRemove(otherEnd, msgs);
case OrmPackage.XML_ENTITY__NAMED_QUERIES:
@@ -1794,8 +1791,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
return ((InternalEList<?>)getAttributeOverrides()).basicRemove(otherEnd, msgs);
case OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES:
return ((InternalEList<?>)getAssociationOverrides()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__ID_CLASS:
- return basicSetIdClass(null, msgs);
case OrmPackage.XML_ENTITY__PRIMARY_KEY_FOREIGN_KEY:
return basicSetPrimaryKeyForeignKey(null, msgs);
case OrmPackage.XML_ENTITY__CONVERTS:
@@ -1814,8 +1809,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
return basicSetDiscriminatorColumn(null, msgs);
case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
return ((InternalEList<?>)getSqlResultSetMappings()).basicRemove(otherEnd, msgs);
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- return basicSetEntityListeners(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
@@ -1830,6 +1823,14 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
{
switch (featureID)
{
+ case OrmPackage.XML_ENTITY__ID_CLASS:
+ return getIdClass();
+ case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
+ return isExcludeDefaultListeners();
+ case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
+ return isExcludeSuperclassListeners();
+ case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
+ return getEntityListeners();
case OrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
return getNamedStoredProcedureQueries();
case OrmPackage.XML_ENTITY__NAMED_QUERIES:
@@ -1860,8 +1861,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
return getAssociationOverrides();
case OrmPackage.XML_ENTITY__CACHEABLE:
return getCacheable();
- case OrmPackage.XML_ENTITY__ID_CLASS:
- return getIdClass();
case OrmPackage.XML_ENTITY__PRIMARY_KEY_FOREIGN_KEY:
return getPrimaryKeyForeignKey();
case OrmPackage.XML_ENTITY__CONVERTS:
@@ -1884,12 +1883,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
return getDiscriminatorColumn();
case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
return getSqlResultSetMappings();
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- return isExcludeDefaultListeners();
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- return isExcludeSuperclassListeners();
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- return getEntityListeners();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -1905,6 +1898,18 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
{
switch (featureID)
{
+ case OrmPackage.XML_ENTITY__ID_CLASS:
+ setIdClass((XmlClassReference)newValue);
+ return;
+ case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
+ setExcludeDefaultListeners((Boolean)newValue);
+ return;
+ case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
+ setExcludeSuperclassListeners((Boolean)newValue);
+ return;
+ case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
+ setEntityListeners((EntityListeners)newValue);
+ return;
case OrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
getNamedStoredProcedureQueries().clear();
getNamedStoredProcedureQueries().addAll((Collection<? extends XmlNamedStoredProcedureQuery>)newValue);
@@ -1955,9 +1960,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
case OrmPackage.XML_ENTITY__CACHEABLE:
setCacheable((Boolean)newValue);
return;
- case OrmPackage.XML_ENTITY__ID_CLASS:
- setIdClass((XmlClassReference)newValue);
- return;
case OrmPackage.XML_ENTITY__PRIMARY_KEY_FOREIGN_KEY:
setPrimaryKeyForeignKey((XmlForeignKey)newValue);
return;
@@ -1996,15 +1998,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
getSqlResultSetMappings().clear();
getSqlResultSetMappings().addAll((Collection<? extends XmlSqlResultSetMapping>)newValue);
return;
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners((Boolean)newValue);
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners((Boolean)newValue);
- return;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)newValue);
- return;
}
super.eSet(featureID, newValue);
}
@@ -2019,6 +2012,18 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
{
switch (featureID)
{
+ case OrmPackage.XML_ENTITY__ID_CLASS:
+ setIdClass((XmlClassReference)null);
+ return;
+ case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
+ setExcludeDefaultListeners(EXCLUDE_DEFAULT_LISTENERS_EDEFAULT);
+ return;
+ case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
+ setExcludeSuperclassListeners(EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT);
+ return;
+ case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
+ setEntityListeners((EntityListeners)null);
+ return;
case OrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
getNamedStoredProcedureQueries().clear();
return;
@@ -2064,9 +2069,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
case OrmPackage.XML_ENTITY__CACHEABLE:
setCacheable(CACHEABLE_EDEFAULT);
return;
- case OrmPackage.XML_ENTITY__ID_CLASS:
- setIdClass((XmlClassReference)null);
- return;
case OrmPackage.XML_ENTITY__PRIMARY_KEY_FOREIGN_KEY:
setPrimaryKeyForeignKey((XmlForeignKey)null);
return;
@@ -2100,15 +2102,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
getSqlResultSetMappings().clear();
return;
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- setExcludeDefaultListeners(EXCLUDE_DEFAULT_LISTENERS_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- setExcludeSuperclassListeners(EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT);
- return;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- setEntityListeners((EntityListeners)null);
- return;
}
super.eUnset(featureID);
}
@@ -2123,6 +2116,14 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
{
switch (featureID)
{
+ case OrmPackage.XML_ENTITY__ID_CLASS:
+ return idClass != null;
+ case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
+ return excludeDefaultListeners != EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
+ case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
+ return excludeSuperclassListeners != EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
+ case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
+ return entityListeners != null;
case OrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
return namedStoredProcedureQueries != null && !namedStoredProcedureQueries.isEmpty();
case OrmPackage.XML_ENTITY__NAMED_QUERIES:
@@ -2153,8 +2154,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
return associationOverrides != null && !associationOverrides.isEmpty();
case OrmPackage.XML_ENTITY__CACHEABLE:
return CACHEABLE_EDEFAULT == null ? cacheable != null : !CACHEABLE_EDEFAULT.equals(cacheable);
- case OrmPackage.XML_ENTITY__ID_CLASS:
- return idClass != null;
case OrmPackage.XML_ENTITY__PRIMARY_KEY_FOREIGN_KEY:
return primaryKeyForeignKey != null;
case OrmPackage.XML_ENTITY__CONVERTS:
@@ -2177,12 +2176,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
return discriminatorColumn != null;
case OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS:
return sqlResultSetMappings != null && !sqlResultSetMappings.isEmpty();
- case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS:
- return excludeDefaultListeners != EXCLUDE_DEFAULT_LISTENERS_EDEFAULT;
- case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS:
- return excludeSuperclassListeners != EXCLUDE_SUPERCLASS_LISTENERS_EDEFAULT;
- case OrmPackage.XML_ENTITY__ENTITY_LISTENERS:
- return entityListeners != null;
}
return super.eIsSet(featureID);
}
@@ -2195,6 +2188,24 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
{
+ if (baseClass == XmlIdClassContainer.class)
+ {
+ switch (derivedFeatureID)
+ {
+ case OrmPackage.XML_ENTITY__ID_CLASS: return OrmPackage.XML_ID_CLASS_CONTAINER__ID_CLASS;
+ default: return -1;
+ }
+ }
+ if (baseClass == XmlIdTypeMapping.class)
+ {
+ switch (derivedFeatureID)
+ {
+ case OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS: return OrmPackage.XML_ID_TYPE_MAPPING__EXCLUDE_DEFAULT_LISTENERS;
+ case OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS: return OrmPackage.XML_ID_TYPE_MAPPING__EXCLUDE_SUPERCLASS_LISTENERS;
+ case OrmPackage.XML_ENTITY__ENTITY_LISTENERS: return OrmPackage.XML_ID_TYPE_MAPPING__ENTITY_LISTENERS;
+ default: return -1;
+ }
+ }
if (baseClass == XmlQueryContainer_2_1.class)
{
switch (derivedFeatureID)
@@ -2266,14 +2277,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
default: return -1;
}
}
- if (baseClass == XmlIdClassContainer.class)
- {
- switch (derivedFeatureID)
- {
- case OrmPackage.XML_ENTITY__ID_CLASS: return OrmPackage.XML_ID_CLASS_CONTAINER__ID_CLASS;
- default: return -1;
- }
- }
if (baseClass == XmlEntity_2_1.class)
{
switch (derivedFeatureID)
@@ -2295,6 +2298,24 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
{
+ if (baseClass == XmlIdClassContainer.class)
+ {
+ switch (baseFeatureID)
+ {
+ case OrmPackage.XML_ID_CLASS_CONTAINER__ID_CLASS: return OrmPackage.XML_ENTITY__ID_CLASS;
+ default: return -1;
+ }
+ }
+ if (baseClass == XmlIdTypeMapping.class)
+ {
+ switch (baseFeatureID)
+ {
+ case OrmPackage.XML_ID_TYPE_MAPPING__EXCLUDE_DEFAULT_LISTENERS: return OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS;
+ case OrmPackage.XML_ID_TYPE_MAPPING__EXCLUDE_SUPERCLASS_LISTENERS: return OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS;
+ case OrmPackage.XML_ID_TYPE_MAPPING__ENTITY_LISTENERS: return OrmPackage.XML_ENTITY__ENTITY_LISTENERS;
+ default: return -1;
+ }
+ }
if (baseClass == XmlQueryContainer_2_1.class)
{
switch (baseFeatureID)
@@ -2366,14 +2387,6 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
default: return -1;
}
}
- if (baseClass == XmlIdClassContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ID_CLASS_CONTAINER__ID_CLASS: return OrmPackage.XML_ENTITY__ID_CLASS;
- default: return -1;
- }
- }
if (baseClass == XmlEntity_2_1.class)
{
switch (baseFeatureID)
@@ -2398,16 +2411,16 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (cacheable: ");
+ result.append(" (excludeDefaultListeners: ");
+ result.append(excludeDefaultListeners);
+ result.append(", excludeSuperclassListeners: ");
+ result.append(excludeSuperclassListeners);
+ result.append(", cacheable: ");
result.append(cacheable);
result.append(", name: ");
result.append(name);
result.append(", discriminatorValue: ");
result.append(discriminatorValue);
- result.append(", excludeDefaultListeners: ");
- result.append(excludeDefaultListeners);
- result.append(", excludeSuperclassListeners: ");
- result.append(excludeSuperclassListeners);
result.append(')');
return result.toString();
}
@@ -2531,15 +2544,15 @@ public class XmlEntity extends AbstractXmlTypeMapping implements XmlQueryContain
}
protected static Translator buildExcludeDefaultListenersTranslator() {
- return new EmptyTagBooleanTranslator(JPA.EXCLUDE_DEFAULT_LISTENERS, OrmPackage.eINSTANCE.getXmlEntity_ExcludeDefaultListeners());
+ return new EmptyTagBooleanTranslator(JPA.EXCLUDE_DEFAULT_LISTENERS, OrmPackage.eINSTANCE.getXmlIdTypeMapping_ExcludeDefaultListeners());
}
protected static Translator buildExcludeSuperclassListenersTranslator() {
- return new EmptyTagBooleanTranslator(JPA.EXCLUDE_SUPERCLASS_LISTENERS, OrmPackage.eINSTANCE.getXmlEntity_ExcludeSuperclassListeners());
+ return new EmptyTagBooleanTranslator(JPA.EXCLUDE_SUPERCLASS_LISTENERS, OrmPackage.eINSTANCE.getXmlIdTypeMapping_ExcludeSuperclassListeners());
}
protected static Translator buildEntityListenersTranslator() {
- return EntityListeners.buildTranslator(JPA.ENTITY_LISTENERS, OrmPackage.eINSTANCE.getXmlEntity_EntityListeners());
+ return EntityListeners.buildTranslator(JPA.ENTITY_LISTENERS, OrmPackage.eINSTANCE.getXmlIdTypeMapping_EntityListeners());
}
protected static Translator buildPrePersistTranslator() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlIdTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlIdTypeMapping.java
new file mode 100644
index 0000000000..3391ca50b5
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlIdTypeMapping.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+/**
+ */
+package org.eclipse.jpt.jpa.core.resource.orm;
+
+
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Xml Id Type Mapping</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}</li>
+ * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}</li>
+ * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#getEntityListeners <em>Entity Listeners</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping()
+ * @model kind="class" interface="true" abstract="true"
+ * @generated
+ */
+public interface XmlIdTypeMapping extends XmlTypeMapping, XmlIdClassContainer
+{
+ /**
+ * Returns the value of the '<em><b>Exclude Default Listeners</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Exclude Default Listeners</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Exclude Default Listeners</em>' attribute.
+ * @see #setExcludeDefaultListeners(boolean)
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping_ExcludeDefaultListeners()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
+ * @generated
+ */
+ boolean isExcludeDefaultListeners();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Exclude Default Listeners</em>' attribute.
+ * @see #isExcludeDefaultListeners()
+ * @generated
+ */
+ void setExcludeDefaultListeners(boolean value);
+
+ /**
+ * Returns the value of the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Exclude Superclass Listeners</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Exclude Superclass Listeners</em>' attribute.
+ * @see #setExcludeSuperclassListeners(boolean)
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping_ExcludeSuperclassListeners()
+ * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
+ * @generated
+ */
+ boolean isExcludeSuperclassListeners();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Exclude Superclass Listeners</em>' attribute.
+ * @see #isExcludeSuperclassListeners()
+ * @generated
+ */
+ void setExcludeSuperclassListeners(boolean value);
+
+ /**
+ * Returns the value of the '<em><b>Entity Listeners</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Entity Listeners</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Entity Listeners</em>' containment reference.
+ * @see #setEntityListeners(EntityListeners)
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping_EntityListeners()
+ * @model containment="true"
+ * @generated
+ */
+ EntityListeners getEntityListeners();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping#getEntityListeners <em>Entity Listeners</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Entity Listeners</em>' containment reference.
+ * @see #getEntityListeners()
+ * @generated
+ */
+ void setEntityListeners(EntityListeners value);
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlMappedSuperclass.java
index 466e872cab..3b32841a40 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlMappedSuperclass.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlMappedSuperclass.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -31,20 +31,12 @@ import org.eclipse.wst.common.internal.emf.resource.Translator;
* will almost certainly be broken (repeatedly) as the API evolves.
* <!-- end-user-doc -->
*
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass#isExcludeDefaultListeners <em>Exclude Default Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass#isExcludeSuperclassListeners <em>Exclude Superclass Listeners</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass#getEntityListeners <em>Entity Listeners</em>}</li>
- * </ul>
- * </p>
*
* @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlMappedSuperclass()
* @model kind="class"
* @generated
*/
-public class XmlMappedSuperclass extends AbstractXmlTypeMapping implements XmlIdClassContainer
+public class XmlMappedSuperclass extends AbstractXmlTypeMapping implements XmlIdTypeMapping
{
/**
@@ -206,7 +198,7 @@ public class XmlMappedSuperclass extends AbstractXmlTypeMapping implements XmlId
* <!-- end-user-doc -->
* @return the value of the '<em>Exclude Default Listeners</em>' attribute.
* @see #setExcludeDefaultListeners(boolean)
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlMappedSuperclass_ExcludeDefaultListeners()
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping_ExcludeDefaultListeners()
* @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
* @generated
*/
@@ -241,7 +233,7 @@ public class XmlMappedSuperclass extends AbstractXmlTypeMapping implements XmlId
* <!-- end-user-doc -->
* @return the value of the '<em>Exclude Superclass Listeners</em>' attribute.
* @see #setExcludeSuperclassListeners(boolean)
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlMappedSuperclass_ExcludeSuperclassListeners()
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping_ExcludeSuperclassListeners()
* @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
* @generated
*/
@@ -276,7 +268,7 @@ public class XmlMappedSuperclass extends AbstractXmlTypeMapping implements XmlId
* <!-- end-user-doc -->
* @return the value of the '<em>Entity Listeners</em>' containment reference.
* @see #setEntityListeners(EntityListeners)
- * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlMappedSuperclass_EntityListeners()
+ * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdTypeMapping_EntityListeners()
* @model containment="true"
* @generated
*/
@@ -456,6 +448,16 @@ public class XmlMappedSuperclass extends AbstractXmlTypeMapping implements XmlId
default: return -1;
}
}
+ if (baseClass == XmlIdTypeMapping.class)
+ {
+ switch (derivedFeatureID)
+ {
+ case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS: return OrmPackage.XML_ID_TYPE_MAPPING__EXCLUDE_DEFAULT_LISTENERS;
+ case OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS: return OrmPackage.XML_ID_TYPE_MAPPING__EXCLUDE_SUPERCLASS_LISTENERS;
+ case OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS: return OrmPackage.XML_ID_TYPE_MAPPING__ENTITY_LISTENERS;
+ default: return -1;
+ }
+ }
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
@@ -475,6 +477,16 @@ public class XmlMappedSuperclass extends AbstractXmlTypeMapping implements XmlId
default: return -1;
}
}
+ if (baseClass == XmlIdTypeMapping.class)
+ {
+ switch (baseFeatureID)
+ {
+ case OrmPackage.XML_ID_TYPE_MAPPING__EXCLUDE_DEFAULT_LISTENERS: return OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS;
+ case OrmPackage.XML_ID_TYPE_MAPPING__EXCLUDE_SUPERCLASS_LISTENERS: return OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS;
+ case OrmPackage.XML_ID_TYPE_MAPPING__ENTITY_LISTENERS: return OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS;
+ default: return -1;
+ }
+ }
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
@@ -529,15 +541,15 @@ public class XmlMappedSuperclass extends AbstractXmlTypeMapping implements XmlId
}
protected static Translator buildExcludeDefaultListenersTranslator() {
- return new EmptyTagBooleanTranslator(JPA.EXCLUDE_DEFAULT_LISTENERS, OrmPackage.eINSTANCE.getXmlMappedSuperclass_ExcludeDefaultListeners());
+ return new EmptyTagBooleanTranslator(JPA.EXCLUDE_DEFAULT_LISTENERS, OrmPackage.eINSTANCE.getXmlIdTypeMapping_ExcludeDefaultListeners());
}
protected static Translator buildExcludeSuperclassListenersTranslator() {
- return new EmptyTagBooleanTranslator(JPA.EXCLUDE_SUPERCLASS_LISTENERS, OrmPackage.eINSTANCE.getXmlMappedSuperclass_ExcludeSuperclassListeners());
+ return new EmptyTagBooleanTranslator(JPA.EXCLUDE_SUPERCLASS_LISTENERS, OrmPackage.eINSTANCE.getXmlIdTypeMapping_ExcludeSuperclassListeners());
}
protected static Translator buildEntityListenersTranslator() {
- return EntityListeners.buildTranslator(JPA.ENTITY_LISTENERS, OrmPackage.eINSTANCE.getXmlMappedSuperclass_EntityListeners());
+ return EntityListeners.buildTranslator(JPA.ENTITY_LISTENERS, OrmPackage.eINSTANCE.getXmlIdTypeMapping_EntityListeners());
}
protected static Translator buildPrePersistTranslator() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/BaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/BaseEmbeddedMapping.java
index 2e6ddedaf7..0e8a5b7b43 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/BaseEmbeddedMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/BaseEmbeddedMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -22,18 +22,27 @@ package org.eclipse.jpt.jpa.core.context;
* @since 2.0
*/
public interface BaseEmbeddedMapping
- extends AttributeMapping
-{
+ extends AttributeMapping {
+
AttributeOverrideContainer getAttributeOverrideContainer();
+
+ // ***** target embeddable *****
+
/**
- * Return the embeddable the embedded mapping references.
- * Return <code>null</code> if there is none.
+ * Return the fully qualified name of the target embeddable.
+ * This may exist even if {@link #getTargetEmbeddable()} return null.
*/
- Embeddable getTargetEmbeddable();
+ String getTargetEmbeddableName();
/**
* String associated with property change events for the target embeddable
*/
String TARGET_EMBEDDABLE_PROPERTY = "targetEmbeddable"; //$NON-NLS-1$
+
+ /**
+ * Return the embeddable the embedded mapping references.
+ * Return <code>null</code> if there is none.
+ */
+ Embeddable getTargetEmbeddable();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/Entity.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/Entity.java
index 264a233c32..f3173d63f0 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/Entity.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/Entity.java
@@ -27,8 +27,8 @@ import org.eclipse.jpt.common.utility.iterable.ListIterable;
* @since 2.0
*/
public interface Entity
- extends IdTypeMapping
-{
+ extends IdTypeMapping {
+
// ********** name **********
String getSpecifiedName();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/IdClassReference.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/IdClassReference.java
index 45df000fb3..c115e02449 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/IdClassReference.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/IdClassReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -20,14 +20,19 @@ import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.2
+ * @version 3.6
* @since 2.3
*/
public interface IdClassReference
- extends JpaContextModel
-{
- // ********** id class name **********
-
+ extends JpaContextModel {
+
+ // ***** id class name *****
+
+ /**
+ * Property string associated with changes to the ID class name
+ */
+ String ID_CLASS_NAME_PROPERTY = "idClassName"; //$NON-NLS-1$
+
/**
* Return the name of the id class, taking into consideration the default value if applicable
*/
@@ -65,16 +70,20 @@ public interface IdClassReference
* applies, this should also return true.
*/
boolean isSpecified();
-
+
+ /**
+ * Property string associated with changes to the fully qualified ID class name
+ */
+ String FULLY_QUALIFIED_ID_CLASS_PROPERTY = "fullyQualifiedIdClass"; //$NON-NLS-1$
+
/**
* Return the fully qualified name of the id class, taking into consideration the default value if applicable
*/
String getFullyQualifiedIdClassName();
- String FULLY_QUALIFIED_ID_CLASS_PROPERTY = "fullyQualifiedIdClass"; //$NON-NLS-1$
-
- // ********** id class **********
-
+
+ // ***** id class *****
+
/**
* Property string associated with changes to the ID class.
* This will change (potentially) if the id class name changes, or if other changes result
@@ -94,5 +103,4 @@ public interface IdClassReference
* @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
*/
char getIdClassEnclosingTypeSeparator();
-
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/IdTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/IdTypeMapping.java
index 3a14d74832..01467577ee 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/IdTypeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/IdTypeMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,6 +9,8 @@
******************************************************************************/
package org.eclipse.jpt.jpa.core.context;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+
/**
* ID type mapping:<ul>
* <li>entity
@@ -19,13 +21,73 @@ package org.eclipse.jpt.jpa.core.context;
* It is available at this early stage to solicit feedback from pioneering
* adopters on the understanding that any code that uses this API will almost
* certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.6
+ * @since 3.5
*/
public interface IdTypeMapping
- extends TypeMapping
-{
+ extends TypeMapping {
+
+ // ***** primary key *****
+
/**
* Return the (aggregate) class reference for configuring and validating
* the type mapping's ID class.
*/
IdClassReference getIdClassReference();
+
+ /**
+ * Return the fully qualified name of the type used as the primary key class
+ * (e.g. the id class name, or the type of the id mapping, etc.)
+ */
+ String getPrimaryKeyClassName();
+
+
+ // ***** inheritance *****
+
+ /**
+ * Return the type mapping's "persistence" inheritance hierarchy,
+ * <em>including</em> the type mapping itself.
+ * If there is an inheritance loop, the iterable will terminate before including
+ * this type mapping a second time.
+ * @see TypeMapping#getAncestors()
+ */
+ Iterable<IdTypeMapping> getInheritanceHierarchy();
+
+ /**
+ * {@link Transformer} that returns the super type mapping of the input,
+ * except if result would be the leaf type mapping.
+ * Use to terminate inheritance cycles
+ * @see IdTypeMapping#getInheritanceHierarchy()
+ * @see TypeMapping#getAncestors()
+ */
+ class SuperTypeMappingTransformer
+ implements Transformer<IdTypeMapping, IdTypeMapping> {
+
+ private final IdTypeMapping leaf;
+
+ public SuperTypeMappingTransformer(IdTypeMapping leaf) {
+ this.leaf = leaf;
+ }
+
+ public IdTypeMapping transform(IdTypeMapping input) {
+ IdTypeMapping result = input.getSuperTypeMapping();
+ return (result == this.leaf) ? null : result;
+ }
+ }
+
+ /**
+ * Return whether this type mapping is a root entity in an inheritance hierarchy.
+ */
+ boolean isRootEntity();
+
+ /**
+ * Return the root entity of the inheritance hierarchy or null.
+ */
+ Entity getRootEntity();
+
+ /**
+ * Return the inheritance strategy or null
+ */
+ InheritanceType getInheritanceStrategy();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/PersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/PersistentType.java
index 3ff29722a5..a733288c71 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/PersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/PersistentType.java
@@ -25,39 +25,44 @@ import org.eclipse.jpt.jpa.core.JpaStructureNode;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.3
+ * @version 3.6
* @since 2.0
*/
public interface PersistentType
- extends ManagedType, JpaStructureNode, SpecifiedAccessReference
-{
+ extends ManagedType, JpaStructureNode, SpecifiedAccessReference {
+
Class<PersistentType> getManagedTypeType();
-
- // ********** mapping **********
-
+
+
+ // ***** mapping *****
+
+ /**
+ * String associated with changes to the "mapping" property
+ */
+ String MAPPING_PROPERTY = "mapping"; //$NON-NLS-1$
+
/**
* Return the persistent type's mapping.
* Set the mapping via {@link #setMappingKey(String)}.
*/
TypeMapping getMapping();
- String MAPPING_PROPERTY = "mapping"; //$NON-NLS-1$
+
Transformer<PersistentType, TypeMapping> MAPPING_TRANSFORMER = new MappingTransformer();
class MappingTransformer
- extends TransformerAdapter<PersistentType, TypeMapping>
- {
+ extends TransformerAdapter<PersistentType, TypeMapping> {
@Override
public TypeMapping transform(PersistentType pt) {
return pt.getMapping();
}
}
-
+
String getMappingKey();
-
+
void setMappingKey(String key);
-
+
boolean isMapped();
-
-
+
+
// ********** attributes **********
/**
@@ -116,57 +121,28 @@ public interface PersistentType
// ********** inheritance **********
-
+
/**
- * Return the "super" {@link PersistentType} from the "persistence"
- * inheritance hierarchy.
- * If the Java inheritance parent is not a {@link PersistentType}, then continue
- * up the hierarchy (the JPA spec allows non-persistent types to be part of the hierarchy.)
- * Return <code>null</code> if the persistent type is the root persistent type.
- * <p>
- * Example:
- * <pre>
- * &#64;Entity
- * public abstract class Model {}
- *
- * public abstract class Animal extends Model {}
- *
- * &#64;Entity
- * public class Cat extends Animal {}
- * </pre>
- * The "super" persistent type of the <code>Cat</code> persistent type is
- * the <code>Model</code> persistent type. The "super" persistent type can
- * be either a Java annotated class or declared in the XML files.
+ * Return the persistent type of the super type mapping
+ * @see TypeMapping#getSuperTypeMapping()
*/
PersistentType getSuperPersistentType();
- String SUPER_PERSISTENT_TYPE_PROPERTY = "superPersistentType"; //$NON-NLS-1$
- Transformer<PersistentType, PersistentType> SUPER_PERSISTENT_TYPE_TRANSFORMER = new SuperPersistentTypeTransformer();
- class SuperPersistentTypeTransformer
- extends TransformerAdapter<PersistentType, PersistentType>
- {
- @Override
- public PersistentType transform(PersistentType persistentType) {
- return persistentType.getSuperPersistentType();
- }
- }
-
+
/**
* Return the persistent type's "persistence" inheritance hierarchy,
* <em>including</em> the persistent type itself.
- * The returned iterator will return elements infinitely if the hierarchy
- * has a loop.
+ * @see TypeMapping#getTypeMappingInheritanceHierarchy()
*/
Iterable<PersistentType> getInheritanceHierarchy();
-
+
/**
* Return the persistent type's "persistence" inheritance hierarchy,
* <em>excluding</em> the persistent type itself.
- * The returned iterator will return elements infinitely if the hierarchy
- * has a loop.
+ * @see TypeMapping#getAncesors()
*/
Iterable<PersistentType> getAncestors();
-
-
+
+
// ********** misc **********
/**
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TypeMapping.java
index 6ff493f36d..39c2f9486c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TypeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TypeMapping.java
@@ -10,9 +10,11 @@
package org.eclipse.jpt.jpa.core.context;
import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
+import org.eclipse.jpt.common.utility.internal.ArrayTools;
+import org.eclipse.jpt.common.utility.internal.predicate.PredicateAdapter;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.transformer.Transformer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
+import org.eclipse.jpt.jpa.core.MappingKeys;
import org.eclipse.jpt.jpa.db.Schema;
/**
@@ -27,14 +29,24 @@ import org.eclipse.jpt.jpa.db.Schema;
* adopters on the understanding that any code that uses this API will almost
* certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.1
+ * @version 3.6
* @since 2.0
*/
public interface TypeMapping
- extends JpaContextModel
-{
+ extends JpaContextModel {
+
PersistentType getPersistentType();
-
+
+ Transformer<TypeMapping, PersistentType> PERSISTENT_TYPE_TRANSFORMER = new PersistentTypeTransformer();
+
+ class PersistentTypeTransformer
+ extends TransformerAdapter<TypeMapping, PersistentType> {
+ @Override
+ public PersistentType transform(TypeMapping tm) {
+ return tm.getPersistentType();
+ }
+ }
+
/**
* Return the corresponding java resource type, this can be null
*/
@@ -54,11 +66,6 @@ public interface TypeMapping
boolean isMapped();
- /**
- * Return the resolved id class specified on this type mapping, null otherwise
- */
- JavaPersistentType getIdClass();
-
Iterable<Query> getQueries();
Transformer<TypeMapping, Iterable<Query>> QUERIES_TRANSFORMER = new QueriesTransformer();
class QueriesTransformer
@@ -80,39 +87,56 @@ public interface TypeMapping
return mapping.getGenerators();
}
}
-
-
+
+
// ********** inheritance **********
/**
- * Return the type mapping of this type mapping's super type.
- * Return null if this is the root.
+ * String associated with changes to the super type mapping property
*/
- TypeMapping getSuperTypeMapping();
+ String SUPER_TYPE_MAPPING_PROPERTY = "superTypeMapping"; //$NON-NLS-1$
/**
- * Return the type mapping's "persistence" inheritance hierarchy,
- * <em>including</em> the type mapping itself.
- * The returned iterator will return elements infinitely if the hierarchy
- * has a loop.
+ * Return the "super" {@link TypeMapping} from the "persistence"
+ * inheritance hierarchy.
+ * If the Java inheritance parent is not persistent, then continue
+ * up the hierarchy (the JPA spec allows non-persistent types to be
+ * part of the hierarchy.)
+ * Return <code>null</code> if the type mapping is the root.
+ * <p>
+ * Example:
+ * <pre>
+ * &#64;Entity
+ * public abstract class Model {}
+ *
+ * public abstract class Animal extends Model {}
+ *
+ * &#64;Entity
+ * public class Cat extends Animal {}
+ * </pre>
+ * The "super" type mapping of the <code>Cat</code> type mapping is
+ * the <code>Model</code> type mapping. The "super" type mapping can
+ * either come from a Java annotated class from an XML mapping file.
*/
- Iterable<TypeMapping> getInheritanceHierarchy();
+ IdTypeMapping getSuperTypeMapping();
/**
- * Return the inheritance strategy or null
- */
- InheritanceType getInheritanceStrategy();
-
- /**
- * Return whether this type mapping is a root entity in an inheritance hierarchy.
+ * Return the type mapping's "persistence" inheritance hierarchy,
+ * <em>excluding</em> the type mapping itself.
+ * If there is an inheritance loop, the iterable will terminate before including
+ * this type mapping.
*/
- boolean isRootEntity();
-
+ Iterable<IdTypeMapping> getAncestors();
+
/**
- * Return the root entity of the inheritance hierarchy or null.
+ * Return the type mapping's "persistence" inheritance hierarchy,
+ * <em>including</em> the type mapping itself.
+ * If there is an inheritance loop, the iterable will terminate before including
+ * this type mapping.
*/
- Entity getRootEntity();
-
+ Iterable<? extends TypeMapping> getInheritanceHierarchy();
+
+
// ********** tables **********
/**
@@ -168,9 +192,9 @@ public interface TypeMapping
*/
boolean tableNameIsInvalid(String tableName);
-
+
// ********** attribute mappings **********
-
+
/**
* A convenience method for getting the attribute mappings from PersistentType.attributes()
*/
@@ -205,7 +229,31 @@ public interface TypeMapping
* embeddable type mapping)
*/
boolean attributeMappingKeyAllowed(String attributeMappingKey);
-
+
+ /**
+ * Return all mappings that are mapped as id mappings
+ * @see MappingIsIdMapping
+ */
+ Iterable<AttributeMapping> getIdAttributeMappings();
+
+ /**
+ * Return the (single) mapping used as the id mapping for this type mapping.
+ * If there is more than one, return null.
+ * @see MappingIsIdMapping
+ */
+ AttributeMapping getIdAttributeMapping();
+
+ static String[] ID_ATTRIBUTE_MAPPING_KEYS
+ = new String[] { MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY };
+
+ static class MappingIsIdMapping
+ extends PredicateAdapter<AttributeMapping> {
+ @Override
+ public boolean evaluate(AttributeMapping mapping) {
+ return ArrayTools.contains(ID_ATTRIBUTE_MAPPING_KEYS, mapping.getKey());
+ }
+ }
+
/**
* Return whether the attribute with the specified name is a derived ID.
*/
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmMappedSuperclass.java
index 5c74a5156f..b7994556cc 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmMappedSuperclass.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmMappedSuperclass.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -26,8 +26,8 @@ import org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass;
* @since 2.0
*/
public interface OrmMappedSuperclass
- extends MappedSuperclass, OrmIdTypeMapping
-{
+ extends MappedSuperclass, OrmIdTypeMapping {
+
XmlMappedSuperclass getXmlTypeMapping();
JavaMappedSuperclass getJavaTypeMapping();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/persistence/PersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/persistence/PersistenceUnit.java
index 3de3df4abf..c0b248c6d5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/persistence/PersistenceUnit.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/persistence/PersistenceUnit.java
@@ -21,6 +21,7 @@ import org.eclipse.jpt.jpa.core.context.DeleteTypeRefactoringParticipant;
import org.eclipse.jpt.jpa.core.context.Embeddable;
import org.eclipse.jpt.jpa.core.context.Entity;
import org.eclipse.jpt.jpa.core.context.Generator;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.JpaContextModel;
import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.PersistentTypeContainer;
@@ -42,7 +43,7 @@ import org.eclipse.jpt.jpa.core.resource.persistence.XmlProperty;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 3.3
+ * @version 3.6
* @since 2.0
*/
public interface PersistenceUnit
@@ -797,7 +798,15 @@ public interface PersistenceUnit
* @see org.eclipse.jpt.jpa.core.MappingKeys#EMBEDDABLE_TYPE_MAPPING_KEY
*/
Embeddable getEmbeddable(String typeName);
-
+
+ /**
+ * Return the ID type mapping (entity or mapped superclass) in the persistence unit
+ * with the specified type name. Return null if there is no persistent type with
+ * the specified name or if the persistent type is not mapped as an entity or
+ * mapped superclass.
+ */
+ IdTypeMapping getIdTypeMapping(String typeName);
+
/**
* Synchronize the persistence unit's list of specified classes with the
* types in the project currently annotated.
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/MappingTools.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/MappingTools.java
index 3c355cb1ec..be06988900 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/MappingTools.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/MappingTools.java
@@ -18,8 +18,8 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jpt.common.core.internal.resource.java.source.SourceModel;
-import org.eclipse.jpt.common.core.internal.utility.TypeTools;
import org.eclipse.jpt.common.core.internal.utility.JavaProjectTools;
+import org.eclipse.jpt.common.core.internal.utility.TypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceModel;
import org.eclipse.jpt.common.utility.internal.ArrayTools;
import org.eclipse.jpt.common.utility.internal.ClassNameTools;
@@ -430,7 +430,7 @@ public final class MappingTools {
}
return null;
}
-
+
// TODO move to TypeMapping? may need different name (or may need to rename existing #resolve...)
public static SpecifiedRelationship resolveOverriddenRelationship(TypeMapping overridableTypeMapping, String attributeName) {
// convenience null check to simplify client code
@@ -446,7 +446,7 @@ public final class MappingTools {
}
return null;
}
-
+
public static String getPrimaryKeyColumnName(Entity entity) {
String pkColumnName = null;
for (PersistentAttribute attribute : entity.getPersistentType().getAllAttributes()) {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java
index 89b58e9115..54800e59a5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java
@@ -91,24 +91,28 @@ public abstract class AbstractJavaBaseEmbeddedMapping<A extends Annotation>
protected abstract JavaAttributeOverrideContainer.ParentAdapter buildAttributeOverrideContainerParentAdapter();
- // ********** target embeddable **********
-
+ // ***** target embeddable *****
+
+ public String getTargetEmbeddableName() {
+ return getPersistentAttribute().getSingleReferenceTargetTypeName();
+ }
+
public Embeddable getTargetEmbeddable() {
return this.targetEmbeddable;
}
-
+
protected void setTargetEmbeddable(Embeddable embeddable) {
Embeddable old = this.targetEmbeddable;
this.targetEmbeddable = embeddable;
this.firePropertyChanged(TARGET_EMBEDDABLE_PROPERTY, old, embeddable);
}
-
+
protected Embeddable buildTargetEmbeddable() {
- String typeName = this.getPersistentAttribute().getSingleReferenceTargetTypeName();
- return (typeName == null) ? null : this.getPersistenceUnit().getEmbeddable(typeName);
+ String typeName = getTargetEmbeddableName();
+ return (typeName == null) ? null : getPersistenceUnit().getEmbeddable(typeName);
}
-
-
+
+
// ********** embedded mappings **********
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEmbeddable.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEmbeddable.java
index 58d0c14da5..c6a52a30e5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEmbeddable.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEmbeddable.java
@@ -10,8 +10,11 @@
package org.eclipse.jpt.jpa.core.internal.context.java;
import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable;
+import org.eclipse.jpt.common.utility.internal.iterable.SingleElementIterable;
import org.eclipse.jpt.jpa.core.MappingKeys;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.Query;
+import org.eclipse.jpt.jpa.core.context.TypeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
@@ -20,21 +23,17 @@ import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
* Java embeddable type mapping
*/
public abstract class AbstractJavaEmbeddable
- extends AbstractJavaTypeMapping<EmbeddableAnnotation>
- implements JavaEmbeddable
-{
+ extends AbstractJavaTypeMapping<EmbeddableAnnotation>
+ implements JavaEmbeddable {
+
protected AbstractJavaEmbeddable(JavaPersistentType parent, EmbeddableAnnotation mappingAnnotation) {
super(parent, mappingAnnotation);
}
-
+
public String getKey() {
return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
}
-
- public JavaPersistentType getIdClass() {
- return null;
- }
-
+
public boolean isMapped() {
return true;
}
@@ -47,8 +46,23 @@ public abstract class AbstractJavaEmbeddable
public boolean validatesAgainstDatabase() {
return false;
}
-
+
public Iterable<Query> getQueries() {
return EmptyIterable.instance();
}
+
+
+ // ***** (no) inheritance *****
+
+ public IdTypeMapping getSuperTypeMapping() {
+ return null;
+ }
+
+ public Iterable<IdTypeMapping> getAncestors() {
+ return EmptyIterable.instance();
+ }
+
+ public Iterable<? extends TypeMapping> getInheritanceHierarchy() {
+ return new SingleElementIterable(this);
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEmbeddedIdMapping.java
index a5ac1737c6..35a4a61083 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEmbeddedIdMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEmbeddedIdMapping.java
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jpa.core.internal.context.java;
-import java.io.Serializable;
import java.util.List;
import org.eclipse.jpt.common.core.internal.utility.TypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java
index d13ae15969..b6850e27b8 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java
@@ -37,6 +37,7 @@ import org.eclipse.jpt.jpa.core.context.BaseJoinColumn;
import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
import org.eclipse.jpt.jpa.core.context.Entity;
import org.eclipse.jpt.jpa.core.context.Generator;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.InheritanceType;
import org.eclipse.jpt.jpa.core.context.JoinColumn;
import org.eclipse.jpt.jpa.core.context.JoinTable;
@@ -45,7 +46,6 @@ import org.eclipse.jpt.jpa.core.context.NamedColumn;
import org.eclipse.jpt.jpa.core.context.NamedDiscriminatorColumn;
import org.eclipse.jpt.jpa.core.context.OverrideContainer;
import org.eclipse.jpt.jpa.core.context.Override_;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.Query;
import org.eclipse.jpt.jpa.core.context.SecondaryTable;
import org.eclipse.jpt.jpa.core.context.SpecifiedAssociationOverride;
@@ -63,7 +63,6 @@ import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
import org.eclipse.jpt.jpa.core.context.java.JavaGeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdClassReference;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaQueryContainer;
import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedDiscriminatorColumn;
@@ -108,17 +107,15 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
* Java entity
*/
public abstract class AbstractJavaEntity
- extends AbstractJavaTypeMapping<EntityAnnotation>
- implements JavaEntity2_0, JavaGeneratorContainer.Parent, JavaQueryContainer.Parent
-{
+ extends AbstractJavaIdTypeMapping<EntityAnnotation>
+ implements JavaEntity2_0, JavaGeneratorContainer.Parent, JavaQueryContainer.Parent {
+
protected String specifiedName;
protected String defaultName;
protected Entity rootEntity;
protected final Vector<Entity> descendants = new Vector<Entity>();
- protected final JavaIdClassReference idClassReference;
-
protected final JavaSpecifiedTable table;
protected boolean specifiedTableIsAllowed;
protected boolean tableIsUndefined;
@@ -154,7 +151,6 @@ public abstract class AbstractJavaEntity
protected AbstractJavaEntity(JavaPersistentType parent, EntityAnnotation mappingAnnotation) {
super(parent, mappingAnnotation);
this.specifiedName = this.mappingAnnotation.getName();
- this.idClassReference = this.buildIdClassReference();
this.table = this.buildTable();
// start with the entity as the root - it will be recalculated in update()
this.rootEntity = this;
@@ -178,7 +174,6 @@ public abstract class AbstractJavaEntity
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
this.setSpecifiedName_(this.mappingAnnotation.getName());
- this.idClassReference.synchronizeWithResourceModel();
this.table.synchronizeWithResourceModel();
this.syncSpecifiedSecondaryTables();
this.syncSpecifiedPrimaryKeyJoinColumns();
@@ -190,45 +185,43 @@ public abstract class AbstractJavaEntity
this.generatorContainer.synchronizeWithResourceModel();
this.queryContainer.synchronizeWithResourceModel();
}
-
+
@Override
public void update() {
super.update();
-
+
this.setDefaultName(this.buildDefaultName());
-
+
// calculate root entity early - other things depend on it
this.setRootEntity(this.buildRootEntity());
this.updateDescendants();
-
- this.idClassReference.update();
-
+
this.setDefaultInheritanceStrategy(this.buildDefaultInheritanceStrategy());
-
+
this.table.update();
this.setSpecifiedTableIsAllowed(this.buildSpecifiedTableIsAllowed());
this.setTableIsUndefined(this.buildTableIsUndefined());
-
+
this.updateModels(this.getSecondaryTables());
-
+
this.updateDefaultPrimaryKeyJoinColumn();
this.updateModels(this.getPrimaryKeyJoinColumns());
-
+
this.discriminatorColumn.update();
this.setSpecifiedDiscriminatorColumnIsAllowed(this.buildSpecifiedDiscriminatorColumnIsAllowed());
this.setDiscriminatorColumnIsUndefined(this.buildDiscriminatorColumnIsUndefined());
-
+
this.setDefaultDiscriminatorValue(this.buildDefaultDiscriminatorValue());
this.setSpecifiedDiscriminatorValueIsAllowed(this.buildSpecifiedDiscriminatorValueIsAllowed());
this.setDiscriminatorValueIsUndefined(this.buildDiscriminatorValueIsUndefined());
-
+
this.attributeOverrideContainer.update();
this.associationOverrideContainer.update();
-
+
this.generatorContainer.update();
this.queryContainer.update();
}
-
+
// ********** name **********
@@ -269,7 +262,6 @@ public abstract class AbstractJavaEntity
// ********** root entity **********
- @Override
public Entity getRootEntity() {
return this.rootEntity;
}
@@ -308,21 +300,6 @@ public abstract class AbstractJavaEntity
}
- // ********** id class **********
-
- public JavaIdClassReference getIdClassReference() {
- return this.idClassReference;
- }
-
- protected JavaIdClassReference buildIdClassReference() {
- return new GenericJavaIdClassReference(this);
- }
-
- public JavaPersistentType getIdClass() {
- return this.idClassReference.getIdClass();
- }
-
-
// ********** table **********
public JavaSpecifiedTable getTable() {
@@ -659,7 +636,6 @@ public abstract class AbstractJavaEntity
// ********** inheritance strategy **********
- @Override
public InheritanceType getInheritanceStrategy() {
return (this.specifiedInheritanceStrategy != null) ? this.specifiedInheritanceStrategy : this.defaultInheritanceStrategy;
}
@@ -885,11 +861,6 @@ public abstract class AbstractJavaEntity
return this.getJpaFactory().buildJavaAttributeOverrideContainer(new AttributeOverrideContainerParentAdapter());
}
- public TypeMapping getOverridableTypeMapping() {
- PersistentType superPersistentType = this.getPersistentType().getSuperPersistentType();
- return (superPersistentType == null) ? null : superPersistentType.getMapping();
- }
-
// ********** association override container **********
@@ -966,7 +937,7 @@ public abstract class AbstractJavaEntity
// TODO eliminate duplicate tables?
@Override
public Iterable<Table> getAllAssociatedTables() {
- return IterableTools.children(this.getInheritanceHierarchy(), TypeMappingTools.ASSOCIATED_TABLES_TRANSFORMER);
+ return IterableTools.children(getInheritanceHierarchy(), TypeMappingTools.ASSOCIATED_TABLES_TRANSFORMER);
}
@Override
@@ -1112,7 +1083,6 @@ public abstract class AbstractJavaEntity
return null;
}
- @Override
public boolean isRootEntity() {
return this == this.rootEntity;
}
@@ -1246,8 +1216,7 @@ public abstract class AbstractJavaEntity
@Override
public void validate(List<IMessage> messages, IReporter reporter) {
super.validate(messages, reporter);
-
- this.validatePrimaryKey(messages, reporter);
+
this.validateTable(messages, reporter);
for (JavaSpecifiedSecondaryTable secondaryTable : this.getSecondaryTables()) {
secondaryTable.validate(messages, reporter);
@@ -1261,7 +1230,6 @@ public abstract class AbstractJavaEntity
this.attributeOverrideContainer.validate(messages, reporter);
this.associationOverrideContainer.validate(messages, reporter);
this.validateEntityName(messages);
- this.idClassReference.validate(messages, reporter);
}
@Override
@@ -1288,11 +1256,8 @@ public abstract class AbstractJavaEntity
public TextRange getNameTextRange() {
return this.getMappingAnnotation().getNameTextRange();
}
-
- protected void validatePrimaryKey(List<IMessage> messages, IReporter reporter) {
- this.buildPrimaryKeyValidator().validate(messages, reporter);
- }
-
+
+ @Override
protected JpaValidator buildPrimaryKeyValidator() {
return new GenericEntityPrimaryKeyValidator(this);
}
@@ -1453,8 +1418,8 @@ public abstract class AbstractJavaEntity
return AbstractJavaEntity.this.getValidationTextRange();
}
- public TypeMapping getOverridableTypeMapping() {
- return AbstractJavaEntity.this.getOverridableTypeMapping();
+ public IdTypeMapping getOverridableTypeMapping() {
+ return AbstractJavaEntity.this.getSuperTypeMapping();
}
public Iterable<String> getAllOverridableNames() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaIdTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaIdTypeMapping.java
new file mode 100644
index 0000000000..9c1beae46b
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaIdTypeMapping.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.jpa.core.internal.context.java;
+
+import java.util.List;
+import org.eclipse.jpt.common.core.resource.java.Annotation;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.internal.StringTools;
+import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
+import org.eclipse.jpt.jpa.core.context.AttributeMapping;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
+import org.eclipse.jpt.jpa.core.context.java.JavaIdClassReference;
+import org.eclipse.jpt.jpa.core.context.java.JavaIdTypeMapping;
+import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
+import org.eclipse.jpt.jpa.core.internal.context.JpaValidator;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+
+public abstract class AbstractJavaIdTypeMapping<A extends Annotation>
+ extends AbstractJavaTypeMapping<A>
+ implements JavaIdTypeMapping {
+
+ protected IdTypeMapping superTypeMapping;
+
+ protected final JavaIdClassReference idClassReference;
+
+
+ protected AbstractJavaIdTypeMapping(JavaPersistentType parent, A mappingAnnotation) {
+ super(parent, mappingAnnotation);
+ this.idClassReference = buildIdClassReference();
+ }
+
+
+ // ***** sync/update *****
+
+ @Override
+ public void synchronizeWithResourceModel() {
+ super.synchronizeWithResourceModel();
+ this.idClassReference.synchronizeWithResourceModel();
+ }
+
+ @Override
+ public void update() {
+ super.update();
+ setSuperTypeMapping_(findSuperTypeMapping());
+ this.idClassReference.update();
+ }
+
+
+ // ***** primary key ****
+
+ public JavaIdClassReference getIdClassReference() {
+ return this.idClassReference;
+ }
+
+ protected JavaIdClassReference buildIdClassReference() {
+ return new GenericJavaIdClassReference(this);
+ }
+
+ public String getPrimaryKeyClassName() {
+ String idClassName = getIdClassReference().getFullyQualifiedIdClassName();
+ if (StringTools.isNotBlank(idClassName)) {
+ return idClassName;
+ }
+
+ AttributeMapping idMapping = getIdAttributeMapping();
+ if (idMapping != null) {
+ return idMapping.getPersistentAttribute().getTypeName();
+ }
+
+ return null;
+ }
+
+
+ // ***** inheritance *****
+
+ public IdTypeMapping getSuperTypeMapping() {
+ return this.superTypeMapping;
+ }
+
+ protected void setSuperTypeMapping_(IdTypeMapping typeMapping) {
+ IdTypeMapping old = this.superTypeMapping;
+ this.superTypeMapping = typeMapping;
+ firePropertyChanged(SUPER_TYPE_MAPPING_PROPERTY, old, typeMapping);
+ }
+
+ protected IdTypeMapping findSuperTypeMapping() {
+ return findSuperTypeMapping(getJavaResourceType());
+ }
+
+ protected IdTypeMapping findSuperTypeMapping(JavaResourceType resourceType) {
+ String thisTypeName = getJavaResourceType().getTypeBinding().getQualifiedName();
+ String superTypeName = resourceType.getSuperclassQualifiedName();
+ // short circuit if there is no super type or if the super type is this type
+ if (superTypeName == null
+ || ObjectTools.equals(thisTypeName, superTypeName)) {
+ return null;
+ }
+ IdTypeMapping typeMapping = findTypeMapping(superTypeName);
+ if (typeMapping != null) {
+ return typeMapping;
+ }
+ JavaResourceType superResourceType = findResourceType(superTypeName);
+ return (superResourceType == null) ? null : findSuperTypeMapping(superResourceType);
+ }
+
+ protected JavaResourceType findResourceType(String typeName) {
+ return (JavaResourceType) getJpaProject().getJavaResourceType(
+ typeName, JavaResourceAnnotatedElement.AstNodeType.TYPE);
+ }
+
+ protected IdTypeMapping findTypeMapping(String typeName) {
+ return getPersistenceUnit().getIdTypeMapping(typeName);
+ }
+
+ public Iterable<IdTypeMapping> getInheritanceHierarchy() {
+ return buildInheritanceHierarchy(this);
+ }
+
+ public Iterable<IdTypeMapping> getAncestors() {
+ return (this.superTypeMapping == null) ?
+ IterableTools.<IdTypeMapping>emptyIterable() :
+ buildInheritanceHierarchy(this.superTypeMapping);
+ }
+
+ protected Iterable<IdTypeMapping> buildInheritanceHierarchy(IdTypeMapping start) {
+ // using a chain iterable to traverse up the inheritance tree
+ return ObjectTools.chain(start, new SuperTypeMappingTransformer(this));
+ }
+
+
+ // ***** validation *****
+
+ @Override
+ public void validate(List<IMessage> messages, IReporter reporter) {
+ super.validate(messages, reporter);
+ validatePrimaryKey(messages, reporter);
+ this.idClassReference.validate(messages, reporter);
+ }
+
+ protected void validatePrimaryKey(List<IMessage> messages, IReporter reporter) {
+ buildPrimaryKeyValidator().validate(messages, reporter);
+ }
+
+ protected abstract JpaValidator buildPrimaryKeyValidator();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaMappedSuperclass.java
index 66bd5fc9a7..d2491d6635 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaMappedSuperclass.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaMappedSuperclass.java
@@ -12,8 +12,9 @@ package org.eclipse.jpt.jpa.core.internal.context.java;
import java.util.List;
import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
import org.eclipse.jpt.jpa.core.MappingKeys;
+import org.eclipse.jpt.jpa.core.context.Entity;
+import org.eclipse.jpt.jpa.core.context.InheritanceType;
import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdClassReference;
import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaQueryContainer;
@@ -27,105 +28,93 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
* Java mapped superclass
*/
public abstract class AbstractJavaMappedSuperclass
- extends AbstractJavaTypeMapping<MappedSuperclassAnnotation>
- implements JavaMappedSuperclass, JavaQueryContainer.Parent
-{
- protected final JavaIdClassReference idClassReference;
+ extends AbstractJavaIdTypeMapping<MappedSuperclassAnnotation>
+ implements JavaMappedSuperclass, JavaQueryContainer.Parent {
+
protected final JavaQueryContainer queryContainer;
-
-
+
+
protected AbstractJavaMappedSuperclass(JavaPersistentType parent, MappedSuperclassAnnotation mappingAnnotation) {
super(parent, mappingAnnotation);
- this.idClassReference = this.buildIdClassReference();
this.queryContainer = this.buildQueryContainer();
}
-
-
- // ********** synchronize/update **********
-
+
+
+ // ***** synchronize/update *****
+
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
- this.idClassReference.synchronizeWithResourceModel();
this.queryContainer.synchronizeWithResourceModel();
}
-
+
@Override
public void update() {
super.update();
- this.idClassReference.update();
this.queryContainer.update();
}
-
-
- // ********** id class **********
-
- public JavaIdClassReference getIdClassReference() {
- return this.idClassReference;
- }
-
- protected JavaIdClassReference buildIdClassReference() {
- return new GenericJavaIdClassReference(this);
- }
-
- public JavaPersistentType getIdClass() {
- return this.idClassReference.getIdClass();
- }
-
-
+
+
// ********** query container **********
-
+
public JavaQueryContainer getQueryContainer() {
return this.queryContainer;
}
-
+
protected JavaQueryContainer buildQueryContainer() {
return this.getJpaFactory().buildJavaQueryContainer(this);
}
-
+
public JavaResourceMember getResourceAnnotatedElement() {
return this.getJavaResourceType();
}
-
+
public Iterable<Query> getQueries() {
return this.queryContainer.getQueries();
}
-
-
+
+
// ********** misc **********
-
+
public String getKey() {
return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
}
-
+
public boolean isMapped() {
return true;
}
-
+
public boolean tableNameIsInvalid(String tableName) {
return false;
}
-
-
- // ********** validation **********
-
+
+ public Entity getRootEntity() {
+ return null;
+ }
+
+ public boolean isRootEntity() {
+ return false;
+ }
+
+ public InheritanceType getInheritanceStrategy() {
+ return null;
+ }
+
+
+ // ***** validation *****
+
@Override
public void validate(List<IMessage> messages, IReporter reporter) {
super.validate(messages, reporter);
- this.validatePrimaryKey(messages, reporter);
- this.idClassReference.validate(messages, reporter);
this.queryContainer.validate(messages, reporter);
}
-
+
@Override
public boolean validatesAgainstDatabase() {
return false;
}
-
- protected void validatePrimaryKey(List<IMessage> messages, IReporter reporter) {
- this.buildPrimaryKeyValidator().validate(messages, reporter);
- }
-
+
+ @Override
protected JpaValidator buildPrimaryKeyValidator() {
return new GenericMappedSuperclassPrimaryKeyValidator(this);
// TODO - JPA 2.0 validation
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java
index 81397701a8..9761487596 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java
@@ -35,6 +35,7 @@ import org.eclipse.jpt.jpa.core.JpaStructureNode;
import org.eclipse.jpt.jpa.core.context.AccessType;
import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
import org.eclipse.jpt.jpa.core.context.PersistentType;
+import org.eclipse.jpt.jpa.core.context.TypeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaManagedType;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute;
@@ -56,11 +57,9 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
* </ul>
*/
public abstract class AbstractJavaPersistentType
- extends AbstractJavaManagedType<PersistentType.Parent>
- implements JavaPersistentType
-{
- protected PersistentType superPersistentType;
-
+ extends AbstractJavaManagedType<PersistentType.Parent>
+ implements JavaPersistentType {
+
protected AccessType specifiedAccess;
protected AccessType defaultAccess; // never null
@@ -97,68 +96,21 @@ public abstract class AbstractJavaPersistentType
@Override
public void update() {
super.update();
- this.setSuperPersistentType(this.buildSuperPersistentType());
this.setDefaultAccess(this.buildDefaultAccess());
this.mapping.update();
this.updateAttributes();
this.updateStructureChildren();
}
-
-
- // ********** super persistent type **********
-
+
+
+ // ***** inheritance *****
+
public PersistentType getSuperPersistentType() {
- return this.superPersistentType;
- }
-
- protected void setSuperPersistentType(PersistentType superPersistentType) {
- PersistentType old = this.superPersistentType;
- this.superPersistentType = superPersistentType;
- this.firePropertyChanged(SUPER_PERSISTENT_TYPE_PROPERTY, old, superPersistentType);
- }
-
- protected PersistentType buildSuperPersistentType() {
- HashSet<JavaResourceType> visited = new HashSet<JavaResourceType>();
- visited.add(this.resourceType);
- PersistentType spt = this.resolveSuperPersistentType(this.resourceType.getSuperclassQualifiedName(), visited);
- if (spt == null) {
- return null;
- }
- if (IterableTools.contains(spt.getInheritanceHierarchy(), this)) {
- return null; // short-circuit in this case, we have circular inheritance
- }
- return spt.isMapped() ? spt : spt.getSuperPersistentType();
+ TypeMapping superTypeMapping = this.mapping.getSuperTypeMapping();
+ return (superTypeMapping == null) ? null : superTypeMapping.getPersistentType();
}
-
- /**
- * The JPA spec allows non-persistent types in a persistent type's
- * inheritance hierarchy. We check for a persistent type with the
- * specified name in the persistence unit. If it is not found we use
- * resource persistent type and look for <em>its</em> super type.
- * <p>
- * The <code>visited</code> collection is used to detect a cycle in the
- * <em>resource</em> type inheritance hierarchy and prevent the resulting
- * stack overflow. Any cycles in the <em>context</em> type inheritance
- * hierarchy are handled in {@link #buildSuperPersistentType()}.
- */
- protected PersistentType resolveSuperPersistentType(String typeName, Collection<JavaResourceType> visited) {
- if (typeName == null) {
- return null;
- }
- JavaResourceType rType = (JavaResourceType) this.getJpaProject().getJavaResourceType(typeName, JavaResourceAnnotatedElement.AstNodeType.TYPE);
- if ((rType == null) || visited.contains(rType)) {
- return null;
- }
- visited.add(rType);
- PersistentType superType = this.resolvePersistentType(typeName);
- return (superType != null) ? superType : this.resolveSuperPersistentType(rType.getSuperclassQualifiedName(), visited); // recurse
- }
-
- protected PersistentType resolvePersistentType(String typeName) {
- return this.getPersistenceUnit().getPersistentType(typeName);
- }
-
-
+
+
// ********** access annotation **********
protected AccessAnnotation2_0 getAccessAnnotation() {
@@ -242,8 +194,8 @@ public abstract class AbstractJavaPersistentType
return accessType;
}
- if (this.superPersistentType != null) {
- accessType = this.superPersistentType.getAccess();
+ if (getSuperPersistentType() != null) {
+ accessType = getSuperPersistentType().getAccess();
if (accessType != null) {
return accessType;
}
@@ -428,7 +380,7 @@ public abstract class AbstractJavaPersistentType
return stream.hasNext() ? null : attribute;
}
// recurse
- return (this.superPersistentType == null) ? null : this.superPersistentType.resolveAttribute(attributeName);
+ return (getSuperPersistentType() == null) ? null : getSuperPersistentType().resolveAttribute(attributeName);
}
protected Iterable<String> convertToNames(Iterable<? extends PersistentAttribute> attrs) {
@@ -700,35 +652,27 @@ public abstract class AbstractJavaPersistentType
// ********** inheritance **********
-
+
public Iterable<PersistentType> getInheritanceHierarchy() {
- return this.buildInheritanceHierarchy(this);
+ return IterableTools.insert(this, getAncestors());
}
-
+
public Iterable<PersistentType> getAncestors() {
- return (this.superPersistentType == null) ?
- IterableTools.<PersistentType>emptyIterable() :
- this.buildInheritanceHierarchy(this.superPersistentType);
- }
-
- protected Iterable<PersistentType> buildInheritanceHierarchy(PersistentType start) {
- // using a chain iterable to traverse up the inheritance tree
- return ObjectTools.chain(start, SUPER_PERSISTENT_TYPE_TRANSFORMER);
+ return IterableTools.transform(getMapping().getAncestors(), TypeMapping.PERSISTENT_TYPE_TRANSFORMER);
}
-
+
protected Iterable<JavaResourceType> getResourceInheritanceHierarchy() {
return (this.resourceType == null) ?
IterableTools.<JavaResourceType>emptyIterable() :
ObjectTools.chain(this.resourceType, new SuperJavaResourceTypeTransformer());
}
-
-
+
/**
* Transform a Java resource type into its super Java resource type.
*/
protected class SuperJavaResourceTypeTransformer
- extends TransformerAdapter<JavaResourceType, JavaResourceType>
- {
+ extends TransformerAdapter<JavaResourceType, JavaResourceType> {
+
// keep track of visited resource types to prevent cyclical inheritance
private final HashSet<JavaResourceType> visitedResourceTypes = new HashSet<JavaResourceType>();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaTypeMapping.java
index e576b50285..23cb8ad432 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaTypeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaTypeMapping.java
@@ -17,15 +17,12 @@ import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable;
import org.eclipse.jpt.common.utility.internal.iterable.FilteringIterable;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.SpecifiedColumn;
import org.eclipse.jpt.jpa.core.context.SpecifiedRelationship;
import org.eclipse.jpt.jpa.core.context.Table;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
@@ -40,19 +37,19 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
* Java type mapping
*/
public abstract class AbstractJavaTypeMapping<A extends Annotation>
- extends AbstractJavaContextModel<JavaPersistentType>
- implements JavaTypeMapping
-{
+ extends AbstractJavaContextModel<JavaPersistentType>
+ implements JavaTypeMapping {
+
// this can be null for a "null" type mapping
protected final A mappingAnnotation;
-
-
+
+
protected AbstractJavaTypeMapping(JavaPersistentType parent, A mappingAnnotation) {
super(parent);
this.mappingAnnotation = mappingAnnotation;
}
-
-
+
+
// ********** misc **********
public JavaPersistentType getPersistentType() {
@@ -110,62 +107,24 @@ public abstract class AbstractJavaTypeMapping<A extends Annotation>
public org.eclipse.jpt.jpa.db.Table resolveDbTable(String tableName) {
return null;
}
-
-
- // ********** inheritance **********
-
- public TypeMapping getSuperTypeMapping() {
- PersistentType superPersistentType = this.getPersistentType().getSuperPersistentType();
- return (superPersistentType == null) ? null : superPersistentType.getMapping();
- }
-
- public Iterable<TypeMapping> getInheritanceHierarchy() {
- return IterableTools.transform(this.getPersistentType().getInheritanceHierarchy(), PersistentType.MAPPING_TRANSFORMER);
- }
-
- /**
- * Return the type mapping's "persistence" ancestors,
- * <em>excluding</em> the type mapping itself.
- * The returned iterator will return elements infinitely if the hierarchy
- * has a loop.
- */
- protected Iterable<TypeMapping> getAncestors() {
- return IterableTools.transform(this.getPersistentType().getAncestors(), PersistentType.MAPPING_TRANSFORMER);
- }
-
- public InheritanceType getInheritanceStrategy() {
- return null;
- }
-
- public boolean isRootEntity() {
- return false;
- }
-
- public Entity getRootEntity() {
- return null;
- }
-
-
+
+
// ********** attribute mappings **********
public Iterable<JavaAttributeMapping> getAttributeMappings() {
- return IterableTools.downCast(IterableTools.transform(this.getPersistentType().getAttributes(), PersistentAttribute.MAPPING_TRANSFORMER));
+ return IterableTools.downCast(IterableTools.transform(getPersistentType().getAttributes(), PersistentAttribute.MAPPING_TRANSFORMER));
}
public Iterable<JavaAttributeMapping> getAttributeMappings(String mappingKey) {
- return IterableTools.filter(this.getAttributeMappings(), new AttributeMapping.KeyEquals(mappingKey));
+ return IterableTools.filter(getAttributeMappings(), new AttributeMapping.KeyEquals(mappingKey));
}
public Iterable<AttributeMapping> getAllAttributeMappings() {
- return IterableTools.children(this.getNonNullInheritanceHierarchy(), TypeMappingTools.ATTRIBUTE_MAPPINGS_TRANSFORMER);
+ return IterableTools.transform(getPersistentType().getAllAttributes(), PersistentAttribute.MAPPING_TRANSFORMER);
}
-
- protected Iterable<TypeMapping> getNonNullInheritanceHierarchy() {
- return IterableTools.removeNulls(this.getInheritanceHierarchy());
- }
-
+
public Iterable<AttributeMapping> getAllAttributeMappings(final String mappingKey) {
- return IterableTools.filter(this.getAllAttributeMappings(), new AttributeMapping.KeyEquals(mappingKey));
+ return IterableTools.filter(getAllAttributeMappings(), new AttributeMapping.KeyEquals(mappingKey));
}
public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
@@ -173,18 +132,30 @@ public abstract class AbstractJavaTypeMapping<A extends Annotation>
}
public Iterable<AttributeMapping> getNonTransientAttributeMappings() {
- return new FilteringIterable<AttributeMapping>(this.getAllAttributeMappings(), AttributeMapping.IS_NOT_TRANSIENT);
+ return new FilteringIterable<AttributeMapping>(getAllAttributeMappings(), AttributeMapping.IS_NOT_TRANSIENT);
}
-
-
+
+ public Iterable<AttributeMapping> getIdAttributeMappings() {
+ return IterableTools.filter(getAllAttributeMappings(), new IdTypeMapping.MappingIsIdMapping());
+ }
+
+ public AttributeMapping getIdAttributeMapping() {
+ Iterable<AttributeMapping> idMappings = getIdAttributeMappings();
+ if (IterableTools.size(idMappings) == 1) {
+ return IterableTools.get(idMappings, 0);
+ }
+ return null;
+ }
+
+
// ********** attribute overrides **********
public Iterable<String> getOverridableAttributeNames() {
- return IterableTools.children(this.getAttributeMappings(), AttributeMapping.ALL_OVERRIDABLE_ATTRIBUTE_MAPPING_NAMES_TRANSFORMER);
+ return IterableTools.children(getAttributeMappings(), AttributeMapping.ALL_OVERRIDABLE_ATTRIBUTE_MAPPING_NAMES_TRANSFORMER);
}
public Iterable<String> getAllOverridableAttributeNames() {
- return IterableTools.children(this.getInheritanceHierarchy(), TypeMappingTools.OVERRIDABLE_ATTRIBUTE_NAMES_TRANSFORMER);
+ return IterableTools.children(getInheritanceHierarchy(), TypeMappingTools.OVERRIDABLE_ATTRIBUTE_NAMES_TRANSFORMER);
}
public SpecifiedColumn resolveOverriddenColumn(String attributeName) {
@@ -199,17 +170,17 @@ public abstract class AbstractJavaTypeMapping<A extends Annotation>
// ********** association overrides **********
-
+
public Iterable<String> getOverridableAssociationNames() {
- return IterableTools.children(this.getAttributeMappings(), AttributeMapping.ALL_OVERRIDABLE_ASSOCIATION_MAPPING_NAMES_TRANSFORMER);
+ return IterableTools.children(getAttributeMappings(), AttributeMapping.ALL_OVERRIDABLE_ASSOCIATION_MAPPING_NAMES_TRANSFORMER);
}
-
+
public Iterable<String> getAllOverridableAssociationNames() {
- return IterableTools.children(this.getInheritanceHierarchy(), TypeMappingTools.OVERRIDABLE_ASSOCIATION_NAMES_TRANSFORMER);
+ return IterableTools.children(getInheritanceHierarchy(), TypeMappingTools.OVERRIDABLE_ASSOCIATION_NAMES_TRANSFORMER);
}
-
+
public SpecifiedRelationship resolveOverriddenRelationship(String attributeName) {
- for (AttributeMapping attributeMapping : this.getAttributeMappings()) {
+ for (AttributeMapping attributeMapping : getAttributeMappings()) {
SpecifiedRelationship relationship = attributeMapping.resolveOverriddenRelationship(attributeName);
if (relationship != null) {
return relationship;
@@ -217,15 +188,15 @@ public abstract class AbstractJavaTypeMapping<A extends Annotation>
}
return null;
}
-
-
+
+
// ********** generators **********
-
+
public Iterable<Generator> getGenerators() {
- return IterableTools.children(this.getAttributeMappings(), AttributeMapping.GENERATORS_TRANSFORMER);
+ return IterableTools.children(getAttributeMappings(), AttributeMapping.GENERATORS_TRANSFORMER);
}
-
-
+
+
// ********** validation **********
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/GenericJavaIdClassReference.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/GenericJavaIdClassReference.java
index 452e85cf63..4ad8913d7d 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/GenericJavaIdClassReference.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/GenericJavaIdClassReference.java
@@ -16,6 +16,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.jpa.core.context.AccessType;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaIdClassReference;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
@@ -29,18 +30,24 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
* Java ID class reference
*/
public class GenericJavaIdClassReference
- extends AbstractJavaContextModel<JavaTypeMapping>
- implements JavaIdClassReference, PersistentType.Parent
-{
+ extends AbstractJavaContextModel<JavaTypeMapping>
+ implements JavaIdClassReference, PersistentType.Parent {
+
+ protected String specifiedIdClassName;
+
+ protected String defaultIdClassName;
+
protected String idClassName;
+
protected String fullyQualifiedIdClassName;
+
// the ref holds the type directly because the ref is the type's parent
protected JavaPersistentType idClass;
-
-
+
+
public GenericJavaIdClassReference(JavaTypeMapping parent) {
super(parent);
- this.idClassName = this.buildIdClassName();
+ this.specifiedIdClassName = buildSpecifiedIdClassName();
// 'idClass' is resolved in the update
}
@@ -50,55 +57,78 @@ public class GenericJavaIdClassReference
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
- this.setIdClassName_(this.buildIdClassName());
+ setSpecifiedIdClassName_(buildSpecifiedIdClassName());
if (this.idClass != null) {
this.idClass.synchronizeWithResourceModel();
}
}
-
+
@Override
public void update() {
super.update();
- this.setFullyQualifiedIdClassName(this.buildFullyQualifiedIdClassName());
- this.updateIdClass();
+ setDefaultIdClassName_(buildDefaultIdClassName());
+ setIdClassName_(buildIdClassName());
+ setFullyQualifiedIdClassName(buildFullyQualifiedIdClassName());
+ updateIdClass();
}
- // ********** id class name **********
-
+ // ***** id class name *****
+
public String getIdClassName() {
return this.getSpecifiedIdClassName();
}
-
+
+ protected void setIdClassName_(String name) {
+ String old = this.idClassName;
+ this.idClassName = name;
+ firePropertyChanged(ID_CLASS_NAME_PROPERTY, old, name);
+ }
+
+ protected String buildIdClassName() {
+ return (this.specifiedIdClassName != null) ? this.specifiedIdClassName : this.defaultIdClassName;
+ }
+
public String getSpecifiedIdClassName() {
- return this.idClassName;
+ return this.specifiedIdClassName;
}
-
+
public void setSpecifiedIdClassName(String name) {
- if (ObjectTools.notEquals(name, this.idClassName)) {
- this.getIdClassAnnotationForUpdate().setValue(name);
- this.removeIdClassAnnotationIfUnset();
- this.setIdClassName_(name);
+ if (ObjectTools.notEquals(name, this.specifiedIdClassName)) {
+ getIdClassAnnotationForUpdate().setValue(name);
+ removeIdClassAnnotationIfUnset();
+ setSpecifiedIdClassName_(name);
}
}
-
- protected void setIdClassName_(String name) {
- String old = this.idClassName;
- this.idClassName = name;
+
+ protected void setSpecifiedIdClassName_(String name) {
+ String old = this.specifiedIdClassName;
+ this.specifiedIdClassName = name;
this.firePropertyChanged(SPECIFIED_ID_CLASS_NAME_PROPERTY, old, name);
}
-
- protected String buildIdClassName() {
+
+ protected String buildSpecifiedIdClassName() {
IdClassAnnotation annotation = this.getIdClassAnnotation();
return (annotation == null) ? null : annotation.getValue();
}
-
+
public String getDefaultIdClassName() {
- return null;
+ return this.defaultIdClassName;
}
-
+
+ protected void setDefaultIdClassName_(String name) {
+ String old = this.defaultIdClassName;
+ this.defaultIdClassName = name;
+ this.firePropertyChanged(DEFAULT_ID_CLASS_NAME_PROPERTY, old, name);
+ }
+
+ protected String buildDefaultIdClassName() {
+ IdTypeMapping superType = getParent().getSuperTypeMapping();
+ return (superType == null) ? null : superType.getIdClassReference().getFullyQualifiedIdClassName();
+ }
+
public boolean isSpecified() {
- return this.idClassName != null;
+ return this.specifiedIdClassName != null;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JavaNullTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JavaNullTypeMapping.java
index 6b70a8ff26..3334b14c9b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JavaNullTypeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/JavaNullTypeMapping.java
@@ -13,8 +13,11 @@ import java.util.List;
import org.eclipse.jpt.common.core.resource.java.Annotation;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable;
+import org.eclipse.jpt.common.utility.internal.iterable.SingleElementIterable;
import org.eclipse.jpt.jpa.core.MappingKeys;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.Query;
+import org.eclipse.jpt.jpa.core.context.TypeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.validation.JptJpaCoreValidationMessages;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
@@ -24,19 +27,16 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
* Java null type mapping
*/
public class JavaNullTypeMapping
- extends AbstractJavaTypeMapping<Annotation>
-{
+ extends AbstractJavaTypeMapping<Annotation> {
+
public JavaNullTypeMapping(JavaPersistentType parent) {
super(parent, null);
}
-
+
+
public String getKey() {
return MappingKeys.NULL_TYPE_MAPPING_KEY;
}
-
- public JavaPersistentType getIdClass() {
- return null;
- }
public boolean isMapped() {
return false;
@@ -49,10 +49,22 @@ public class JavaNullTypeMapping
public Iterable<Query> getQueries() {
return EmptyIterable.instance();
}
-
-
+
+ public IdTypeMapping getSuperTypeMapping() {
+ return null;
+ }
+
+ public Iterable<IdTypeMapping> getAncestors() {
+ return EmptyIterable.instance();
+ }
+
+ public Iterable<? extends TypeMapping> getInheritanceHierarchy() {
+ return new SingleElementIterable(this);
+ }
+
+
// ********** validation **********
-
+
/**
* We added this message here because the most likely solution is to add
* an annotation to the .java file.
@@ -77,7 +89,7 @@ public class JavaNullTypeMapping
public boolean validatesAgainstDatabase() {
return false;
}
-
+
@Override
public TextRange getValidationTextRange() {
return this.getPersistentType().getValidationTextRange();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
index 1bbbe2c7f7..c02ec88280 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
@@ -24,7 +24,6 @@ import org.eclipse.jpt.jpa.core.context.Embeddable;
import org.eclipse.jpt.jpa.core.context.JpaContextModel;
import org.eclipse.jpt.jpa.core.context.OverrideContainer;
import org.eclipse.jpt.jpa.core.context.Override_;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.SpecifiedAttributeOverride;
import org.eclipse.jpt.jpa.core.context.SpecifiedColumn;
import org.eclipse.jpt.jpa.core.context.TableColumn;
@@ -93,27 +92,27 @@ public abstract class AbstractOrmBaseEmbeddedMapping<X extends AbstractXmlEmbedd
// ********** target embeddable **********
-
+
+ public String getTargetEmbeddableName() {
+ return getFullyQualifiedAttributeType();
+ }
+
public Embeddable getTargetEmbeddable() {
return this.targetEmbeddable;
}
-
+
protected void setTargetEmbeddable(Embeddable embeddable) {
Embeddable old = this.targetEmbeddable;
this.targetEmbeddable = embeddable;
this.firePropertyChanged(TARGET_EMBEDDABLE_PROPERTY, old, embeddable);
}
-
+
protected Embeddable buildTargetEmbeddable() {
- TypeMapping typeMapping = this.getResolvedTargetTypeMapping();
- return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null;
+ String typeName = getTargetEmbeddableName();
+ return (typeName == null) ? null : getPersistenceUnit().getEmbeddable(typeName);
}
-
- protected TypeMapping getResolvedTargetTypeMapping() {
- PersistentType resolvedTargetType = this.getResolvedAttributeType();
- return (resolvedTargetType == null) ? null : resolvedTargetType.getMapping();
- }
-
+
+
// ********** embedded mappings **********
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEmbeddable.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEmbeddable.java
index d566bcaefe..d0eb056dc8 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEmbeddable.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEmbeddable.java
@@ -10,9 +10,12 @@
package org.eclipse.jpt.jpa.core.internal.context.orm;
import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable;
+import org.eclipse.jpt.common.utility.internal.iterable.SingleElementIterable;
import org.eclipse.jpt.jpa.core.MappingKeys;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.Query;
import org.eclipse.jpt.jpa.core.context.Table;
+import org.eclipse.jpt.jpa.core.context.TypeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
@@ -98,8 +101,23 @@ public abstract class AbstractOrmEmbeddable<X extends XmlEmbeddable>
public Iterable<Query> getQueries() {
return EmptyIterable.instance();
}
-
-
+
+
+ // ***** (no) inheritance *****
+
+ public IdTypeMapping getSuperTypeMapping() {
+ return null;
+ }
+
+ public Iterable<IdTypeMapping> getAncestors() {
+ return EmptyIterable.instance();
+ }
+
+ public Iterable<? extends TypeMapping> getInheritanceHierarchy() {
+ return new SingleElementIterable(this);
+ }
+
+
// ********** validation **********
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEntity.java
index 7d6f1753e6..79c68fec83 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEntity.java
@@ -48,7 +48,6 @@ import org.eclipse.jpt.jpa.core.context.NamedColumn;
import org.eclipse.jpt.jpa.core.context.NamedDiscriminatorColumn;
import org.eclipse.jpt.jpa.core.context.OverrideContainer;
import org.eclipse.jpt.jpa.core.context.Override_;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
import org.eclipse.jpt.jpa.core.context.Query;
import org.eclipse.jpt.jpa.core.context.Relationship;
@@ -65,7 +64,6 @@ import org.eclipse.jpt.jpa.core.context.Table;
import org.eclipse.jpt.jpa.core.context.TableColumn;
import org.eclipse.jpt.jpa.core.context.TypeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdClassReference;
import org.eclipse.jpt.jpa.core.context.java.JavaOverrideContainer;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPrimaryKeyJoinColumn;
@@ -75,7 +73,6 @@ import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
import org.eclipse.jpt.jpa.core.context.orm.OrmGeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdClassReference;
import org.eclipse.jpt.jpa.core.context.orm.OrmOverrideContainer;
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
import org.eclipse.jpt.jpa.core.context.orm.OrmQueryContainer;
@@ -113,7 +110,6 @@ import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride;
import org.eclipse.jpt.jpa.core.resource.orm.XmlDiscriminatorColumn;
import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlIdClassContainer;
import org.eclipse.jpt.jpa.core.resource.orm.XmlPrimaryKeyJoinColumn;
import org.eclipse.jpt.jpa.core.resource.orm.XmlSecondaryTable;
import org.eclipse.jpt.jpa.core.validation.JptJpaCoreValidationMessages;
@@ -126,17 +122,15 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
* <code>orm.xml</code> entity
*/
public abstract class AbstractOrmEntity<X extends XmlEntity>
- extends AbstractOrmTypeMapping<X>
- implements OrmEntity2_0
-{
+ extends AbstractOrmIdTypeMapping<X>
+ implements OrmEntity2_0 {
+
protected String specifiedName;
protected String defaultName;
protected Entity rootEntity;
protected final Vector<Entity> descendants = new Vector<Entity>();
- protected final OrmIdClassReference idClassReference;
-
protected final OrmSpecifiedTable table;
protected boolean specifiedTableIsAllowed;
protected boolean tableIsUndefined;
@@ -179,7 +173,6 @@ public abstract class AbstractOrmEntity<X extends XmlEntity>
protected AbstractOrmEntity(OrmPersistentType parent, X xmlEntity) {
super(parent, xmlEntity);
this.specifiedName = xmlEntity.getName();
- this.idClassReference = this.buildIdClassReference();
this.table = this.buildTable();
// start with the entity as the root - it will be recalculated in update()
this.rootEntity = this;
@@ -198,72 +191,68 @@ public abstract class AbstractOrmEntity<X extends XmlEntity>
}
- // ********** synchronize/update **********
-
+ // ***** sync/update *****
+
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
-
+
this.setSpecifiedName_(this.xmlTypeMapping.getName());
-
- this.idClassReference.synchronizeWithResourceModel();
-
+
this.table.synchronizeWithResourceModel();
-
+
this.syncSpecifiedSecondaryTables();
-
+
this.syncSpecifiedPrimaryKeyJoinColumns();
-
+
this.setSpecifiedInheritanceStrategy_(this.buildSpecifiedInheritanceStrategy());
this.setSpecifiedDiscriminatorValue_(this.xmlTypeMapping.getDiscriminatorValue());
this.discriminatorColumn.synchronizeWithResourceModel();
-
+
this.attributeOverrideContainer.synchronizeWithResourceModel();
this.associationOverrideContainer.synchronizeWithResourceModel();
-
+
this.generatorContainer.synchronizeWithResourceModel();
this.queryContainer.synchronizeWithResourceModel();
}
-
+
@Override
public void update() {
super.update();
-
+
this.setDefaultName(this.buildDefaultName());
-
+
// calculate root entity early - other things depend on it
this.setRootEntity(this.buildRootEntity());
this.updateDescendants();
-
- this.idClassReference.update();
-
+
this.setDefaultInheritanceStrategy(this.buildDefaultInheritanceStrategy());
-
+
this.table.update();
this.setSpecifiedTableIsAllowed(this.buildSpecifiedTableIsAllowed());
this.setTableIsUndefined(this.buildTableIsUndefined());
-
+
this.updateVirtualSecondaryTables();
this.updateModels(this.getSecondaryTables());
-
+
this.updateDefaultPrimaryKeyJoinColumns();
this.updateModels(this.getPrimaryKeyJoinColumns());
-
+
this.discriminatorColumn.update();
this.setSpecifiedDiscriminatorColumnIsAllowed(this.buildSpecifiedDiscriminatorColumnIsAllowed());
this.setDiscriminatorColumnIsUndefined(this.buildDiscriminatorColumnIsUndefined());
-
+
this.setDefaultDiscriminatorValue(this.buildDefaultDiscriminatorValue());
this.setSpecifiedDiscriminatorValueIsAllowed(this.buildSpecifiedDiscriminatorValueIsAllowed());
this.setDiscriminatorValueIsUndefined(this.buildDiscriminatorValueIsUndefined());
-
+
this.attributeOverrideContainer.update();
this.associationOverrideContainer.update();
-
+
this.generatorContainer.update();
this.queryContainer.update();
}
-
+
// ********** name **********
@@ -359,30 +348,6 @@ public abstract class AbstractOrmEntity<X extends XmlEntity>
}
- // ********** id class **********
-
- public OrmIdClassReference getIdClassReference() {
- return this.idClassReference;
- }
-
- protected OrmIdClassReference buildIdClassReference() {
- return new GenericOrmIdClassReference(this);
- }
-
- public XmlIdClassContainer getXmlIdClassContainer() {
- return this.getXmlTypeMapping();
- }
-
- public JavaIdClassReference getJavaIdClassReferenceForDefaults() {
- JavaEntity javaEntity = this.getJavaTypeMappingForDefaults();
- return (javaEntity == null) ? null : javaEntity.getIdClassReference();
- }
-
- public JavaPersistentType getIdClass() {
- return this.idClassReference.getIdClass();
- }
-
-
// ********** table **********
public OrmSpecifiedTable getTable() {
@@ -1276,8 +1241,7 @@ public abstract class AbstractOrmEntity<X extends XmlEntity>
}
protected TypeMapping getOverridableTypeMapping() {
- PersistentType superPersistentType = this.getPersistentType().getSuperPersistentType();
- return (superPersistentType == null) ? null : superPersistentType.getMapping();
+ return getSuperTypeMapping();
}
protected Column resolveOverriddenColumnForAttributeOverride(String attributeName) {
@@ -1381,7 +1345,7 @@ public abstract class AbstractOrmEntity<X extends XmlEntity>
// TODO eliminate duplicate tables?
public Iterable<Table> getAllAssociatedTables() {
- return IterableTools.children(this.getInheritanceHierarchy(), TypeMappingTools.ASSOCIATED_TABLES_TRANSFORMER);
+ return IterableTools.children(getInheritanceHierarchy(), TypeMappingTools.ASSOCIATED_TABLES_TRANSFORMER);
}
public Iterable<String> getAllAssociatedTableNames() {
@@ -1704,7 +1668,6 @@ public abstract class AbstractOrmEntity<X extends XmlEntity>
public void validate(List<IMessage> messages, IReporter reporter) {
super.validate(messages, reporter);
- this.validatePrimaryKey(messages, reporter);
this.validateTable(messages, reporter);
for (OrmSpecifiedSecondaryTable secondaryTable : this.getSpecifiedSecondaryTables()) {
secondaryTable.validate(messages, reporter);
@@ -1740,11 +1703,8 @@ public abstract class AbstractOrmEntity<X extends XmlEntity>
public TextRange getNameTextRange() {
return this.getXmlTypeMapping().getNameTextRange();
}
-
- protected void validatePrimaryKey(List<IMessage> messages, IReporter reporter) {
- this.buildPrimaryKeyValidator().validate(messages, reporter);
- }
-
+
+ @Override
protected JpaValidator buildPrimaryKeyValidator() {
return new GenericEntityPrimaryKeyValidator(this);
// TODO - JPA 2.0 validation
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmIdTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmIdTypeMapping.java
new file mode 100644
index 0000000000..140d0cc35d
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmIdTypeMapping.java
@@ -0,0 +1,208 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.jpa.core.internal.context.orm;
+
+import java.util.List;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
+import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
+import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.common.utility.internal.StringTools;
+import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
+import org.eclipse.jpt.jpa.core.context.AttributeMapping;
+import org.eclipse.jpt.jpa.core.context.Entity;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
+import org.eclipse.jpt.jpa.core.context.InheritanceType;
+import org.eclipse.jpt.jpa.core.context.java.JavaIdClassReference;
+import org.eclipse.jpt.jpa.core.context.java.JavaIdTypeMapping;
+import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
+import org.eclipse.jpt.jpa.core.context.orm.OrmIdClassReference;
+import org.eclipse.jpt.jpa.core.context.orm.OrmIdTypeMapping;
+import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
+import org.eclipse.jpt.jpa.core.internal.context.JpaValidator;
+import org.eclipse.jpt.jpa.core.resource.orm.XmlIdClassContainer;
+import org.eclipse.jpt.jpa.core.resource.orm.XmlIdTypeMapping;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+
+public abstract class AbstractOrmIdTypeMapping<X extends XmlIdTypeMapping>
+ extends AbstractOrmTypeMapping<X>
+ implements OrmIdTypeMapping {
+
+ protected final OrmIdClassReference idClassReference;
+
+ protected IdTypeMapping superTypeMapping;
+
+ protected AbstractOrmIdTypeMapping(OrmPersistentType parent, X xmlTypeMapping) {
+ super(parent, xmlTypeMapping);
+ this.idClassReference = buildIdClassReference();
+ }
+
+
+ // ***** sync/update *****
+
+ @Override
+ public void synchronizeWithResourceModel() {
+ super.synchronizeWithResourceModel();
+ this.idClassReference.synchronizeWithResourceModel();
+ }
+
+ @Override
+ public void update() {
+ super.update();
+ this.idClassReference.update();
+ setSuperTypeMapping_(findSuperTypeMapping());
+ }
+
+
+ // ***** java *****
+
+ @Override
+ public JavaTypeMapping getJavaTypeMapping() {
+ return (JavaIdTypeMapping) super.getJavaTypeMapping();
+ }
+
+ @Override
+ public JavaIdTypeMapping getJavaTypeMappingForDefaults() {
+ return (JavaIdTypeMapping) super.getJavaTypeMappingForDefaults();
+ }
+
+
+ // ***** primary key *****
+
+ public OrmIdClassReference getIdClassReference() {
+ return this.idClassReference;
+ }
+
+ protected OrmIdClassReference buildIdClassReference() {
+ return new GenericOrmIdClassReference(this);
+ }
+
+ public XmlIdClassContainer getXmlIdClassContainer() {
+ return getXmlTypeMapping();
+ }
+
+ public JavaIdClassReference getJavaIdClassReferenceForDefaults() {
+ JavaIdTypeMapping javaTypeMapping = getJavaTypeMappingForDefaults();
+ return (javaTypeMapping == null) ? null : javaTypeMapping.getIdClassReference();
+ }
+
+ public String getPrimaryKeyClassName() {
+ String idClassName = getIdClassReference().getFullyQualifiedIdClassName();
+ if (StringTools.isNotBlank(idClassName)) {
+ return idClassName;
+ }
+
+ AttributeMapping idMapping = getIdAttributeMapping();
+ if (idMapping != null) {
+ return idMapping.getPersistentAttribute().getTypeName();
+ }
+
+ return null;
+ }
+
+
+ // ***** inheritance *****
+
+ public IdTypeMapping getSuperTypeMapping() {
+ return this.superTypeMapping;
+ }
+
+ protected void setSuperTypeMapping_(IdTypeMapping typeMapping) {
+ IdTypeMapping old = this.superTypeMapping;
+ this.superTypeMapping = typeMapping;
+ firePropertyChanged(SUPER_TYPE_MAPPING_PROPERTY, old, typeMapping);
+ }
+
+ protected IdTypeMapping findSuperTypeMapping() {
+ return findSuperTypeMapping(getFullyQualifiedParentClass());
+ }
+
+ protected IdTypeMapping findSuperTypeMapping(String superTypeName) {
+ String thisTypeName = getPersistentType().getName();
+ // short circuit if there is no super type or if the super type is this type
+ if (superTypeName == null
+ || ObjectTools.equals(thisTypeName, superTypeName)) {
+ return null;
+ }
+ IdTypeMapping typeMapping = findTypeMapping(superTypeName);
+ if (typeMapping != null) {
+ return typeMapping;
+ }
+ JavaResourceType superResourceType = findResourceType(superTypeName);
+ return (superResourceType == null) ? null : findSuperTypeMapping(superResourceType.getSuperclassQualifiedName());
+ }
+
+ protected JavaResourceType findResourceType(String typeName) {
+ return (JavaResourceType) getJpaProject().getJavaResourceType(
+ typeName, JavaResourceAnnotatedElement.AstNodeType.TYPE);
+ }
+
+ protected IdTypeMapping findTypeMapping(String typeName) {
+ return getPersistenceUnit().getIdTypeMapping(typeName);
+ }
+
+ public Iterable<IdTypeMapping> getInheritanceHierarchy() {
+ return buildInheritanceHierarchy(this);
+ }
+
+ public Iterable<IdTypeMapping> getAncestors() {
+ return (this.superTypeMapping == null) ?
+ IterableTools.<IdTypeMapping>emptyIterable() :
+ buildInheritanceHierarchy(this.superTypeMapping);
+ }
+
+ protected Iterable<IdTypeMapping> buildInheritanceHierarchy(IdTypeMapping start) {
+ // using a chain iterable to traverse up the inheritance tree
+ return ObjectTools.chain(start, new SuperTypeMappingTransformer(this));
+ }
+
+ public InheritanceType getInheritanceStrategy() {
+ return null;
+ }
+
+ public boolean isRootEntity() {
+ return false;
+ }
+
+ public Entity getRootEntity() {
+ return null;
+ }
+
+
+ // ***** content assist *****
+
+ @Override
+ public Iterable<String> getCompletionProposals(int pos) {
+ Iterable<String> result = super.getCompletionProposals(pos);
+ if (result != null) {
+ return result;
+ }
+ result = this.idClassReference.getCompletionProposals(pos);
+ if (result != null) {
+ return result;
+ }
+ return null;
+ }
+
+
+ // ***** validation *****
+
+ @Override
+ public void validate(List<IMessage> messages, IReporter reporter) {
+ super.validate(messages, reporter);
+ validatePrimaryKey(messages, reporter);
+ }
+
+ protected void validatePrimaryKey(List<IMessage> messages, IReporter reporter) {
+ this.buildPrimaryKeyValidator().validate(messages, reporter);
+ }
+
+ protected abstract JpaValidator buildPrimaryKeyValidator();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMappedSuperclass.java
index 70466226c9..391fb992b3 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMappedSuperclass.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMappedSuperclass.java
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jpa.core.internal.context.orm;
-import java.util.List;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable;
@@ -17,140 +16,91 @@ import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.jpa.core.MappingKeys;
import org.eclipse.jpt.jpa.core.context.Query;
import org.eclipse.jpt.jpa.core.context.Table;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdClassReference;
import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdClassReference;
import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
import org.eclipse.jpt.jpa.core.internal.context.JpaValidator;
import org.eclipse.jpt.jpa.core.internal.jpa1.context.GenericMappedSuperclassPrimaryKeyValidator;
import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlIdClassContainer;
import org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass;
import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
/**
* <code>orm.xml</code> mapped superclass
*/
public abstract class AbstractOrmMappedSuperclass<X extends XmlMappedSuperclass>
- extends AbstractOrmTypeMapping<X>
- implements OrmMappedSuperclass
-{
- protected final OrmIdClassReference idClassReference;
-
-
+ extends AbstractOrmIdTypeMapping<X>
+ implements OrmMappedSuperclass {
+
protected AbstractOrmMappedSuperclass(OrmPersistentType parent, X xmlMappedSuperclass) {
super(parent, xmlMappedSuperclass);
- this.idClassReference = this.buildIdClassReference();
}
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.idClassReference.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.idClassReference.update();
- }
-
-
+
+
// ********** key **********
-
+
public String getKey() {
return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
}
-
-
- // ********** id class **********
-
- public OrmIdClassReference getIdClassReference() {
- return this.idClassReference;
- }
-
- protected OrmIdClassReference buildIdClassReference() {
- return new GenericOrmIdClassReference(this);
- }
-
- public JavaPersistentType getIdClass() {
- return this.idClassReference.getIdClass();
- }
-
- public XmlIdClassContainer getXmlIdClassContainer() {
- return this.getXmlTypeMapping();
- }
-
- public JavaIdClassReference getJavaIdClassReferenceForDefaults() {
- JavaMappedSuperclass javaMappedSuperclass = this.getJavaTypeMappingForDefaults();
- return (javaMappedSuperclass == null) ? null : javaMappedSuperclass.getIdClassReference();
- }
-
-
+
+
// ********** entity mappings **********
-
+
public int getXmlSequence() {
return 0;
}
-
+
public void addXmlTypeMappingTo(XmlEntityMappings entityMappings) {
entityMappings.getMappedSuperclasses().add(this.xmlTypeMapping);
}
-
+
public void removeXmlTypeMappingFrom(XmlEntityMappings entityMappings) {
entityMappings.getMappedSuperclasses().remove(this.xmlTypeMapping);
}
-
-
+
+
// ********** Java **********
-
+
@Override
public JavaMappedSuperclass getJavaTypeMapping() {
return (JavaMappedSuperclass) super.getJavaTypeMapping();
}
-
+
@Override
public JavaMappedSuperclass getJavaTypeMappingForDefaults() {
return (JavaMappedSuperclass) super.getJavaTypeMappingForDefaults();
}
-
-
+
+
// ********** tables **********
-
+
public Iterable<Table> getAssociatedTables() {
return EmptyIterable.instance();
}
-
+
public Iterable<Table> getAllAssociatedTables() {
return EmptyIterable.instance();
}
-
+
public Iterable<String> getAllAssociatedTableNames() {
return EmptyIterable.instance();
}
-
+
public boolean tableNameIsInvalid(String tableName) {
return false;
}
-
-
+
+
// ********** queries **********
-
+
public Iterable<Query> getQueries() {
// the orm.xml mapped superclass does NOT have queries(!)
return EmptyIterable.instance();
}
-
-
+
+
// ********** refactoring **********
-
+
@Override
@SuppressWarnings("unchecked")
public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
@@ -159,11 +109,11 @@ public abstract class AbstractOrmMappedSuperclass<X extends XmlMappedSuperclass>
this.createIdClassReplaceTypeEdits(originalType, newName)
);
}
-
+
protected Iterable<ReplaceEdit> createIdClassReplaceTypeEdits(IType originalType, String newName) {
return this.idClassReference.createRenameTypeEdits(originalType, newName);
}
-
+
@Override
@SuppressWarnings("unchecked")
public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
@@ -172,11 +122,11 @@ public abstract class AbstractOrmMappedSuperclass<X extends XmlMappedSuperclass>
this.createIdClassMoveTypeEdits(originalType, newPackage)
);
}
-
+
protected Iterable<ReplaceEdit> createIdClassMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
return this.idClassReference.createMoveTypeEdits(originalType, newPackage);
}
-
+
@Override
@SuppressWarnings("unchecked")
public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
@@ -185,47 +135,22 @@ public abstract class AbstractOrmMappedSuperclass<X extends XmlMappedSuperclass>
this.createIdClassRenamePackageEdits(originalPackage, newName)
);
}
-
+
protected Iterable<ReplaceEdit> createIdClassRenamePackageEdits(IPackageFragment originalPackage, String newName) {
return this.idClassReference.createRenamePackageEdits(originalPackage, newName);
}
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validatePrimaryKey(messages, reporter);
- this.idClassReference.validate(messages, reporter);
- }
-
+
+
+ // ***** validation *****
+
@Override
public boolean validatesAgainstDatabase() {
return false;
}
-
- protected void validatePrimaryKey(List<IMessage> messages, IReporter reporter) {
- this.buildPrimaryKeyValidator().validate(messages, reporter);
- }
-
+
+ @Override
protected JpaValidator buildPrimaryKeyValidator() {
return new GenericMappedSuperclassPrimaryKeyValidator(this);
// TODO - JPA 2.0 validation
}
-
- // ********** completion proposals **********
-
- @Override
- public Iterable<String> getCompletionProposals(int pos) {
- Iterable<String> result = super.getCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- result = this.idClassReference.getCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- return null;
- }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTypeMapping.java
index 7e62a933b8..1ffaceb0e1 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTypeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTypeMapping.java
@@ -18,13 +18,12 @@ import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.internal.iterable.FilteringIterable;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
+import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.SpecifiedColumn;
import org.eclipse.jpt.jpa.core.context.SpecifiedRelationship;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
@@ -45,19 +44,19 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
* <code>orm.xml</code> type mapping
*/
public abstract class AbstractOrmTypeMapping<X extends XmlTypeMapping>
- extends AbstractOrmXmlContextModel<OrmPersistentType>
- implements OrmTypeMapping
-{
+ extends AbstractOrmXmlContextModel<OrmPersistentType>
+ implements OrmTypeMapping {
+
// never null
protected final X xmlTypeMapping;
-
+
protected Boolean specifiedMetadataComplete;
protected boolean overrideMetadataComplete;
-
+
protected String specifiedParentClass;
protected String defaultParentClass;
protected String fullyQualifiedParentClass;
-
+
protected AbstractOrmTypeMapping(OrmPersistentType parent, X xmlTypeMapping) {
super(parent);
this.xmlTypeMapping = xmlTypeMapping;
@@ -71,19 +70,19 @@ public abstract class AbstractOrmTypeMapping<X extends XmlTypeMapping>
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
- this.setSpecifiedMetadataComplete_(this.xmlTypeMapping.getMetadataComplete());
- this.setSpecifiedParentClass_(this.buildSpecifiedParentClass());
+ setSpecifiedMetadataComplete_(xmlTypeMapping.getMetadataComplete());
+ setSpecifiedParentClass_(buildSpecifiedParentClass());
}
-
+
@Override
public void update() {
super.update();
- this.setOverrideMetadataComplete(this.buildOverrideMetadataComplete());
- this.setDefaultParentClass(this.buildDefaultParentClass());
- this.setFullyQualifiedParentClass(this.buildFullyQualifiedParentClass());
+ setOverrideMetadataComplete(buildOverrideMetadataComplete());
+ setDefaultParentClass(buildDefaultParentClass());
+ setFullyQualifiedParentClass(buildFullyQualifiedParentClass());
}
-
-
+
+
// ********** metadata complete **********
/**
@@ -216,8 +215,8 @@ public abstract class AbstractOrmTypeMapping<X extends XmlTypeMapping>
public JavaTypeMapping getJavaTypeMappingForDefaults() {
return this.isMetadataComplete() ? null : this.getJavaTypeMapping();
}
-
-
+
+
// ********** misc **********
public OrmPersistentType getPersistentType() {
@@ -261,7 +260,7 @@ public abstract class AbstractOrmTypeMapping<X extends XmlTypeMapping>
public boolean attributeIsDerivedId(String attributeName) {
return TypeMappingTools.attributeIsDerivedId(this, attributeName);
}
-
+
@Override
public void toString(StringBuilder sb) {
sb.append(this.getPersistentType().getName());
@@ -288,117 +287,92 @@ public abstract class AbstractOrmTypeMapping<X extends XmlTypeMapping>
// ********** attribute mappings **********
-
+
public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
return true;
}
-
+
public Iterable<AttributeMapping> getAttributeMappings() {
- return IterableTools.transform(this.getPersistentType().getAttributes(), OrmPersistentAttribute.MAPPING_TRANSFORMER);
+ return IterableTools.transform(getPersistentType().getAttributes(), OrmPersistentAttribute.MAPPING_TRANSFORMER);
}
-
+
public Iterable<AttributeMapping> getAllAttributeMappings() {
- return IterableTools.children(this.getInheritanceHierarchy(), TypeMappingTools.ATTRIBUTE_MAPPINGS_TRANSFORMER);
+ return IterableTools.transform(getPersistentType().getAllAttributes(), PersistentAttribute.MAPPING_TRANSFORMER);
}
-
+
public Iterable<String> getOverridableAttributeNames() {
- return IterableTools.children(this.getAttributeMappings(), AttributeMapping.ALL_OVERRIDABLE_ATTRIBUTE_MAPPING_NAMES_TRANSFORMER);
+ return IterableTools.children(getAttributeMappings(), AttributeMapping.ALL_OVERRIDABLE_ATTRIBUTE_MAPPING_NAMES_TRANSFORMER);
}
-
+
public Iterable<String> getAllOverridableAttributeNames() {
- return IterableTools.children(this.getInheritanceHierarchy(), TypeMappingTools.OVERRIDABLE_ATTRIBUTE_NAMES_TRANSFORMER);
+ return IterableTools.children(getInheritanceHierarchy(), TypeMappingTools.OVERRIDABLE_ATTRIBUTE_NAMES_TRANSFORMER);
}
-
+
public Iterable<AttributeMapping> getAttributeMappings(final String mappingKey) {
- return IterableTools.filter(this.getAttributeMappings(), new AttributeMapping.KeyEquals(mappingKey));
+ return IterableTools.filter(getAttributeMappings(), new AttributeMapping.KeyEquals(mappingKey));
}
-
+
public Iterable<AttributeMapping> getAllAttributeMappings(final String mappingKey) {
- return IterableTools.filter(this.getAllAttributeMappings(), new AttributeMapping.KeyEquals(mappingKey));
+ return IterableTools.filter(getAllAttributeMappings(), new AttributeMapping.KeyEquals(mappingKey));
}
-
+
public Iterable<AttributeMapping> getNonTransientAttributeMappings() {
- return new FilteringIterable<AttributeMapping>(this.getAllAttributeMappings(), AttributeMapping.IS_NOT_TRANSIENT);
+ return new FilteringIterable<AttributeMapping>(getAllAttributeMappings(), AttributeMapping.IS_NOT_TRANSIENT);
}
-
+
+ public Iterable<AttributeMapping> getIdAttributeMappings() {
+ return IterableTools.filter(getAllAttributeMappings(), new IdTypeMapping.MappingIsIdMapping());
+ }
+
+ public AttributeMapping getIdAttributeMapping() {
+ Iterable<AttributeMapping> idMappings = getIdAttributeMappings();
+ if (IterableTools.size(idMappings) == 1) {
+ return IterableTools.get(idMappings, 0);
+ }
+ return null;
+ }
+
public SpecifiedColumn resolveOverriddenColumn(String attributeName) {
- for (AttributeMapping attributeMapping : this.getAttributeMappings()) {
+ for (AttributeMapping attributeMapping : getAttributeMappings()) {
SpecifiedColumn column = attributeMapping.resolveOverriddenColumn(attributeName);
if (column != null) {
return column;
}
}
- if ( ! this.isMetadataComplete()) {
- JavaPersistentType javaPersistentType = this.getJavaPersistentType();
+ if ( ! isMetadataComplete()) {
+ JavaPersistentType javaPersistentType = getJavaPersistentType();
if (javaPersistentType != null) {
return javaPersistentType.getMapping().resolveOverriddenColumn(attributeName);
}
}
return null;
}
-
+
public Iterable<String> getOverridableAssociationNames() {
- return IterableTools.children(this.getAttributeMappings(), AttributeMapping.ALL_OVERRIDABLE_ASSOCIATION_MAPPING_NAMES_TRANSFORMER);
+ return IterableTools.children(getAttributeMappings(), AttributeMapping.ALL_OVERRIDABLE_ASSOCIATION_MAPPING_NAMES_TRANSFORMER);
}
-
+
public Iterable<String> getAllOverridableAssociationNames() {
- return IterableTools.children(this.getInheritanceHierarchy(), TypeMappingTools.OVERRIDABLE_ASSOCIATION_NAMES_TRANSFORMER);
+ return IterableTools.children(getInheritanceHierarchy(), TypeMappingTools.OVERRIDABLE_ASSOCIATION_NAMES_TRANSFORMER);
}
-
+
public SpecifiedRelationship resolveOverriddenRelationship(String attributeName) {
- for (AttributeMapping attributeMapping : this.getAttributeMappings()) {
+ for (AttributeMapping attributeMapping : getAttributeMappings()) {
SpecifiedRelationship relationship = attributeMapping.resolveOverriddenRelationship(attributeName);
if (relationship != null) {
return relationship;
}
}
- if ( ! this.isMetadataComplete()) {
- JavaPersistentType javaPersistentType = this.getJavaPersistentType();
+ if ( ! isMetadataComplete()) {
+ JavaPersistentType javaPersistentType = getJavaPersistentType();
if (javaPersistentType != null) {
return javaPersistentType.getMapping().resolveOverriddenRelationship(attributeName);
}
}
return null;
}
-
-
- // ********** inheritance hierarchy **********
-
- public TypeMapping getSuperTypeMapping() {
- PersistentType superPersistentType = this.getPersistentType().getSuperPersistentType();
- return (superPersistentType == null) ? null : superPersistentType.getMapping();
- }
-
- public Iterable<TypeMapping> getInheritanceHierarchy() {
- return this.convertToMappings(this.getPersistentType().getInheritanceHierarchy());
- }
-
- /**
- * Return the type mapping's "persistence" ancestors,
- * <em>excluding</em> the type mapping itself.
- * The returned iterator will return elements infinitely if the hierarchy
- * has a loop.
- */
- protected Iterable<TypeMapping> getAncestors() {
- return this.convertToMappings(this.getPersistentType().getAncestors());
- }
-
- protected Iterable<TypeMapping> convertToMappings(Iterable<PersistentType> types) {
- return IterableTools.transform(types, PersistentType.MAPPING_TRANSFORMER);
- }
-
- public InheritanceType getInheritanceStrategy() {
- return null;
- }
-
- public boolean isRootEntity() {
- return false;
- }
-
- public Entity getRootEntity() {
- return null;
- }
-
+
+
// ********** text ranges **********
public TextRange getSelectionTextRange() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/GenericOrmIdClassReference.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/GenericOrmIdClassReference.java
index c6a72fe292..4b6fab8204 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/GenericOrmIdClassReference.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/GenericOrmIdClassReference.java
@@ -12,8 +12,8 @@ package org.eclipse.jpt.jpa.core.internal.context.orm;
import java.util.List;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.TypeTools;
import org.eclipse.jpt.common.core.internal.utility.JavaProjectTools;
+import org.eclipse.jpt.common.core.internal.utility.TypeTools;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.AstNodeType;
import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -21,6 +21,7 @@ import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.jpa.core.context.AccessType;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaIdClassReference;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
@@ -41,9 +42,9 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
* <code>orm.xml</code> ID class reference
*/
public class GenericOrmIdClassReference
- extends AbstractOrmXmlContextModel<OrmIdTypeMapping>
- implements OrmIdClassReference, PersistentType.Parent
-{
+ extends AbstractOrmXmlContextModel<OrmIdTypeMapping>
+ implements OrmIdClassReference, PersistentType.Parent {
+
protected String specifiedIdClassName;
protected String defaultIdClassName;
protected String fullyQualifiedIdClassName;
@@ -147,7 +148,11 @@ public class GenericOrmIdClassReference
protected String buildDefaultIdClassName() {
JavaIdClassReference javaRef = this.parent.getJavaIdClassReferenceForDefaults();
- return (javaRef == null) ? null : javaRef.getFullyQualifiedIdClassName();
+ if (javaRef != null && javaRef.isSpecified()) {
+ return javaRef.getFullyQualifiedIdClassName();
+ }
+ IdTypeMapping superType = getParent().getSuperTypeMapping();
+ return (superType == null) ? null : superType.getIdClassReference().getFullyQualifiedIdClassName();
}
public boolean isSpecified() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java
index f9bb8d1d62..363f4e14a6 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java
@@ -44,6 +44,7 @@ import org.eclipse.jpt.jpa.core.JpaStructureNode;
import org.eclipse.jpt.jpa.core.context.AccessType;
import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
import org.eclipse.jpt.jpa.core.context.PersistentType;
+import org.eclipse.jpt.jpa.core.context.TypeMapping;
import org.eclipse.jpt.jpa.core.context.TypeRefactoringParticipant;
import org.eclipse.jpt.jpa.core.context.java.JavaManagedType;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
@@ -91,9 +92,7 @@ public abstract class SpecifiedOrmPersistentType
protected final SpecifiedAttributeContainerAdapter specifiedAttributeContainerAdapter = new SpecifiedAttributeContainerAdapter();
protected final Vector<OrmPersistentAttribute> defaultAttributes = new Vector<OrmPersistentAttribute>();
-
- protected PersistentType superPersistentType;
-
+
protected String declaringTypeName;
protected final MetamodelSourceType2_0.Synchronizer metamodelSynchronizer;
@@ -130,7 +129,6 @@ public abstract class SpecifiedOrmPersistentType
this.setDefaultAccess(this.buildDefaultAccess());
this.updateModels(this.getSpecifiedAttributes());
this.updateDefaultAttributes();
- this.setSuperPersistentType(this.buildSuperPersistentType());
this.setDeclaringTypeName(this.buildDeclaringTypeName());
this.updateStructureChildren();
}
@@ -236,8 +234,8 @@ public abstract class SpecifiedOrmPersistentType
return this.getJavaPersistentType().getAccess();
}
}
- if (this.superPersistentType != null) {
- return this.superPersistentType.getAccess();
+ if (getSuperPersistentType() != null) {
+ return getSuperPersistentType().getAccess();
}
}
AccessType access = this.getMappingFileRoot().getAccess();
@@ -292,7 +290,7 @@ public abstract class SpecifiedOrmPersistentType
return attributes.hasNext() ? null /* more than one */: attribute;
}
// recurse
- return (this.superPersistentType == null) ? null : this.superPersistentType.resolveAttribute(attributeName);
+ return (getSuperPersistentType() == null) ? null : getSuperPersistentType().resolveAttribute(attributeName);
}
protected Iterable<String> convertToNames(Iterable<? extends PersistentAttribute> attributes) {
@@ -907,52 +905,24 @@ public abstract class SpecifiedOrmPersistentType
defaultAttribute.dispose();
this.removeItemFromList(defaultAttribute, this.defaultAttributes, DEFAULT_ATTRIBUTES_LIST);
}
-
-
- // ********** super persistent type **********
-
+
+
+ // ***** inheritance *****
+
public PersistentType getSuperPersistentType() {
- return this.superPersistentType;
- }
-
- protected void setSuperPersistentType(PersistentType persistentType) {
- PersistentType old = this.superPersistentType;
- this.superPersistentType = persistentType;
- this.firePropertyChanged(SUPER_PERSISTENT_TYPE_PROPERTY, old, persistentType);
- }
-
- protected PersistentType buildSuperPersistentType() {
- PersistentType spt = this.buildSuperPersistentType_();
- if (spt == null) {
- return null;
- }
- // check for circular inheritance
- return IterableTools.contains(spt.getInheritanceHierarchy(), this) ? null : spt;
+ TypeMapping superTypeMapping = this.mapping.getSuperTypeMapping();
+ return (superTypeMapping == null) ? null : superTypeMapping.getPersistentType();
}
-
- protected PersistentType buildSuperPersistentType_() {
- return (this.getJavaPersistentType() == null) ? null : this.getJavaPersistentType().getSuperPersistentType();
- }
-
-
- // ********** inheritance **********
-
+
public Iterable<PersistentType> getInheritanceHierarchy() {
- return this.buildInheritanceHierarchy(this);
+ return IterableTools.insert(this, getAncestors());
}
-
+
public Iterable<PersistentType> getAncestors() {
- return (this.superPersistentType == null) ?
- IterableTools.<PersistentType>emptyIterable() :
- this.buildInheritanceHierarchy(this.superPersistentType);
- }
-
- protected Iterable<PersistentType> buildInheritanceHierarchy(PersistentType start) {
- // using a chain iterable to traverse up the inheritance tree
- return ObjectTools.chain(start, SUPER_PERSISTENT_TYPE_TRANSFORMER);
+ return IterableTools.transform(getMapping().getAncestors(), TypeMapping.PERSISTENT_TYPE_TRANSFORMER);
}
-
-
+
+
// ********** declaring type name **********
public String getDeclaringTypeName() {
@@ -1102,8 +1072,8 @@ public abstract class SpecifiedOrmPersistentType
return this.specifiedAccess;
}
- if (this.superPersistentType instanceof OrmPersistentType) {
- AccessType accessType = ((OrmPersistentType) this.superPersistentType).getSpecifiedAccess();
+ if (getSuperPersistentType() instanceof OrmPersistentType) {
+ AccessType accessType = ((OrmPersistentType) getSuperPersistentType()).getSpecifiedAccess();
if (accessType != null) {
return accessType;
}
@@ -1121,8 +1091,8 @@ public abstract class SpecifiedOrmPersistentType
}
public AccessType getDefaultPersistentTypeAccess() {
- if (this.superPersistentType instanceof OrmPersistentType) {
- AccessType accessType = ((OrmPersistentType) this.superPersistentType).getDefaultAccess();
+ if (getSuperPersistentType() instanceof OrmPersistentType) {
+ AccessType accessType = ((OrmPersistentType) getSuperPersistentType()).getDefaultAccess();
if (accessType != null) {
return accessType;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java
index 219c0663d7..7d2742cdda 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java
@@ -61,6 +61,7 @@ import org.eclipse.jpt.jpa.core.context.DeleteTypeRefactoringParticipant;
import org.eclipse.jpt.jpa.core.context.Embeddable;
import org.eclipse.jpt.jpa.core.context.Entity;
import org.eclipse.jpt.jpa.core.context.Generator;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.JpaNamedContextModel;
import org.eclipse.jpt.jpa.core.context.ManagedType;
import org.eclipse.jpt.jpa.core.context.ManagedTypeContainer;
@@ -1940,13 +1941,18 @@ public abstract class AbstractPersistenceUnit
TypeMapping typeMapping = this.getTypeMapping(typeName);
return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null;
}
-
+
+ public IdTypeMapping getIdTypeMapping(String typeName) {
+ TypeMapping typeMapping = this.getTypeMapping(typeName);
+ return (typeMapping instanceof IdTypeMapping) ? (IdTypeMapping) typeMapping : null;
+ }
+
// TODO bjv - this should probably *not* return Java type mappings when PU is "metadata complete"...
protected TypeMapping getTypeMapping(String typeName) {
PersistentType persistentType = this.getPersistentType(typeName);
return (persistentType == null) ? null : persistentType.getMapping();
}
-
+
public Iterable<Entity> getEntities() {
return this.filterToEntities(this.getTypeMappings());
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/AbstractPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/AbstractPrimaryKeyValidator.java
index e14169805b..9fcec8c2a5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/AbstractPrimaryKeyValidator.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/AbstractPrimaryKeyValidator.java
@@ -20,8 +20,6 @@ import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.common.utility.internal.collection.HashBag;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterable.SubIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.predicate.PredicateAdapter;
-import org.eclipse.jpt.common.utility.predicate.Predicate;
import org.eclipse.jpt.jpa.core.MappingKeys;
import org.eclipse.jpt.jpa.core.context.AccessType;
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
@@ -419,8 +417,8 @@ public abstract class AbstractPrimaryKeyValidator
/**
* Return whether an ancestor class has defined any aspect of the primary key
*/
- protected boolean definesPrimaryKeyOnAncestor(TypeMapping typeMapping) {
- for (TypeMapping each : typeMapping.getInheritanceHierarchy()) {
+ protected boolean definesPrimaryKeyOnAncestor(IdTypeMapping typeMapping) {
+ for (IdTypeMapping each : typeMapping.getInheritanceHierarchy()) {
if (each != typeMapping && definesPrimaryKey(each)) {
return true;
}
@@ -431,7 +429,7 @@ public abstract class AbstractPrimaryKeyValidator
/**
* Return whether the type mapping has defined any aspect of the primary key
*/
- protected boolean definesPrimaryKey(TypeMapping typeMapping) {
+ protected boolean definesPrimaryKey(IdTypeMapping typeMapping) {
return getIdClass(typeMapping) != null
|| ! IterableTools.isEmpty(getPrimaryKeyMappings(typeMapping));
}
@@ -439,7 +437,7 @@ public abstract class AbstractPrimaryKeyValidator
/**
* Return true if the type mapping has defined any aspect of a complex primary key
*/
- protected boolean definesComplexPrimaryKey(TypeMapping typeMapping) {
+ protected boolean definesComplexPrimaryKey(IdTypeMapping typeMapping) {
return definesIdClass(typeMapping)
|| getEmbeddedIdMapping(typeMapping) != null;
}
@@ -453,7 +451,7 @@ public abstract class AbstractPrimaryKeyValidator
* - null if none of the above are coherent (i.e. there are multiple possibilities, or the
* primary key is invalid)
*/
- protected String getPrimaryKeyTypeName(TypeMapping typeMapping) {
+ protected String getPrimaryKeyTypeName(IdTypeMapping typeMapping) {
JavaPersistentType idClass = getIdClass(typeMapping);
if (idClass != null) {
return idClass.getName();
@@ -519,15 +517,15 @@ public abstract class AbstractPrimaryKeyValidator
* NOTE: this is different from whether an id class is *specified*. If a specified id class
* is not resolved, it is not defined. There will be a validation error to that effect.
*/
- protected boolean definesIdClass(TypeMapping typeMapping) {
+ protected boolean definesIdClass(IdTypeMapping typeMapping) {
return getIdClass(typeMapping) != null;
}
/**
* Return whether an ancestor class has defined an id class
*/
- protected boolean definesIdClassOnAncestor(TypeMapping typeMapping) {
- for (TypeMapping each : typeMapping.getInheritanceHierarchy()) {
+ protected boolean definesIdClassOnAncestor(IdTypeMapping typeMapping) {
+ for (IdTypeMapping each : typeMapping.getInheritanceHierarchy()) {
if (each != typeMapping && definesIdClass(each)) {
return true;
}
@@ -539,10 +537,10 @@ public abstract class AbstractPrimaryKeyValidator
* Return the id class to be used for the type mapping, whether that be locally
* or on an ancestor
*/
- protected JavaPersistentType getIdClass(TypeMapping typeMapping) {
- for (TypeMapping each : typeMapping.getInheritanceHierarchy()) {
- if (each.getIdClass() != null) {
- return each.getIdClass();
+ protected JavaPersistentType getIdClass(IdTypeMapping typeMapping) {
+ for (IdTypeMapping each : typeMapping.getInheritanceHierarchy()) {
+ if (each.getIdClassReference().getIdClass() != null) {
+ return each.getIdClassReference().getIdClass();
}
}
return null;
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaMapsIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaMapsIdDerivedIdentityStrategy2_0.java
index a6d11cb8ee..931197e521 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaMapsIdDerivedIdentityStrategy2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaMapsIdDerivedIdentityStrategy2_0.java
@@ -9,7 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.jpa.core.internal.jpa2.context.java;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.common.core.utility.TextRange;
@@ -20,12 +19,12 @@ import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterable.SingleElementIterable;
import org.eclipse.jpt.common.utility.internal.iterable.TransformationIterable;
-import org.eclipse.jpt.common.utility.internal.predicate.PredicateAdapter;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.jpa.core.MappingKeys;
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
import org.eclipse.jpt.jpa.core.context.Embeddable;
import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
+import org.eclipse.jpt.jpa.core.context.Entity;
import org.eclipse.jpt.jpa.core.context.SpecifiedPersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute;
import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaContextModel;
@@ -40,159 +39,178 @@ import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
public class GenericJavaMapsIdDerivedIdentityStrategy2_0
- extends AbstractJavaContextModel<JavaDerivedIdentity2_0>
- implements MapsIdDerivedIdentityStrategy2_0
-{
+ extends AbstractJavaContextModel<JavaDerivedIdentity2_0>
+ implements MapsIdDerivedIdentityStrategy2_0 {
+
protected String specifiedIdAttributeName;
+
protected String defaultIdAttributeName;
-
-
+
+
public GenericJavaMapsIdDerivedIdentityStrategy2_0(JavaDerivedIdentity2_0 parent) {
super(parent);
- this.specifiedIdAttributeName = this.buildSpecifiedIdAttributeName();
+ this.specifiedIdAttributeName = buildSpecifiedIdAttributeName();
}
-
-
+
+
// ********** synchronize/update **********
-
+
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
- this.setSpecifiedIdAttributeName_(this.buildSpecifiedIdAttributeName());
+ setSpecifiedIdAttributeName_(buildSpecifiedIdAttributeName());
}
-
+
@Override
public void update() {
super.update();
- this.setDefaultIdAttributeName(this.buildDefaultIdAttributeName());
+ setDefaultIdAttributeName(buildDefaultIdAttributeName());
}
-
-
+
+
// ********** ID attribute name **********
-
+
public String getIdAttributeName() {
return (this.specifiedIdAttributeName != null) ? this.specifiedIdAttributeName : this.defaultIdAttributeName;
}
-
+
public String getSpecifiedIdAttributeName() {
return this.specifiedIdAttributeName;
}
-
+
public void setSpecifiedIdAttributeName(String idAttributeName) {
if (ObjectTools.notEquals(idAttributeName, this.specifiedIdAttributeName)) {
- this.getAnnotation().setValue(idAttributeName);
- this.setSpecifiedIdAttributeName_(idAttributeName);
+ getAnnotation().setValue(idAttributeName);
+ setSpecifiedIdAttributeName_(idAttributeName);
}
}
-
+
protected void setSpecifiedIdAttributeName_(String idAttributeName) {
String old = this.specifiedIdAttributeName;
this.specifiedIdAttributeName = idAttributeName;
- this.firePropertyChanged(SPECIFIED_ID_ATTRIBUTE_NAME_PROPERTY, old, idAttributeName);
+ firePropertyChanged(SPECIFIED_ID_ATTRIBUTE_NAME_PROPERTY, old, idAttributeName);
}
-
+
protected String buildSpecifiedIdAttributeName() {
- return this.getAnnotation().getValue();
+ return getAnnotation().getValue();
}
-
+
public String getDefaultIdAttributeName() {
return this.defaultIdAttributeName;
}
-
+
protected void setDefaultIdAttributeName(String idAttributeName) {
String old = this.defaultIdAttributeName;
this.defaultIdAttributeName = idAttributeName;
- this.firePropertyChanged(DEFAULT_ID_ATTRIBUTE_NAME_PROPERTY, old, idAttributeName);
+ firePropertyChanged(DEFAULT_ID_ATTRIBUTE_NAME_PROPERTY, old, idAttributeName);
}
-
+
protected String buildDefaultIdAttributeName() {
- Iterator<AttributeMapping> stream = this.getIdAttributeMappings().iterator();
- if (stream.hasNext()) {
- AttributeMapping mapping = stream.next();
- // return null if we have more than one id mapping
- return stream.hasNext() ? null : mapping.getName();
+ AttributeMapping mapping = getPersistentAttribute().getDeclaringTypeMapping().getIdAttributeMapping();
+ if (mapping == null) {
+ return null;
+ }
+
+ // if id mapping is embedded id ...
+ if (ObjectTools.equals(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, mapping.getKey())) {
+ // ... if embedded id and target entity have same primary key return embedded id name
+ EmbeddedIdMapping embeddedId = (EmbeddedIdMapping) mapping;
+ Entity targetEntity = getMapping().getResolvedTargetEntity();
+ if (targetEntity != null &&
+ ObjectTools.equals(embeddedId.getTargetEmbeddableName(), targetEntity.getPrimaryKeyClassName())) {
+ return embeddedId.getName();
+ }
+ // ... otherwise use name of the mapping itself
+ else {
+ return getMapping().getName();
+ }
}
+ // if id mapping is simple id, return its name
+ else if (ObjectTools.equals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, mapping.getKey())) {
+ return mapping.getName();
+ }
+
return null; // empty
}
-
+
public boolean defaultIdAttributeNameIsPossible() {
return true;
}
-
-
+
+
// ********** annotation **********
-
+
/**
* Do <em>not</em> return <code>null</code>.
*/
protected MapsIdAnnotation2_0 getAnnotation() {
- return (MapsIdAnnotation2_0) this.getResourceAttribute().getNonNullAnnotation(this.getAnnotationName());
+ return (MapsIdAnnotation2_0) getResourceAttribute().getNonNullAnnotation(getAnnotationName());
}
-
+
/**
* Return <code>null</code> if the annotation is not present.
*/
protected MapsIdAnnotation2_0 getAnnotationOrNull() {
- return (MapsIdAnnotation2_0) this.getResourceAttribute().getAnnotation(this.getAnnotationName());
+ return (MapsIdAnnotation2_0) getResourceAttribute().getAnnotation(getAnnotationName());
}
-
+
protected void addAnnotation() {
- this.getResourceAttribute().addAnnotation(this.getAnnotationName());
+ getResourceAttribute().addAnnotation(getAnnotationName());
}
-
+
protected void removeAnnotation() {
- this.getResourceAttribute().removeAnnotation(this.getAnnotationName());
+ getResourceAttribute().removeAnnotation(getAnnotationName());
}
-
+
protected String getAnnotationName() {
return MapsIdAnnotation2_0.ANNOTATION_NAME;
}
-
-
+
+
// ********** misc **********
-
+
protected JavaDerivedIdentity2_0 getDerivedIdentity() {
return this.parent;
}
-
+
protected JavaSingleRelationshipMapping2_0 getMapping() {
- return this.getDerivedIdentity().getMapping();
+ return getDerivedIdentity().getMapping();
}
-
+
protected JavaSpecifiedPersistentAttribute getPersistentAttribute() {
- return this.getMapping().getPersistentAttribute();
+ return getMapping().getPersistentAttribute();
}
-
+
protected JavaResourceAttribute getResourceAttribute() {
- return this.getPersistentAttribute().getResourceAttribute();
+ return getPersistentAttribute().getResourceAttribute();
}
-
+
protected Iterable<AttributeMapping> getAllAttributeMappings() {
- return this.getPersistentAttribute().getDeclaringTypeMapping().getAllAttributeMappings();
+ return getPersistentAttribute().getDeclaringTypeMapping().getAllAttributeMappings();
}
-
+
public Iterable<String> getSortedCandidateIdAttributeNames() {
- return IterableTools.sort(this.getAllAttributeMappingChoiceNames());
+ return IterableTools.sort(getAllAttributeMappingChoiceNames());
}
-
+
protected Iterable<String> getAllAttributeMappingChoiceNames() {
- return IterableTools.transform(this.getAllAttributeMappingChoices(), AttributeMapping.NAME_TRANSFORMER);
+ return IterableTools.transform(getAllAttributeMappingChoices(), AttributeMapping.NAME_TRANSFORMER);
}
-
+
protected Iterable<AttributeMapping> getAllAttributeMappingChoices() {
- return this.buildAttributeMappingChoices(this.getAllAttributeMappings());
+ return buildAttributeMappingChoices(getAllAttributeMappings());
}
-
+
/**
* @see #getEmbeddedIdMappingChoiceIterable(EmbeddedIdMapping)
*/
protected Iterable<AttributeMapping> buildAttributeMappingChoices(Iterable<AttributeMapping> attributeMappings) {
return IterableTools.children(attributeMappings, new AttributeMappingTransformer());
}
-
+
public class AttributeMappingTransformer
- extends TransformerAdapter<AttributeMapping, Iterable<AttributeMapping>>
- {
+ extends TransformerAdapter<AttributeMapping, Iterable<AttributeMapping>> {
+
@Override
public Iterable<AttributeMapping> transform(AttributeMapping mapping) {
return (ObjectTools.equals(mapping.getKey(), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY)) ?
@@ -200,7 +218,7 @@ public class GenericJavaMapsIdDerivedIdentityStrategy2_0
new SingleElementIterable<AttributeMapping>(mapping);
}
}
-
+
/**
* Convert the specified mapping into a collection of its "mappings".
* Typically, this collection will include just the mapping itself;
@@ -217,11 +235,11 @@ public class GenericJavaMapsIdDerivedIdentityStrategy2_0
embeddable.getAllAttributeMappings()
);
}
-
+
public AttributeMapping getDerivedIdAttributeMapping() {
- String idAttributeName = this.getIdAttributeName();
+ String idAttributeName = getIdAttributeName();
if (idAttributeName != null) {
- for (AttributeMapping mapping : this.getAllAttributeMappingChoices()) {
+ for (AttributeMapping mapping : getAllAttributeMappingChoices()) {
if (idAttributeName.equals(mapping.getName())) {
return mapping;
}
@@ -229,113 +247,82 @@ public class GenericJavaMapsIdDerivedIdentityStrategy2_0
}
return null;
}
-
+
public boolean isSpecified() {
- return this.getAnnotationOrNull() != null;
+ return getAnnotationOrNull() != null;
}
-
+
public void addStrategy() {
- if (this.getAnnotationOrNull() == null) {
- this.addAnnotation();
+ if (getAnnotationOrNull() == null) {
+ addAnnotation();
}
}
-
+
public void removeStrategy() {
- if (this.getAnnotationOrNull() != null) {
- this.removeAnnotation();
+ if (getAnnotationOrNull() != null) {
+ removeAnnotation();
}
}
-
-
+
+
// ********** Java completion proposals **********
-
+
@Override
public Iterable<String> getCompletionProposals(int pos) {
Iterable<String> result = super.getCompletionProposals(pos);
if (result != null) {
return result;
}
- if (this.getAnnotation().valueTouches(pos)) {
- result = this.getSortedJavaValueChoices();
+ if (getAnnotation().valueTouches(pos)) {
+ result = getSortedJavaValueChoices();
}
return result;
}
-
+
protected Iterable<String> getSortedJavaValueChoices() {
- return new TransformationIterable<String, String>(this.getSortedCandidateIdAttributeNames(),
+ return new TransformationIterable<String, String>(getSortedCandidateIdAttributeNames(),
StringTools.JAVA_STRING_LITERAL_CONTENT_TRANSFORMER);
}
-
-
- // ********** ID mappings **********
-
- protected Iterable<AttributeMapping> getIdAttributeMappings() {
- return IterableTools.filter(this.getAllAttributeMappings(), new MappingIsIdMapping());
- }
-
- public class MappingIsIdMapping
- extends PredicateAdapter<AttributeMapping>
- {
- @Override
- public boolean evaluate(AttributeMapping mapping) {
- return GenericJavaMapsIdDerivedIdentityStrategy2_0.this.mappingIsIdMapping(mapping);
- }
- }
-
- protected boolean mappingIsIdMapping(AttributeMapping mapping) {
- return IterableTools.contains(this.getIdMappingKeys(), mapping.getKey());
- }
-
- protected Iterable<String> getIdMappingKeys() {
- return ID_MAPPING_KEYS;
- }
-
- protected static final String[] ID_MAPPING_KEYS_ARRAY = new String[] {
- MappingKeys.ID_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY
- };
- protected static final Iterable<String> ID_MAPPING_KEYS = IterableTools.iterable(ID_MAPPING_KEYS_ARRAY);
-
-
+
// ********** validation **********
-
+
@Override
public void validate(List<IMessage> messages, IReporter reporter) {
super.validate(messages, reporter);
- this.validateMapsId(messages);
+ validateMapsId(messages);
}
-
+
protected void validateMapsId(List<IMessage> messages) {
- if (this.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy()) {
- this.validateMapsId_(messages);
+ if (getDerivedIdentity().usesMapsIdDerivedIdentityStrategy()) {
+ validateMapsId_(messages);
}
}
-
+
protected void validateMapsId_(List<IMessage> messages) {
// test whether id attribute name can be resolved
- AttributeMapping attributeMapping = this.getDerivedIdAttributeMapping();
+ AttributeMapping attributeMapping = getDerivedIdAttributeMapping();
if (attributeMapping == null) {
// if id attribute name is not specified, use that message
if (this.specifiedIdAttributeName == null) {
- messages.add(this.buildMessage(JptJpaCoreValidationMessages.MAPS_ID_VALUE_NOT_SPECIFIED));
+ messages.add(buildMessage(JptJpaCoreValidationMessages.MAPS_ID_VALUE_NOT_SPECIFIED));
} else {
- messages.add(this.buildMessage(JptJpaCoreValidationMessages.MAPS_ID_VALUE_NOT_RESOLVED, this.getIdAttributeName()));
+ messages.add(buildMessage(JptJpaCoreValidationMessages.MAPS_ID_VALUE_NOT_RESOLVED, getIdAttributeName()));
}
} else {
// test whether attribute mapping is allowable
- if ( ! IterableTools.contains(this.getValidAttributeMappingChoices(), attributeMapping)) {
- messages.add(this.buildMessage(JptJpaCoreValidationMessages.MAPS_ID_VALUE_INVALID, this.getIdAttributeName()));
+ if ( ! IterableTools.contains(getValidAttributeMappingChoices(), attributeMapping)) {
+ messages.add(buildMessage(JptJpaCoreValidationMessages.MAPS_ID_VALUE_INVALID, getIdAttributeName()));
}
}
}
-
+
protected Iterable<AttributeMapping> getValidAttributeMappingChoices() {
- return this.buildAttributeMappingChoices(this.getIdAttributeMappings());
+ return this.buildAttributeMappingChoices(getPersistentAttribute().getDeclaringTypeMapping().getIdAttributeMappings());
}
-
+
protected IMessage buildMessage(ValidationMessage msg, Object... args) {
- SpecifiedPersistentAttribute attribute = this.getPersistentAttribute();
+ SpecifiedPersistentAttribute attribute = getPersistentAttribute();
String attributeDescription = attribute.isVirtual() ?
JptJpaCoreValidationArgumentMessages.VIRTUAL_ATTRIBUTE_DESC :
JptJpaCoreValidationArgumentMessages.ATTRIBUTE_DESC;
@@ -343,16 +330,16 @@ public class GenericJavaMapsIdDerivedIdentityStrategy2_0
args = ArrayTools.add(args, 0, attributeDescription);
TextRange textRange = attribute.isVirtual() ?
attribute.getValidationTextRange() :
- this.getValidationTextRange();
- return this.buildValidationMessage(textRange, msg, args);
+ getValidationTextRange();
+ return buildValidationMessage(textRange, msg, args);
}
-
+
public TextRange getValidationTextRange() {
- TextRange textRange = this.getAnnotationTextRange();
- return (textRange != null) ? textRange : this.getDerivedIdentity().getValidationTextRange();
+ TextRange textRange = getAnnotationTextRange();
+ return (textRange != null) ? textRange : getDerivedIdentity().getValidationTextRange();
}
-
+
protected TextRange getAnnotationTextRange() {
- return this.getAnnotation().getTextRange();
+ return getAnnotation().getTextRange();
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java
index 5f5af98b10..8dddb4b99c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java
@@ -1991,15 +1991,15 @@ public abstract class AbstractOrmElementCollectionMapping2_0<X extends XmlElemen
}
public SpecifiedColumn resolveOverriddenColumn(String attributeName) {
- return MappingTools.resolveOverriddenColumn(this.getOverridableTypeMapping(), attributeName);
+ return MappingTools.resolveOverriddenColumn(getOverridableTypeMapping(), attributeName);
}
public JpaValidator buildOverrideValidator(Override_ override, OverrideContainer container) {
- return new AttributeOverrideValidator(this.getPersistentAttribute(), (AttributeOverride) override, (AttributeOverrideContainer) container, new EmbeddableOverrideDescriptionProvider());
+ return new AttributeOverrideValidator(getPersistentAttribute(), (AttributeOverride) override, (AttributeOverrideContainer) container, new EmbeddableOverrideDescriptionProvider());
}
public JpaValidator buildColumnValidator(Override_ override, BaseColumn column, TableColumn.ParentAdapter columnParentAdapter) {
- return new AttributeOverrideColumnValidator(this.getPersistentAttribute(), (AttributeOverride) override, column, new CollectionTableTableDescriptionProvider());
+ return new AttributeOverrideColumnValidator(getPersistentAttribute(), (AttributeOverride) override, column, new CollectionTableTableDescriptionProvider());
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java
index 4637ce4519..474c4a9a50 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmMapsIdDerivedIdentityStrategy2_0.java
@@ -16,7 +16,6 @@ import org.eclipse.jpt.common.utility.internal.ArrayTools;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterable.SingleElementIterable;
-import org.eclipse.jpt.common.utility.internal.predicate.PredicateAdapter;
import org.eclipse.jpt.common.utility.internal.transformer.TransformerAdapter;
import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.core.MappingKeys;
@@ -35,115 +34,123 @@ import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+/*
+ * Currently, it does not look as though default values (maps-id="")
+ * are supported in XML. Therefore there is only a specified value
+ * and the alternative is an error specifying the value.
+ */
public class GenericOrmMapsIdDerivedIdentityStrategy2_0
- extends AbstractOrmXmlContextModel<OrmDerivedIdentity2_0>
- implements OrmMapsIdDerivedIdentityStrategy2_0
-{
+ extends AbstractOrmXmlContextModel<OrmDerivedIdentity2_0>
+ implements OrmMapsIdDerivedIdentityStrategy2_0 {
+
protected String specifiedIdAttributeName;
- // no default
-
-
+
+
public GenericOrmMapsIdDerivedIdentityStrategy2_0(OrmDerivedIdentity2_0 parent) {
super(parent);
- this.specifiedIdAttributeName = this.getXmlMapping().getMapsId();
+ this.specifiedIdAttributeName = buildSpecifiedIdAttributeName();
}
-
-
+
+
// ********** synchronize/update **********
-
+
@Override
public void synchronizeWithResourceModel() {
super.synchronizeWithResourceModel();
- this.setSpecifiedIdAttributeName_(this.getXmlMapping().getMapsId());
+ this.setSpecifiedIdAttributeName_(buildSpecifiedIdAttributeName());
}
-
-
+
+
// ********** ID attribute name **********
-
+
public String getIdAttributeName() {
- // there is no default
return this.specifiedIdAttributeName;
}
-
+
public String getSpecifiedIdAttributeName() {
return this.specifiedIdAttributeName;
}
-
+
public void setSpecifiedIdAttributeName(String idAttributeName) {
this.setSpecifiedIdAttributeName_(idAttributeName);
this.getXmlMapping().setMapsId(idAttributeName);
}
-
+
protected void setSpecifiedIdAttributeName_(String idAttributeName) {
String old = this.specifiedIdAttributeName;
this.specifiedIdAttributeName = idAttributeName;
this.firePropertyChanged(SPECIFIED_ID_ATTRIBUTE_NAME_PROPERTY, old, idAttributeName);
}
-
+
+ protected String buildSpecifiedIdAttributeName() {
+ return getXmlMapping().getMapsId();
+ }
+
public String getDefaultIdAttributeName() {
- // there is no way to have a default in xml
+ // see class comment
return null;
}
-
+
public boolean defaultIdAttributeNameIsPossible() {
+ // see class comment
return false;
}
-
-
+
+
// ********** misc **********
-
+
protected OrmDerivedIdentity2_0 getDerivedIdentity() {
return this.parent;
}
-
+
public OrmSingleRelationshipMapping2_0 getMapping() {
return this.getDerivedIdentity().getMapping();
}
-
+
protected OrmSpecifiedPersistentAttribute getPersistentAttribute() {
return this.getMapping().getPersistentAttribute();
}
-
+
protected XmlSingleRelationshipMapping_2_0 getXmlMapping() {
return this.getMapping().getXmlAttributeMapping();
}
-
+
protected Iterable<AttributeMapping> getAllAttributeMappings() {
return this.getPersistentAttribute().getDeclaringTypeMapping().getAllAttributeMappings();
}
-
+
public Iterable<String> getSortedCandidateIdAttributeNames() {
return IterableTools.sort(this.getNonNullCandidateIdAttributeNames());
}
-
+
protected Iterable<String> getNonNullCandidateIdAttributeNames() {
return IterableTools.removeNulls(this.getCandidateIdAttributeNames());
}
-
+
protected Iterable<String> getCandidateIdAttributeNames() {
return IterableTools.transform(this.getCandidateIdAttributeMappings(), AttributeMapping.NAME_TRANSFORMER);
}
-
+
protected Iterable<AttributeMapping> getCandidateIdAttributeMappings() {
return this.buildCandidateIdAttributeMappings(this.getAllAttributeMappings());
}
-
+
protected Iterable<AttributeMapping> buildCandidateIdAttributeMappings(Iterable<AttributeMapping> attributeMappings) {
return IterableTools.children(attributeMappings, CANDIDATE_ID_ATTRIBUTE_MAPPING_LISTS_TRANSFORMER);
}
-
+
protected static final Transformer<AttributeMapping, Iterable<AttributeMapping>> CANDIDATE_ID_ATTRIBUTE_MAPPING_LISTS_TRANSFORMER = new CandidateIdAttributeMappingListsTransformer();
-
+
protected static class CandidateIdAttributeMappingListsTransformer
- extends TransformerAdapter<AttributeMapping, Iterable<AttributeMapping>>
- {
+ extends TransformerAdapter<AttributeMapping, Iterable<AttributeMapping>> {
+
@Override
public Iterable<AttributeMapping> transform(AttributeMapping attributeMapping) {
return ObjectTools.equals(attributeMapping.getKey(), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY) ?
this.getEmbeddedIdMappingChoiceIterable((EmbeddedIdMapping) attributeMapping) :
new SingleElementIterable<AttributeMapping>(attributeMapping);
}
-
+
/**
* Convert the specified mapping into a collection of its "mappings".
* Typically, this collection will include just the mapping itself;
@@ -159,7 +166,7 @@ public class GenericOrmMapsIdDerivedIdentityStrategy2_0
IterableTools.insert(mapping, embeddable.getAllAttributeMappings());
}
}
-
+
public AttributeMapping getDerivedIdAttributeMapping() {
String idAttributeName = this.getIdAttributeName();
if (idAttributeName != null) {
@@ -171,69 +178,38 @@ public class GenericOrmMapsIdDerivedIdentityStrategy2_0
}
return null;
}
-
+
public boolean isSpecified() {
return this.getXmlMapping().getMapsId() != null;
}
-
+
public void addStrategy() {
this.getXmlMapping().setMapsId(""); //$NON-NLS-1$
}
-
+
public void removeStrategy() {
this.getXmlMapping().setMapsId(null);
}
-
+
public void initializeFrom(OrmMapsIdDerivedIdentityStrategy2_0 oldStrategy) {
this.setSpecifiedIdAttributeName(oldStrategy.getSpecifiedIdAttributeName());
}
-
-
- // ********** ID mappings **********
-
- protected Iterable<AttributeMapping> getIdAttributeMappings() {
- return IterableTools.filter(this.getAllAttributeMappings(), new MappingIsIdMapping());
- }
-
- public class MappingIsIdMapping
- extends PredicateAdapter<AttributeMapping>
- {
- @Override
- public boolean evaluate(AttributeMapping mapping) {
- return GenericOrmMapsIdDerivedIdentityStrategy2_0.this.mappingIsIdMapping(mapping);
- }
- }
-
- protected boolean mappingIsIdMapping(AttributeMapping mapping) {
- return IterableTools.contains(this.getIdMappingKeys(), mapping.getKey());
- }
-
- protected Iterable<String> getIdMappingKeys() {
- return ID_MAPPING_KEYS;
- }
-
- protected static final String[] ID_MAPPING_KEYS_ARRAY = new String[] {
- MappingKeys.ID_ATTRIBUTE_MAPPING_KEY,
- MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY
- };
- protected static final Iterable<String> ID_MAPPING_KEYS = IterableTools.iterable(ID_MAPPING_KEYS_ARRAY);
-
-
+
// ********** validation **********
-
+
@Override
public void validate(List<IMessage> messages, IReporter reporter) {
super.validate(messages, reporter);
this.validateMapsId(messages);
}
-
+
protected void validateMapsId(List<IMessage> messages) {
if (this.getDerivedIdentity().usesMapsIdDerivedIdentityStrategy()) {
this.validateMapsId_(messages);
}
}
-
+
protected void validateMapsId_(List<IMessage> messages) {
// test whether id attribute name can be resolved
AttributeMapping attributeMapping = this.getDerivedIdAttributeMapping();
@@ -247,17 +223,17 @@ public class GenericOrmMapsIdDerivedIdentityStrategy2_0
}
}
}
-
+
protected Iterable<AttributeMapping> getValidAttributeMappingChoices() {
- return this.buildCandidateIdAttributeMappings(this.getIdAttributeMappings());
+ return this.buildCandidateIdAttributeMappings(getPersistentAttribute().getDeclaringTypeMapping().getIdAttributeMappings());
}
-
+
protected IMessage buildMessage(ValidationMessage msg, Object[] args) {
String attributeDescription = NLS.bind(JptJpaCoreValidationArgumentMessages.ATTRIBUTE_DESC, this.getPersistentAttribute().getName());
args = ArrayTools.add(args, 0, attributeDescription);
return this.buildValidationMessage(this.getValidationTextRange(), msg, args);
}
-
+
public TextRange getValidationTextRange() {
TextRange textRange = this.getXmlMapping().getMapsIdTextRange();
return (textRange != null) ? textRange : this.getDerivedIdentity().getValidationTextRange();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java
index 2eb269b1a3..6e01a5f77d 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,6 +10,7 @@
package org.eclipse.jpt.jpa.eclipselink.core.context;
import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
/**
@@ -20,10 +21,13 @@ import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
* stability. It is available at this early stage to solicit feedback from
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.6
+ * @since 3.3
*/
public interface EclipseLinkNonEmbeddableTypeMapping
- extends EclipseLinkTypeMapping
-{
+ extends IdTypeMapping, EclipseLinkTypeMapping {
+
EclipseLinkCaching getCaching();
EclipseLinkReadOnly getReadOnly();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java
index 894478b6d7..2ca8b04b9c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java
@@ -10,10 +10,10 @@
package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
import java.util.List;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
+import org.eclipse.jpt.common.core.internal.utility.ValidationMessageTools;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractEntityPrimaryKeyValidator;
-import org.eclipse.jpt.common.core.internal.utility.ValidationMessageTools;
import org.eclipse.jpt.jpa.core.validation.JptJpaCoreValidationMessages;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
@@ -52,7 +52,7 @@ public class EclipseLinkEntityPrimaryKeyValidator
}
@Override
- protected boolean definesPrimaryKey(TypeMapping typeMapping) {
+ protected boolean definesPrimaryKey(IdTypeMapping typeMapping) {
return super.definesPrimaryKey(typeMapping)
|| ((EclipseLinkTypeMapping) typeMapping).usesPrimaryKeyColumns()
|| ((EclipseLinkTypeMapping) typeMapping).usesPrimaryKeyTenantDiscriminatorColumns();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java
index fe5b1e966b..371882b950 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java
@@ -10,10 +10,10 @@
package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
import java.util.List;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
+import org.eclipse.jpt.common.core.internal.utility.ValidationMessageTools;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.common.core.internal.utility.ValidationMessageTools;
import org.eclipse.jpt.jpa.core.validation.JptJpaCoreValidationMessages;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
@@ -64,7 +64,7 @@ public class EclipseLinkMappedSuperclassPrimaryKeyValidator
}
@Override
- protected boolean definesPrimaryKey(TypeMapping typeMapping) {
+ protected boolean definesPrimaryKey(IdTypeMapping typeMapping) {
return super.definesPrimaryKey(typeMapping)
|| ((EclipseLinkTypeMapping) typeMapping).usesPrimaryKeyColumns();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java
index 94901598fa..eda7685112 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassImpl.java
@@ -43,27 +43,27 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
* Java mapped superclass
*/
public class EclipseLinkJavaMappedSuperclassImpl
- extends AbstractJavaMappedSuperclass
- implements
- EclipseLinkJavaMappedSuperclass,
- JavaCacheableReference2_0,
- EclipseLinkJavaConverterContainer.Parent,
- JavaGeneratorContainer.Parent
-{
+ extends AbstractJavaMappedSuperclass
+ implements
+ EclipseLinkJavaMappedSuperclass,
+ JavaCacheableReference2_0,
+ EclipseLinkJavaConverterContainer.Parent,
+ JavaGeneratorContainer.Parent {
+
protected final EclipseLinkJavaCaching caching;
-
+
protected final EclipseLinkJavaReadOnly readOnly;
-
+
protected final EclipseLinkJavaConverterContainer converterContainer;
-
+
protected final EclipseLinkJavaChangeTracking changeTracking;
-
+
protected final EclipseLinkJavaCustomizer customizer;
-
+
protected final EclipseLinkJavaMultitenancy2_3 multitenancy;
-
+
protected final JavaGeneratorContainer generatorContainer;
-
+
public EclipseLinkJavaMappedSuperclassImpl(JavaPersistentType parent, MappedSuperclassAnnotation mappingAnnotation) {
super(parent, mappingAnnotation);
this.caching = this.buildCaching();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMultitenancyImpl2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMultitenancyImpl2_3.java
index 7ca200ace7..c4b747c8db 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMultitenancyImpl2_3.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMultitenancyImpl2_3.java
@@ -607,15 +607,13 @@ public class EclipseLinkJavaMultitenancyImpl2_3
}
protected EclipseLinkMappedSuperclass getSuperMappedSuperclass(TypeMapping typeMapping) {
- TypeMapping superTypeMapping = typeMapping.getSuperTypeMapping();
- if (superTypeMapping == null) {
- return null;
- }
- //instanceof check in case the mapped superclass is in an orm.xml instead of an eclipselinkorm.xml file.
- if (superTypeMapping instanceof EclipseLinkMappedSuperclass) {
- return (EclipseLinkMappedSuperclass) superTypeMapping;
+ for (TypeMapping superTypeMapping : typeMapping.getAncestors()) {
+ //instanceof check in case the mapped superclass is in an orm.xml instead of an eclipselinkorm.xml file.
+ if (superTypeMapping instanceof EclipseLinkMappedSuperclass) {
+ return (EclipseLinkMappedSuperclass) superTypeMapping;
+ }
}
- return this.getSuperMappedSuperclass(superTypeMapping);
+ return null;
}
public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmMultitenancyImpl2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmMultitenancyImpl2_3.java
index df4cd3d8ad..0272d03b9d 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmMultitenancyImpl2_3.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmMultitenancyImpl2_3.java
@@ -647,15 +647,13 @@ public class EclipseLinkOrmMultitenancyImpl2_3
}
protected EclipseLinkMappedSuperclass getSuperMappedSuperclass(TypeMapping typeMapping) {
- TypeMapping superTypeMapping = typeMapping.getSuperTypeMapping();
- if (superTypeMapping == null) {
- return null;
- }
- //instanceof check in case the mapped superclass is in an orm.xml instead of an eclipselinkorm.xml file.
- if (superTypeMapping instanceof EclipseLinkMappedSuperclass) {
- return (EclipseLinkMappedSuperclass) superTypeMapping;
+ for (TypeMapping superTypeMapping : typeMapping.getAncestors()) {
+ //instanceof check in case the mapped superclass is in an orm.xml instead of an eclipselinkorm.xml file.
+ if (superTypeMapping instanceof EclipseLinkMappedSuperclass) {
+ return (EclipseLinkMappedSuperclass) superTypeMapping;
+ }
}
- return this.getSuperMappedSuperclass(superTypeMapping);
+ return null;
}
public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentTypeImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentTypeImpl.java
index 049b824fc7..7dd8c71034 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentTypeImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentTypeImpl.java
@@ -13,8 +13,8 @@ import java.util.List;
import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
import org.eclipse.jpt.common.core.utility.jdt.TypeBinding;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaManagedType;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
@@ -27,8 +27,8 @@ import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory2_1;
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkJpaPlatformVersion;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory2_1;
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods;
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
@@ -172,7 +172,7 @@ public class EclipseLinkOrmPersistentTypeImpl
@Override
public TypeBinding getAttributeTypeBinding(PersistentAttribute attribute) {
if (this.dynamic) {
- return (this.superPersistentType == null) ? null : this.superPersistentType.getAttributeTypeBinding(attribute);
+ return (getSuperPersistentType() == null) ? null : getSuperPersistentType().getAttributeTypeBinding(attribute);
}
return super.getAttributeTypeBinding(attribute);
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkVirtualJavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkVirtualJavaPersistentType.java
index b34efe43c1..2321142bce 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkVirtualJavaPersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkVirtualJavaPersistentType.java
@@ -10,20 +10,16 @@
package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
import java.util.Collection;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
import org.eclipse.jpt.common.core.utility.BodySourceWriter;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.core.utility.jdt.TypeBinding;
-import org.eclipse.jpt.common.utility.internal.ObjectTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable;
import org.eclipse.jpt.common.utility.internal.iterable.EmptyListIterable;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
@@ -33,6 +29,7 @@ import org.eclipse.jpt.jpa.core.JpaStructureNode;
import org.eclipse.jpt.jpa.core.context.AccessType;
import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
import org.eclipse.jpt.jpa.core.context.PersistentType;
+import org.eclipse.jpt.jpa.core.context.TypeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
@@ -47,14 +44,13 @@ import org.eclipse.wst.validation.internal.provisional.core.IMessage;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
public class EclipseLinkVirtualJavaPersistentType
- extends AbstractJavaContextModel<EclipseLinkOrmPersistentType>
- implements JavaPersistentType, PersistentType2_0
-{
+ extends AbstractJavaContextModel<EclipseLinkOrmPersistentType>
+ implements JavaPersistentType, PersistentType2_0 {
+
private final XmlTypeMapping xmlTypeMapping;
protected final JavaTypeMapping mapping;
- protected PersistentType superPersistentType;
-
+
public EclipseLinkVirtualJavaPersistentType(EclipseLinkOrmPersistentType parent, XmlTypeMapping xmlTypeMapping) {
super(parent);
@@ -76,7 +72,6 @@ public class EclipseLinkVirtualJavaPersistentType
@Override
public void update() {
super.update();
- this.setSuperPersistentType(this.buildSuperPersistentType());
}
public void addRootStructureNodesTo(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes) {
@@ -141,64 +136,22 @@ public class EclipseLinkVirtualJavaPersistentType
}
- // ********** super persistent type **********
-
+ // ***** super persistent type *****
+
public PersistentType getSuperPersistentType() {
- return this.superPersistentType;
- }
-
- protected void setSuperPersistentType(PersistentType superPersistentType) {
- PersistentType old = this.superPersistentType;
- this.superPersistentType = superPersistentType;
- this.firePropertyChanged(SUPER_PERSISTENT_TYPE_PROPERTY, old, superPersistentType);
- }
-
- protected PersistentType buildSuperPersistentType() {
- HashSet<JavaResourceType> visited = new HashSet<JavaResourceType>();
- PersistentType spt = this.resolveSuperPersistentType(this.xmlTypeMapping.getParentClass(), visited);
- if (spt == null) {
- return null;
- }
- if (IterableTools.contains(spt.getInheritanceHierarchy(), this)) {
- return null; // short-circuit in this case, we have circular inheritance
- }
- return spt.isMapped() ? spt : spt.getSuperPersistentType();
- }
-
- /**
- * The JPA spec allows non-persistent types in a persistent type's
- * inheritance hierarchy. We check for a persistent type with the
- * specified name in the persistence unit (Use the EntityMapping
- * API for this because it will append the package name if unqualified).
- * If it is not found we use java resource type and look for <em>its</em> super type.
- * <p>
- * The <code>visited</code> collection is used to detect a cycle in the
- * <em>resource</em> type inheritance hierarchy and prevent the resulting
- * stack overflow. Any cycles in the <em>context</em> type inheritance
- * hierarchy are handled in {@link #buildSuperPersistentType()}.
- */
- protected PersistentType resolveSuperPersistentType(String typeName, Collection<JavaResourceType> visited) {
- if (StringTools.isBlank(typeName)) {
- return null;
- }
- PersistentType spt = this.resolvePersistentType(typeName);
- if (spt != null) {
- return spt;
- }
- JavaResourceType resourceType = this.resolveJavaResourceType(typeName);
- visited.add(resourceType);
- return (resourceType == null) ? null : this.resolveSuperPersistentType(resourceType.getSuperclassQualifiedName(), visited); // recurse
+ TypeMapping superTypeMapping = this.mapping.getSuperTypeMapping();
+ return (superTypeMapping == null) ? null : superTypeMapping.getPersistentType();
}
-
- protected PersistentType resolvePersistentType(String typeName) {
- return this.getEntityMappings().resolvePersistentType(typeName);
+
+ public Iterable<PersistentType> getAncestors() {
+ return IterableTools.transform(getMapping().getAncestors(), TypeMapping.PERSISTENT_TYPE_TRANSFORMER);
}
-
- protected JavaResourceType resolveJavaResourceType(String typeName) {
- return (JavaResourceType) this.getEntityMappings().resolveJavaResourceType(typeName, JavaResourceAnnotatedElement.AstNodeType.TYPE);
+
+ public Iterable<PersistentType> getInheritanceHierarchy() {
+ return IterableTools.transform(getMapping().getInheritanceHierarchy(), TypeMapping.PERSISTENT_TYPE_TRANSFORMER);
}
-
-
+
+
// ********** attributes **********
//The VirtualJavaPersistentAttributes are built by the OrmEclipseLinkPersistentAttribute, no attributes here
@@ -243,24 +196,6 @@ public class EclipseLinkVirtualJavaPersistentType
}
- // ********** inheritance **********
-
- public Iterable<PersistentType> getInheritanceHierarchy() {
- return this.buildInheritanceHierarchy(this);
- }
-
- public Iterable<PersistentType> getAncestors() {
- return (this.superPersistentType == null) ?
- IterableTools.<PersistentType>emptyIterable() :
- this.buildInheritanceHierarchy(this.superPersistentType);
- }
-
- protected Iterable<PersistentType> buildInheritanceHierarchy(PersistentType start) {
- // using a chain iterable to traverse up the inheritance tree
- return ObjectTools.chain(start, SUPER_PERSISTENT_TYPE_TRANSFORMER);
- }
-
-
// ********** JpaStructureNode implementation **********
public ContextType getContextType() {
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java
index 378c131b2a..0c42592fc1 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,38 +11,50 @@ package org.eclipse.jpt.jpa.core.tests.extension.resource;
import org.eclipse.jpt.common.core.resource.java.Annotation;
import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable;
+import org.eclipse.jpt.common.utility.internal.iterable.SingleElementIterable;
+import org.eclipse.jpt.jpa.core.context.IdTypeMapping;
import org.eclipse.jpt.jpa.core.context.Query;
+import org.eclipse.jpt.jpa.core.context.TypeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaTypeMapping;
public class JavaTestTypeMapping
- extends AbstractJavaTypeMapping<Annotation>
-{
+ extends AbstractJavaTypeMapping<Annotation> {
+
public static final String TEST_TYPE_MAPPING_KEY = "test"; //$NON-NLS-1$
public static final String TEST_TYPE_ANNOTATION_NAME = "test.Test"; //$NON-NLS-1$
-
-
+
+
public JavaTestTypeMapping(JavaPersistentType parent) {
super(parent, null);
}
-
+
+
public String getKey() {
return TEST_TYPE_MAPPING_KEY;
}
-
- public JavaPersistentType getIdClass() {
- return null;
- }
-
+
public boolean isMapped() {
return true;
}
-
+
public boolean tableNameIsInvalid(String tableName) {
return false;
}
-
+
public Iterable<Query> getQueries() {
return EmptyIterable.instance();
}
+
+ public IdTypeMapping getSuperTypeMapping() {
+ return null;
+ }
+
+ public Iterable<IdTypeMapping> getAncestors() {
+ return EmptyIterable.instance();
+ }
+
+ public Iterable<? extends TypeMapping> getInheritanceHierarchy() {
+ return new SingleElementIterable(this);
+ }
}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java
index 31d4e7ce85..dc029c667c 100644
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java
+++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java
@@ -16,6 +16,7 @@ import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.Sourc
import org.eclipse.jpt.common.utility.internal.iterator.IteratorTools;
import org.eclipse.jpt.jpa.core.MappingKeys;
import org.eclipse.jpt.jpa.core.context.InheritanceType;
+import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
import org.eclipse.jpt.jpa.core.resource.java.JPA;
@@ -423,20 +424,21 @@ public class EclipseLink2_3OrmMultitenancyTests
getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-
+ OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
+
EclipseLinkOrmMultitenancy2_3 multitenancy = ((EclipseLinkOrmEntity) ormPersistentType.getMapping()).getMultitenancy();
assertTrue(multitenancy.isMultitenant()); //multitenant by default from root entity
assertFalse(multitenancy.isSpecifiedMultitenant());
assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
assertEquals("ROOT_ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- ormPersistentType.getMapping().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
+ ormEntity.getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
assertTrue(multitenancy.isMultitenant()); //multitenant by default from root entity
assertFalse(multitenancy.isSpecifiedMultitenant());
assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
assertEquals("ROOT_ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- ormPersistentType.getMapping().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
+ ormEntity.getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
assertFalse(multitenancy.isMultitenant()); //not multitenant since inheritance strategy is table per class
assertFalse(multitenancy.isSpecifiedMultitenant());
assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
@@ -457,7 +459,7 @@ public class EclipseLink2_3OrmMultitenancyTests
assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
assertEquals("CHILD_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- ormPersistentType.getMapping().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
+ ormEntity.getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
assertEquals("CHILD_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java
index 0e692cc095..89cbe8fb4f 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java
@@ -1,7 +1,7 @@
/*******************************************************************************
* <copyright>
*
- * Copyright (c) 2005, 2012 SAP AG and others.
+ * Copyright (c) 2005, 2013 SAP AG and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,7 +24,6 @@ import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Set;
-
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -1839,7 +1838,7 @@ public class JpaArtifactFactory {
JavaPersistentType idClassType = null;
TypeMapping mapping = getTypeMapping(jpt);
if(mapping instanceof Entity){
- idClassType = ((Entity)mapping).getIdClass();
+ idClassType = ((Entity)mapping).getIdClassReference().getIdClass();
if(idClassType == null) {
String idClassFqn = ((Entity)mapping).getIdClassReference().getFullyQualifiedIdClassName();
PersistentType idClassPersistentType = jpt.getPersistenceUnit().getPersistentType(idClassFqn);

Back to the top