Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authorbvosburgh2007-05-04 14:59:06 +0000
committerbvosburgh2007-05-04 14:59:06 +0000
commit5d2e499840320ff96d5d9d4600a48ebe57a00ad5 (patch)
tree9266f6d1602a444dd46fbc050287af54af2c396d /jpa
parentecac8fd1160e2b17ae67986d350f13e6ea94f621 (diff)
downloadwebtools.dali-5d2e499840320ff96d5d9d4600a48ebe57a00ad5.tar.gz
webtools.dali-5d2e499840320ff96d5d9d4600a48ebe57a00ad5.tar.xz
webtools.dali-5d2e499840320ff96d5d9d4600a48ebe57a00ad5.zip
reworked mapping key stuff
Diffstat (limited to 'jpa')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/core.ecore10
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IAttributeMapping.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentAttribute.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePackage.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasic.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedId.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaId.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java797
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasic.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbedded.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedId.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlId.java16
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOne.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclass.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOne.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentAttribute.java195
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEntityContext.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEntityContext.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTypeContext.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java19
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java17
28 files changed, 924 insertions, 856 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/core.ecore b/jpa/plugins/org.eclipse.jpt.core/model/core.ecore
index 96c4982baa..854b45b13c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/core.ecore
+++ b/jpa/plugins/org.eclipse.jpt.core/model/core.ecore
@@ -89,11 +89,13 @@
<eClassifiers xsi:type="ecore:EClass" name="NullTypeMapping" eSuperTypes="#//JpaEObject #//ITypeMapping #//IJpaSourceObject"/>
<eClassifiers xsi:type="ecore:EClass" name="IPersistentAttribute" abstract="true"
interface="true" eSuperTypes="#//IJpaContentNode">
- <eOperations name="getMapping" lowerBound="1" eType="#//IAttributeMapping"/>
<eOperations name="typeMapping" lowerBound="1" eType="#//ITypeMapping"/>
- <eOperations name="getName" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mappingKey" lowerBound="1"
- eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" changeable="false"/>
+ <eOperations name="getName" lowerBound="1" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
+ <eOperations name="mappingKey" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eOperations name="defaultMappingKey" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="mapping" lowerBound="1"
+ eType="#//IAttributeMapping" changeable="false" volatile="true" transient="true"
+ derived="true" resolveProxies="false"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="IAttributeMapping" abstract="true" interface="true"
eSuperTypes="#//IJpaSourceObject">
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel b/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
index 1869eab0b9..9683284664 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
+++ b/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
@@ -79,10 +79,11 @@
</genClasses>
<genClasses ecoreClass="core.ecore#//NullTypeMapping"/>
<genClasses ecoreClass="core.ecore#//IPersistentAttribute">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//IPersistentAttribute/mappingKey"/>
- <genOperations ecoreOperation="core.ecore#//IPersistentAttribute/getMapping"/>
+ <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference core.ecore#//IPersistentAttribute/mapping"/>
<genOperations ecoreOperation="core.ecore#//IPersistentAttribute/typeMapping"/>
<genOperations ecoreOperation="core.ecore#//IPersistentAttribute/getName"/>
+ <genOperations ecoreOperation="core.ecore#//IPersistentAttribute/mappingKey"/>
+ <genOperations ecoreOperation="core.ecore#//IPersistentAttribute/defaultMappingKey"/>
</genClasses>
<genClasses ecoreClass="core.ecore#//IAttributeMapping">
<genOperations ecoreOperation="core.ecore#//IAttributeMapping/getPersistentAttribute"/>
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IAttributeMapping.java
index 82dc9123c7..0cf331549b 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IAttributeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IAttributeMapping.java
@@ -53,4 +53,19 @@ public interface IAttributeMapping extends IJpaSourceObject
* Return the mapping for the attribute mapping's attribute's type.
*/
ITypeMapping typeMapping();
+
+ /**
+ * Return whether the "attribute" mapping can be overridden.
+ */
+ boolean isOverridableAttributeMapping();
+
+ /**
+ * Return whether the "association" mapping can be overridden.
+ */
+ boolean isOverridableAssociationMapping();
+
+ /**
+ * Return whether the "attribute" mapping is for an ID.
+ */
+ boolean isIdMapping();
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentAttribute.java
index 39bfb346f1..669ecb308d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentAttribute.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IPersistentAttribute.java
@@ -17,12 +17,6 @@ import org.eclipse.jpt.core.internal.jdtutility.Attribute;
* A representation of the model object '<em><b>IPersistent Attribute</b></em>'.
* <!-- end-user-doc -->
*
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.core.internal.IPersistentAttribute#getMappingKey <em>Mapping Key</em>}</li>
- * </ul>
- * </p>
*
* @see org.eclipse.jpt.core.internal.JpaCorePackage#getIPersistentAttribute()
* @model kind="class" interface="true" abstract="true"
@@ -31,26 +25,20 @@ import org.eclipse.jpt.core.internal.jdtutility.Attribute;
public interface IPersistentAttribute extends IJpaContentNode
{
/**
- * Returns the value of the '<em><b>Mapping Key</b></em>' attribute.
* <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapping Key</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
* <!-- end-user-doc -->
- * @return the value of the '<em>Mapping Key</em>' attribute.
- * @see org.eclipse.jpt.core.internal.JpaCorePackage#getIPersistentAttribute_MappingKey()
- * @model required="true" changeable="false"
+ * @model kind="operation" required="true"
* @generated
*/
- String getMappingKey();
-
- void setMappingKey(String value, boolean default_);
+ IAttributeMapping getMapping();
/**
- * Returns an iterator on all mapping keys that are available for this attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @model required="true"
+ * @generated
*/
- Iterator candidateMappingKeys();
+ ITypeMapping typeMapping();
/**
* <!-- begin-user-doc -->
@@ -58,35 +46,63 @@ public interface IPersistentAttribute extends IJpaContentNode
* @model kind="operation" required="true"
* @generated
*/
- IAttributeMapping getMapping();
+ String getName();
/**
* <!-- begin-user-doc -->
+ * Return the key for the attribute's mapping.
+ * The key may be for either the "specified" mapping or, if the "specified"
+ * mapping is missing, the "default" mapping.
* <!-- end-user-doc -->
* @model required="true"
* @generated
*/
- ITypeMapping typeMapping();
+ String mappingKey();
/**
* <!-- begin-user-doc -->
+ * Return the key for the attribute's "default" mapping.
* <!-- end-user-doc -->
- * @model kind="operation"
+ * @model required="true"
* @generated
*/
- String getName();
+ String defaultMappingKey();
/**
- * Return the java Attribute that this IPersistentAttribute is associated with
- * @return
+ * Clients should call this method to set the attribute's mapping.
+ * Passing in a null key will cause the "specified" mapping to be
+ * cleared and the attribute's mapping to be its "default" mapping.
*/
- Attribute getAttribute();
+ void setSpecifiedMappingKey(String key);
- String defaultKey();
+ /**
+ * Return all the attribute's mapping keys.
+ */
+ Iterator<String> candidateMappingKeys();
+
+ /**
+ * Return the attribute's Java attribute.
+ */
+ Attribute getAttribute();
/**
* If the attribute is mapped to a primary key column, return the
* column's name, otherwise return null.
*/
String primaryKeyColumnName();
-} \ No newline at end of file
+
+ /**
+ * Return whether the attribute's "attribute" mapping can be overridden.
+ */
+ boolean isOverridableAttribute();
+
+ /**
+ * Return whether the attribute's "association" mapping can be overridden.
+ */
+ boolean isOverridableAssociation();
+
+ /**
+ * Return whether the attribute's "attribute" mapping is for an ID.
+ */
+ boolean isIdAttribute();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePackage.java
index 51333a3479..2574b03d81 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePackage.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePackage.java
@@ -1,8 +1,8 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 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.
+ * 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
@@ -159,16 +159,6 @@ public class JpaCorePackage extends EPackageImpl
public static final int JPA_MODEL_FEATURE_COUNT = JPA_EOBJECT_FEATURE_COUNT + 1;
/**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.XmlEObject <em>Xml EObject</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.XmlEObject
- * @see org.eclipse.jpt.core.internal.JpaCorePackage#getXmlEObject()
- * @generated
- */
- public static final int XML_EOBJECT = 13;
-
- /**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.IJpaProject <em>IJpa Project</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -394,6 +384,16 @@ public class JpaCorePackage extends EPackageImpl
public static final int IXML_EOBJECT_FEATURE_COUNT = IJPA_EOBJECT_FEATURE_COUNT + 0;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.XmlEObject <em>Xml EObject</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.XmlEObject
+ * @see org.eclipse.jpt.core.internal.JpaCorePackage#getXmlEObject()
+ * @generated
+ */
+ public static final int XML_EOBJECT = 13;
+
+ /**
* The number of structural features of the '<em>Xml EObject</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -562,13 +562,13 @@ public class JpaCorePackage extends EPackageImpl
public static final int IPERSISTENT_ATTRIBUTE = 19;
/**
- * The feature id for the '<em><b>Mapping Key</b></em>' attribute.
+ * The feature id for the '<em><b>Mapping</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int IPERSISTENT_ATTRIBUTE__MAPPING_KEY = IJPA_CONTENT_NODE_FEATURE_COUNT + 0;
+ public static final int IPERSISTENT_ATTRIBUTE__MAPPING = IJPA_CONTENT_NODE_FEATURE_COUNT + 0;
/**
* The number of structural features of the '<em>IPersistent Attribute</em>' class.
@@ -641,13 +641,6 @@ public class JpaCorePackage extends EPackageImpl
* <!-- end-user-doc -->
* @generated
*/
- private EClass xmlEObjectEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
private EClass iJpaProjectEClass = null;
/**
@@ -711,6 +704,13 @@ public class JpaCorePackage extends EPackageImpl
* <!-- end-user-doc -->
* @generated
*/
+ private EClass xmlEObjectEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass iJpaContentNodeEClass = null;
/**
@@ -906,18 +906,6 @@ public class JpaCorePackage extends EPackageImpl
}
/**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.XmlEObject <em>Xml EObject</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml EObject</em>'.
- * @see org.eclipse.jpt.core.internal.XmlEObject
- * @generated
- */
- public EClass getXmlEObject() {
- return xmlEObjectEClass;
- }
-
- /**
* Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IJpaProject <em>IJpa Project</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1104,6 +1092,18 @@ public class JpaCorePackage extends EPackageImpl
}
/**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.XmlEObject <em>Xml EObject</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Xml EObject</em>'.
+ * @see org.eclipse.jpt.core.internal.XmlEObject
+ * @generated
+ */
+ public EClass getXmlEObject() {
+ return xmlEObjectEClass;
+ }
+
+ /**
* Returns the meta object for class '{@link org.eclipse.jpt.core.internal.IJpaContentNode <em>IJpa Content Node</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1228,16 +1228,16 @@ public class JpaCorePackage extends EPackageImpl
}
/**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.IPersistentAttribute#getMappingKey <em>Mapping Key</em>}'.
+ * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.IPersistentAttribute#getMapping <em>Mapping</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Mapping Key</em>'.
- * @see org.eclipse.jpt.core.internal.IPersistentAttribute#getMappingKey()
+ * @return the meta object for the reference '<em>Mapping</em>'.
+ * @see org.eclipse.jpt.core.internal.IPersistentAttribute#getMapping()
* @see #getIPersistentAttribute()
* @generated
*/
- public EAttribute getIPersistentAttribute_MappingKey() {
- return (EAttribute) iPersistentAttributeEClass.getEStructuralFeatures().get(0);
+ public EReference getIPersistentAttribute_Mapping() {
+ return (EReference) iPersistentAttributeEClass.getEStructuralFeatures().get(0);
}
/**
@@ -1325,7 +1325,7 @@ public class JpaCorePackage extends EPackageImpl
createEAttribute(iTypeMappingEClass, ITYPE_MAPPING__TABLE_NAME);
nullTypeMappingEClass = createEClass(NULL_TYPE_MAPPING);
iPersistentAttributeEClass = createEClass(IPERSISTENT_ATTRIBUTE);
- createEAttribute(iPersistentAttributeEClass, IPERSISTENT_ATTRIBUTE__MAPPING_KEY);
+ createEReference(iPersistentAttributeEClass, IPERSISTENT_ATTRIBUTE__MAPPING);
iAttributeMappingEClass = createEClass(IATTRIBUTE_MAPPING);
// Create enums
accessTypeEEnum = createEEnum(ACCESS_TYPE);
@@ -1435,10 +1435,11 @@ public class JpaCorePackage extends EPackageImpl
addEOperation(iTypeMappingEClass, this.getIPersistentType(), "getPersistentType", 1, 1);
initEClass(nullTypeMappingEClass, NullTypeMapping.class, "NullTypeMapping", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(iPersistentAttributeEClass, IPersistentAttribute.class, "IPersistentAttribute", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getIPersistentAttribute_MappingKey(), ecorePackage.getEString(), "mappingKey", null, 1, 1, IPersistentAttribute.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- addEOperation(iPersistentAttributeEClass, this.getIAttributeMapping(), "getMapping", 1, 1);
+ initEReference(getIPersistentAttribute_Mapping(), this.getIAttributeMapping(), null, "mapping", null, 1, 1, IPersistentAttribute.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
addEOperation(iPersistentAttributeEClass, this.getITypeMapping(), "typeMapping", 1, 1);
- addEOperation(iPersistentAttributeEClass, theEcorePackage.getEString(), "getName", 0, 1);
+ addEOperation(iPersistentAttributeEClass, theEcorePackage.getEString(), "getName", 1, 1);
+ addEOperation(iPersistentAttributeEClass, ecorePackage.getEString(), "mappingKey", 1, 1);
+ addEOperation(iPersistentAttributeEClass, ecorePackage.getEString(), "defaultMappingKey", 1, 1);
initEClass(iAttributeMappingEClass, IAttributeMapping.class, "IAttributeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
addEOperation(iAttributeMappingEClass, this.getIPersistentAttribute(), "getPersistentAttribute", 1, 1);
addEOperation(iAttributeMappingEClass, theEcorePackage.getEBoolean(), "isDefault", 0, 1);
@@ -1513,16 +1514,6 @@ public class JpaCorePackage extends EPackageImpl
public static final EClass JPA_EOBJECT = eINSTANCE.getJpaEObject();
/**
- * The meta object literal for the '{@link org.eclipse.jpt.core.internal.XmlEObject <em>Xml EObject</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.XmlEObject
- * @see org.eclipse.jpt.core.internal.JpaCorePackage#getXmlEObject()
- * @generated
- */
- public static final EClass XML_EOBJECT = eINSTANCE.getXmlEObject();
-
- /**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.IJpaProject <em>IJpa Project</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1661,6 +1652,16 @@ public class JpaCorePackage extends EPackageImpl
public static final EClass IXML_EOBJECT = eINSTANCE.getIXmlEObject();
/**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.XmlEObject <em>Xml EObject</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.XmlEObject
+ * @see org.eclipse.jpt.core.internal.JpaCorePackage#getXmlEObject()
+ * @generated
+ */
+ public static final EClass XML_EOBJECT = eINSTANCE.getXmlEObject();
+
+ /**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.IJpaContentNode <em>IJpa Content Node</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1753,12 +1754,12 @@ public class JpaCorePackage extends EPackageImpl
public static final EClass IPERSISTENT_ATTRIBUTE = eINSTANCE.getIPersistentAttribute();
/**
- * The meta object literal for the '<em><b>Mapping Key</b></em>' attribute feature.
+ * The meta object literal for the '<em><b>Mapping</b></em>' reference feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public static final EAttribute IPERSISTENT_ATTRIBUTE__MAPPING_KEY = eINSTANCE.getIPersistentAttribute_MappingKey();
+ public static final EReference IPERSISTENT_ATTRIBUTE__MAPPING = eINSTANCE.getIPersistentAttribute_Mapping();
/**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.IAttributeMapping <em>IAttribute Mapping</em>}' class.
@@ -1780,4 +1781,4 @@ public class JpaCorePackage extends EPackageImpl
*/
public static final EEnum ACCESS_TYPE = eINSTANCE.getAccessType();
}
-}
+} //JpaCorePackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java
index 66d341e522..d8ed72742c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java
@@ -1,8 +1,8 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 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.
+ * 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
@@ -72,26 +72,6 @@ public class JpaJavaPackage extends EPackageImpl
public static final JpaJavaPackage eINSTANCE = org.eclipse.jpt.core.internal.content.java.JpaJavaPackage.init();
/**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping <em>IJava Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping
- * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaAttributeMapping()
- * @generated
- */
- public static final int IJAVA_ATTRIBUTE_MAPPING = 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping <em>IJava Type Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping
- * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaTypeMapping()
- * @generated
- */
- public static final int IJAVA_TYPE_MAPPING = 4;
-
- /**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.JavaEObject <em>Java EObject</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -213,13 +193,13 @@ public class JpaJavaPackage extends EPackageImpl
public static final int JAVA_PERSISTENT_ATTRIBUTE = 3;
/**
- * The feature id for the '<em><b>Mapping Key</b></em>' attribute.
+ * The feature id for the '<em><b>Mapping</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int JAVA_PERSISTENT_ATTRIBUTE__MAPPING_KEY = JAVA_EOBJECT_FEATURE_COUNT + 0;
+ public static final int JAVA_PERSISTENT_ATTRIBUTE__MAPPING = JAVA_EOBJECT_FEATURE_COUNT + 0;
/**
* The feature id for the '<em><b>Default Mapping</b></em>' containment reference.
@@ -249,6 +229,16 @@ public class JpaJavaPackage extends EPackageImpl
public static final int JAVA_PERSISTENT_ATTRIBUTE_FEATURE_COUNT = JAVA_EOBJECT_FEATURE_COUNT + 3;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping <em>IJava Type Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping
+ * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaTypeMapping()
+ * @generated
+ */
+ public static final int IJAVA_TYPE_MAPPING = 4;
+
+ /**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -276,6 +266,16 @@ public class JpaJavaPackage extends EPackageImpl
public static final int IJAVA_TYPE_MAPPING_FEATURE_COUNT = JpaCorePackage.ITYPE_MAPPING_FEATURE_COUNT + 0;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping <em>IJava Attribute Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping
+ * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaAttributeMapping()
+ * @generated
+ */
+ public static final int IJAVA_ATTRIBUTE_MAPPING = 5;
+
+ /**
* The number of structural features of the '<em>IJava Attribute Mapping</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -289,42 +289,42 @@ public class JpaJavaPackage extends EPackageImpl
* <!-- end-user-doc -->
* @generated
*/
- private EClass iJavaAttributeMappingEClass = null;
+ private EClass javaEObjectEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass iJavaTypeMappingEClass = null;
+ private EClass jpaCompilationUnitEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass javaEObjectEClass = null;
+ private EClass javaPersistentTypeEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass jpaCompilationUnitEClass = null;
+ private EClass javaPersistentAttributeEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass javaPersistentTypeEClass = null;
+ private EClass iJavaTypeMappingEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass javaPersistentAttributeEClass = null;
+ private EClass iJavaAttributeMappingEClass = null;
/**
* Creates an instance of the model <b>Package</b>, registered with
@@ -409,30 +409,6 @@ public class JpaJavaPackage extends EPackageImpl
}
/**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping <em>IJava Attribute Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>IJava Attribute Mapping</em>'.
- * @see org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping
- * @generated
- */
- public EClass getIJavaAttributeMapping() {
- return iJavaAttributeMappingEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping <em>IJava Type Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>IJava Type Mapping</em>'.
- * @see org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping
- * @generated
- */
- public EClass getIJavaTypeMapping() {
- return iJavaTypeMappingEClass;
- }
-
- /**
* Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.JavaEObject <em>Java EObject</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -559,6 +535,30 @@ public class JpaJavaPackage extends EPackageImpl
}
/**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping <em>IJava Type Mapping</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>IJava Type Mapping</em>'.
+ * @see org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping
+ * @generated
+ */
+ public EClass getIJavaTypeMapping() {
+ return iJavaTypeMappingEClass;
+ }
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping <em>IJava Attribute Mapping</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>IJava Attribute Mapping</em>'.
+ * @see org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping
+ * @generated
+ */
+ public EClass getIJavaAttributeMapping() {
+ return iJavaAttributeMappingEClass;
+ }
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -677,26 +677,6 @@ public class JpaJavaPackage extends EPackageImpl
public interface Literals
{
/**
- * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping <em>IJava Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping
- * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaAttributeMapping()
- * @generated
- */
- public static final EClass IJAVA_ATTRIBUTE_MAPPING = eINSTANCE.getIJavaAttributeMapping();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping <em>IJava Type Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping
- * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaTypeMapping()
- * @generated
- */
- public static final EClass IJAVA_TYPE_MAPPING = eINSTANCE.getIJavaTypeMapping();
-
- /**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.JavaEObject <em>Java EObject</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -783,5 +763,25 @@ public class JpaJavaPackage extends EPackageImpl
* @generated
*/
public static final EReference JAVA_PERSISTENT_ATTRIBUTE__SPECIFIED_MAPPING = eINSTANCE.getJavaPersistentAttribute_SpecifiedMapping();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping <em>IJava Type Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.java.IJavaTypeMapping
+ * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaTypeMapping()
+ * @generated
+ */
+ public static final EClass IJAVA_TYPE_MAPPING = eINSTANCE.getIJavaTypeMapping();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping <em>IJava Attribute Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.java.IJavaAttributeMapping
+ * @see org.eclipse.jpt.core.internal.content.java.JpaJavaPackage#getIJavaAttributeMapping()
+ * @generated
+ */
+ public static final EClass IJAVA_ATTRIBUTE_MAPPING = eINSTANCE.getIJavaAttributeMapping();
}
-} //JpaCoreJavaPackage
+} //JpaJavaPackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasic.java
index 4603d0bace..acb373e6bc 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasic.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaBasic.java
@@ -902,6 +902,11 @@ public class JavaBasic extends JavaAttributeMapping implements IBasic
}
}
+ @Override
+ public boolean isOverridableAttributeMapping() {
+ return true;
+ }
+
// ********** static methods **********
private static DeclarationAnnotationElementAdapter buildTemporalValueAdapter() {
return new EnumDeclarationAnnotationElementAdapter(TEMPORAL_ADAPTER, JPA.TEMPORAL__VALUE, false);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java
index e8f0a82582..129e6002c1 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java
@@ -503,19 +503,24 @@ public class JavaEmbedded extends JavaAttributeMapping implements IEmbedded
}
public Iterator<String> allOverridableAttributeNames() {
- if (embeddable() != null) {
- return new TransformationIterator(new FilteringIterator(embeddable().getPersistentType().attributes()) {
- protected boolean accept(Object o) {
- String key = ((IPersistentAttribute) o).getMappingKey();
- return key == IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY || key == IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
- }) {
- protected Object transform(Object next) {
- return ((IPersistentAttribute) next).getName();
- }
- };
+ return new TransformationIterator<IPersistentAttribute, String>(this.allOverridableAttributes()) {
+ @Override
+ protected String transform(IPersistentAttribute attribute) {
+ return attribute.getName();
+ }
+ };
+ }
+
+ public Iterator<IPersistentAttribute> allOverridableAttributes() {
+ if (this.embeddable() == null) {
+ return EmptyIterator.instance();
}
- return EmptyIterator.instance();
+ return new FilteringIterator<IPersistentAttribute>(this.embeddable().getPersistentType().attributes()) {
+ @Override
+ protected boolean accept(Object o) {
+ return ((IPersistentAttribute) o).isOverridableAttribute();
+ }
+ };
}
public IAttributeOverride createAttributeOverride(int index) {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedId.java
index 9cd197e50e..a904f9316f 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedId.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbeddedId.java
@@ -56,4 +56,9 @@ public class JavaEmbeddedId extends JavaAttributeMapping implements IEmbeddedId
public String getKey() {
return IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
}
+
+ @Override
+ public boolean isIdMapping() {
+ return true;
+ }
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaId.java
index 40725d78fd..3966a1bce6 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaId.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaId.java
@@ -729,6 +729,16 @@ public class JavaId extends JavaAttributeMapping implements IId
return JpaJavaMappingsFactory.eINSTANCE.createJavaTableGenerator(getAttribute());
}
+ @Override
+ public boolean isOverridableAttributeMapping() {
+ return true;
+ }
+
+ @Override
+ public boolean isIdMapping() {
+ return true;
+ }
+
// ********** static methods **********
private static DeclarationAnnotationElementAdapter buildTemporalValueAdapter() {
return new EnumDeclarationAnnotationElementAdapter(TEMPORAL_ADAPTER, JPA.TEMPORAL__VALUE, false);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java
index f33b16a664..be41df9f1a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java
@@ -82,4 +82,9 @@ public class JavaManyToOne extends JavaSingleRelationshipMapping
public String getKey() {
return IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
}
+
+ @Override
+ public boolean isOverridableAssociationMapping() {
+ return true;
+ }
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java
index ecf7e0a847..b0f5db62f4 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java
@@ -286,4 +286,9 @@ public class JavaOneToOne extends JavaSingleRelationshipMapping
super.updateFromJava(astRoot);
setMappedBy((String) this.mappedByAdapter.getValue(astRoot));
}
+
+ @Override
+ public boolean isOverridableAssociationMapping() {
+ return true;
+ }
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java
index 107f85235c..a1b2568c35 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java
@@ -252,7 +252,7 @@ public class OrmFactory extends EFactoryImpl
public XmlNullAttributeMapping createXmlNullAttributeMapping() {
XmlNullAttributeMapping xmlNullAttributeMapping = createXmlNullAttributeMappingGen();
- XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(null);
+ XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute();
xmlNullAttributeMapping.setPersistentAttribute(persistentAttribute);
return xmlNullAttributeMapping;
}
@@ -267,11 +267,6 @@ public class OrmFactory extends EFactoryImpl
return xmlPersistentAttribute;
}
- public XmlPersistentAttribute createXmlPersistentAttribute(String mappingKey) {
- XmlPersistentAttribute xmlPersistentAttribute = new XmlPersistentAttribute(mappingKey);
- return xmlPersistentAttribute;
- }
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -284,7 +279,7 @@ public class OrmFactory extends EFactoryImpl
public XmlBasic createXmlBasic() {
XmlBasic basic = createXmlBasicGen();
- XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
+ XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute();
basic.setPersistentAttribute(persistentAttribute);
return basic;
}
@@ -301,7 +296,7 @@ public class OrmFactory extends EFactoryImpl
public XmlId createXmlId() {
XmlId id = createXmlIdGen();
- XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
+ XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute();
id.setPersistentAttribute(persistentAttribute);
return id;
}
@@ -318,7 +313,7 @@ public class OrmFactory extends EFactoryImpl
public XmlTransient createXmlTransient() {
XmlTransient xmlTransient = createXmlTransientGen();
- XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(IMappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
+ XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute();
xmlTransient.setPersistentAttribute(persistentAttribute);
return xmlTransient;
}
@@ -335,7 +330,7 @@ public class OrmFactory extends EFactoryImpl
public XmlEmbedded createXmlEmbedded() {
XmlEmbedded xmlEmbedded = createXmlEmbeddedGen();
- XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(IMappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
+ XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute();
xmlEmbedded.setPersistentAttribute(persistentAttribute);
return xmlEmbedded;
}
@@ -352,7 +347,7 @@ public class OrmFactory extends EFactoryImpl
public XmlEmbeddedId createXmlEmbeddedId() {
XmlEmbeddedId xmlEmbeddedId = createXmlEmbeddedIdGen();
- XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
+ XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute();
xmlEmbeddedId.setPersistentAttribute(persistentAttribute);
return xmlEmbeddedId;
}
@@ -369,7 +364,7 @@ public class OrmFactory extends EFactoryImpl
public XmlVersion createXmlVersion() {
XmlVersion xmlVersion = createXmlVersionGen();
- XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(IMappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
+ XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute();
xmlVersion.setPersistentAttribute(persistentAttribute);
return xmlVersion;
}
@@ -386,7 +381,7 @@ public class OrmFactory extends EFactoryImpl
public XmlOneToMany createXmlOneToMany() {
XmlOneToMany oneToMany = createXmlOneToManyGen();
- XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(IMappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
+ XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute();
oneToMany.setPersistentAttribute(persistentAttribute);
return oneToMany;
}
@@ -403,7 +398,7 @@ public class OrmFactory extends EFactoryImpl
public XmlManyToMany createXmlManyToMany() {
XmlManyToMany manyToMany = createXmlManyToManyGen();
- XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(IMappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
+ XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute();
manyToMany.setPersistentAttribute(persistentAttribute);
return manyToMany;
}
@@ -481,7 +476,7 @@ public class OrmFactory extends EFactoryImpl
public XmlManyToOne createXmlManyToOne() {
XmlManyToOne xmlManyToOne = createXmlManyToOneGen();
- XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
+ XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute();
xmlManyToOne.setPersistentAttribute(persistentAttribute);
return xmlManyToOne;
}
@@ -498,7 +493,7 @@ public class OrmFactory extends EFactoryImpl
public XmlOneToOne createXmlOneToOne() {
XmlOneToOne xmlOneToOne = createXmlOneToOneGen();
- XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute(IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
+ XmlPersistentAttribute persistentAttribute = createXmlPersistentAttribute();
xmlOneToOne.setPersistentAttribute(persistentAttribute);
return xmlOneToOne;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java
index 0c1bfb8578..3862c80df7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java
@@ -1,8 +1,8 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 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.
+ * 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
@@ -24,7 +24,14 @@ import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
/**
* <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
+ * The <b>Package</b> for the model.
+ * It contains accessors for the meta objects to represent
+ * <ul>
+ * <li>each class,</li>
+ * <li>each feature of each class,</li>
+ * <li>each enum,</li>
+ * <li>and each data type</li>
+ * </ul>
* <!-- end-user-doc -->
* @see org.eclipse.jpt.core.internal.content.orm.OrmFactory
* @model kind="package"
@@ -347,196 +354,6 @@ public class OrmPackage extends EPackageImpl
public static final int ENTITY_MAPPINGS = 2;
/**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml <em>Entity Mappings For Xml</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsForXml()
- * @generated
- */
- public static final int ENTITY_MAPPINGS_FOR_XML = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping <em>Xml Type Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTypeMapping()
- * @generated
- */
- public static final int XML_TYPE_MAPPING = 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType <em>Xml Persistent Type</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType()
- * @generated
- */
- public static final int XML_PERSISTENT_TYPE = 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntity <em>Xml Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlEntity
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntity()
- * @generated
- */
- public static final int XML_ENTITY = 9;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEmbeddable()
- * @generated
- */
- public static final int XML_EMBEDDABLE = 10;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMappedSuperclass()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS = 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAttributeMapping()
- * @generated
- */
- public static final int XML_ATTRIBUTE_MAPPING = 11;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute <em>Xml Persistent Attribute</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentAttribute()
- * @generated
- */
- public static final int XML_PERSISTENT_ATTRIBUTE = 24;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic <em>Xml Basic</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlBasic
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlBasic()
- * @generated
- */
- public static final int XML_BASIC = 13;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlId <em>Xml Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlId
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlId()
- * @generated
- */
- public static final int XML_ID = 14;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal <em>Persistence Unit Metadata Internal</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataInternal()
- * @generated
- */
- public static final int PERSISTENCE_UNIT_METADATA_INTERNAL = 25;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata <em>Persistence Unit Metadata</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadata()
- * @generated
- */
- public static final int PERSISTENCE_UNIT_METADATA = 26;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml <em>Persistence Unit Metadata For Xml</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataForXml()
- * @generated
- */
- public static final int PERSISTENCE_UNIT_METADATA_FOR_XML = 27;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal <em>Persistence Unit Defaults Internal</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsInternal()
- * @generated
- */
- public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL = 28;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults <em>Persistence Unit Defaults</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaults()
- * @generated
- */
- public static final int PERSISTENCE_UNIT_DEFAULTS = 29;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml <em>Persistence Unit Defaults For Xml</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml()
- * @generated
- */
- public static final int PERSISTENCE_UNIT_DEFAULTS_FOR_XML = 30;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping <em>Xml Multi Relationship Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMapping()
- * @generated
- */
- public static final int XML_MULTI_RELATIONSHIP_MAPPING = 21;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlOneToMany
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOneToMany()
- * @generated
- */
- public static final int XML_ONE_TO_MANY = 22;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlManyToMany
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlManyToMany()
- * @generated
- */
- public static final int XML_MANY_TO_MANY = 23;
-
- /**
* The feature id for the '<em><b>Persistence Unit Metadata</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -564,6 +381,16 @@ public class OrmPackage extends EPackageImpl
public static final int ENTITY_MAPPINGS_FEATURE_COUNT = 2;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml <em>Entity Mappings For Xml</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsForXml
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getEntityMappingsForXml()
+ * @generated
+ */
+ public static final int ENTITY_MAPPINGS_FOR_XML = 3;
+
+ /**
* The feature id for the '<em><b>Persistence Unit Metadata For Xml</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -591,6 +418,16 @@ public class OrmPackage extends EPackageImpl
public static final int ENTITY_MAPPINGS_FOR_XML_FEATURE_COUNT = 2;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping <em>Xml Type Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlTypeMapping()
+ * @generated
+ */
+ public static final int XML_TYPE_MAPPING = 4;
+
+ /**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -663,6 +500,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_TYPE_MAPPING_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 7;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentType <em>Xml Persistent Type</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentType
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentType()
+ * @generated
+ */
+ public static final int XML_PERSISTENT_TYPE = 5;
+
+ /**
* The feature id for the '<em><b>Mapping Key</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -744,6 +591,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_PERSISTENT_TYPE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 8;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMappedSuperclass()
+ * @generated
+ */
+ public static final int XML_MAPPED_SUPERCLASS = 6;
+
+ /**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1169,6 +1026,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_ENTITY_FOR_XML_FEATURE_COUNT = 2;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntity <em>Xml Entity</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlEntity
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntity()
+ * @generated
+ */
+ public static final int XML_ENTITY = 9;
+
+ /**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1412,6 +1279,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_ENTITY_FEATURE_COUNT = JpaCoreMappingsPackage.IENTITY_FEATURE_COUNT + 3;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEmbeddable()
+ * @generated
+ */
+ public static final int XML_EMBEDDABLE = 10;
+
+ /**
* The feature id for the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1484,6 +1361,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_EMBEDDABLE_FEATURE_COUNT = XML_TYPE_MAPPING_FEATURE_COUNT + 0;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlAttributeMapping()
+ * @generated
+ */
+ public static final int XML_ATTRIBUTE_MAPPING = 11;
+
+ /**
* The feature id for the '<em><b>Persistent Attribute</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1530,6 +1417,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_NULL_ATTRIBUTE_MAPPING_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic <em>Xml Basic</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlBasic
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlBasic()
+ * @generated
+ */
+ public static final int XML_BASIC = 13;
+
+ /**
* The feature id for the '<em><b>Persistent Attribute</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1611,6 +1508,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_BASIC_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlId <em>Xml Id</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlId
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlId()
+ * @generated
+ */
+ public static final int XML_ID = 14;
+
+ /**
* The feature id for the '<em><b>Persistent Attribute</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2068,6 +1975,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML_FEATURE_COUNT = 2;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping <em>Xml Multi Relationship Mapping</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMapping
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMapping()
+ * @generated
+ */
+ public static final int XML_MULTI_RELATIONSHIP_MAPPING = 21;
+
+ /**
* The feature id for the '<em><b>Target Entity</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2149,6 +2066,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_MULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlOneToMany
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOneToMany()
+ * @generated
+ */
+ public static final int XML_ONE_TO_MANY = 22;
+
+ /**
* The feature id for the '<em><b>Persistent Attribute</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2257,6 +2184,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_ONE_TO_MANY_FEATURE_COUNT = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL_FEATURE_COUNT + 0;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlManyToMany
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlManyToMany()
+ * @generated
+ */
+ public static final int XML_MANY_TO_MANY = 23;
+
+ /**
* The feature id for the '<em><b>Persistent Attribute</b></em>' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2365,13 +2302,23 @@ public class OrmPackage extends EPackageImpl
public static final int XML_MANY_TO_MANY_FEATURE_COUNT = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL_FEATURE_COUNT + 0;
/**
- * The feature id for the '<em><b>Mapping Key</b></em>' attribute.
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute <em>Xml Persistent Attribute</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentAttribute()
+ * @generated
+ */
+ public static final int XML_PERSISTENT_ATTRIBUTE = 24;
+
+ /**
+ * The feature id for the '<em><b>Mapping</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_PERSISTENT_ATTRIBUTE__MAPPING_KEY = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0;
+ public static final int XML_PERSISTENT_ATTRIBUTE__MAPPING = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2392,6 +2339,16 @@ public class OrmPackage extends EPackageImpl
public static final int XML_PERSISTENT_ATTRIBUTE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal <em>Persistence Unit Metadata Internal</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataInternal()
+ * @generated
+ */
+ public static final int PERSISTENCE_UNIT_METADATA_INTERNAL = 25;
+
+ /**
* The feature id for the '<em><b>Xml Mapping Metadata Complete For Xml</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2455,6 +2412,16 @@ public class OrmPackage extends EPackageImpl
public static final int PERSISTENCE_UNIT_METADATA_INTERNAL_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 6;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata <em>Persistence Unit Metadata</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadata
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadata()
+ * @generated
+ */
+ public static final int PERSISTENCE_UNIT_METADATA = 26;
+
+ /**
* The feature id for the '<em><b>Xml Mapping Metadata Complete</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2482,6 +2449,16 @@ public class OrmPackage extends EPackageImpl
public static final int PERSISTENCE_UNIT_METADATA_FEATURE_COUNT = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 2;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml <em>Persistence Unit Metadata For Xml</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataForXml
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitMetadataForXml()
+ * @generated
+ */
+ public static final int PERSISTENCE_UNIT_METADATA_FOR_XML = 27;
+
+ /**
* The feature id for the '<em><b>Xml Mapping Metadata Complete For Xml</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2509,6 +2486,16 @@ public class OrmPackage extends EPackageImpl
public static final int PERSISTENCE_UNIT_METADATA_FOR_XML_FEATURE_COUNT = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 2;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal <em>Persistence Unit Defaults Internal</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsInternal
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsInternal()
+ * @generated
+ */
+ public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL = 28;
+
+ /**
* The feature id for the '<em><b>Schema</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2626,6 +2613,16 @@ public class OrmPackage extends EPackageImpl
public static final int PERSISTENCE_UNIT_DEFAULTS_INTERNAL_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 12;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults <em>Persistence Unit Defaults</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaults
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaults()
+ * @generated
+ */
+ public static final int PERSISTENCE_UNIT_DEFAULTS = 29;
+
+ /**
* The feature id for the '<em><b>Schema</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2671,6 +2668,16 @@ public class OrmPackage extends EPackageImpl
public static final int PERSISTENCE_UNIT_DEFAULTS_FEATURE_COUNT = JpaCorePackage.IXML_EOBJECT_FEATURE_COUNT + 4;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml <em>Persistence Unit Defaults For Xml</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.PersistenceUnitDefaultsForXml
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getPersistenceUnitDefaultsForXml()
+ * @generated
+ */
+ public static final int PERSISTENCE_UNIT_DEFAULTS_FOR_XML = 30;
+
+ /**
* The feature id for the '<em><b>Schema For Xml</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5434,35 +5441,49 @@ public class OrmPackage extends EPackageImpl
* <!-- end-user-doc -->
* @generated
*/
- private EClass xmlEntityEClass = null;
+ private EClass xmlMappedSuperclassEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass xmlEmbeddableEClass = null;
+ private EClass xmlEntityInternalEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass xmlAttributeMappingEClass = null;
+ private EClass xmlEntityForXmlEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass xmlNullAttributeMappingEClass = null;
+ private EClass xmlEntityEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- private EClass xmlPersistentAttributeEClass = null;
+ private EClass xmlEmbeddableEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass xmlAttributeMappingEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass xmlNullAttributeMappingEClass = null;
/**
* <!-- begin-user-doc -->
@@ -5546,6 +5567,13 @@ public class OrmPackage extends EPackageImpl
* <!-- end-user-doc -->
* @generated
*/
+ private EClass xmlPersistentAttributeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass persistenceUnitMetadataInternalEClass = null;
/**
@@ -5773,27 +5801,6 @@ public class OrmPackage extends EPackageImpl
private EClass xmlQueryHintEClass = null;
/**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclassEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityInternalEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityForXmlEClass = null;
-
- /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -6121,6 +6128,19 @@ public class OrmPackage extends EPackageImpl
}
/**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSequenceGenerators <em>Sequence Generators</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Sequence Generators</em>'.
+ * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSequenceGenerators()
+ * @see #getEntityMappingsInternal()
+ * @generated
+ */
+ public EReference getEntityMappingsInternal_SequenceGenerators() {
+ return (EReference) entityMappingsInternalEClass.getEStructuralFeatures().get(16);
+ }
+
+ /**
* Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getTableGenerators <em>Table Generators</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6160,19 +6180,6 @@ public class OrmPackage extends EPackageImpl
}
/**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSequenceGenerators <em>Sequence Generators</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Sequence Generators</em>'.
- * @see org.eclipse.jpt.core.internal.content.orm.EntityMappingsInternal#getSequenceGenerators()
- * @see #getEntityMappingsInternal()
- * @generated
- */
- public EReference getEntityMappingsInternal_SequenceGenerators() {
- return (EReference) entityMappingsInternalEClass.getEStructuralFeatures().get(16);
- }
-
- /**
* Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappings <em>Entity Mappings</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6429,6 +6436,68 @@ public class OrmPackage extends EPackageImpl
}
/**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Xml Mapped Superclass</em>'.
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass
+ * @generated
+ */
+ public EClass getXmlMappedSuperclass() {
+ return xmlMappedSuperclassEClass;
+ }
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal <em>Xml Entity Internal</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Xml Entity Internal</em>'.
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal
+ * @generated
+ */
+ public EClass getXmlEntityInternal() {
+ return xmlEntityInternalEClass;
+ }
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml <em>Xml Entity For Xml</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Xml Entity For Xml</em>'.
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml
+ * @generated
+ */
+ public EClass getXmlEntityForXml() {
+ return xmlEntityForXmlEClass;
+ }
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getTableForXml <em>Table For Xml</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Table For Xml</em>'.
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getTableForXml()
+ * @see #getXmlEntityForXml()
+ * @generated
+ */
+ public EReference getXmlEntityForXml_TableForXml() {
+ return (EReference) xmlEntityForXmlEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getDiscriminatorColumnForXml <em>Discriminator Column For Xml</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Discriminator Column For Xml</em>'.
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getDiscriminatorColumnForXml()
+ * @see #getXmlEntityForXml()
+ * @generated
+ */
+ public EReference getXmlEntityForXml_DiscriminatorColumnForXml() {
+ return (EReference) xmlEntityForXmlEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
* Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntity <em>Xml Entity</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6529,31 +6598,6 @@ public class OrmPackage extends EPackageImpl
}
/**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute <em>Xml Persistent Attribute</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistent Attribute</em>'.
- * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute
- * @generated
- */
- public EClass getXmlPersistentAttribute() {
- return xmlPersistentAttributeEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute#getName()
- * @see #getXmlPersistentAttribute()
- * @generated
- */
- public EAttribute getXmlPersistentAttribute_Name() {
- return (EAttribute) xmlPersistentAttributeEClass.getEStructuralFeatures().get(0);
- }
-
- /**
* Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic <em>Xml Basic</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6712,6 +6756,31 @@ public class OrmPackage extends EPackageImpl
}
/**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute <em>Xml Persistent Attribute</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Xml Persistent Attribute</em>'.
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute
+ * @generated
+ */
+ public EClass getXmlPersistentAttribute() {
+ return xmlPersistentAttributeEClass;
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute#getName <em>Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Name</em>'.
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute#getName()
+ * @see #getXmlPersistentAttribute()
+ * @generated
+ */
+ public EAttribute getXmlPersistentAttribute_Name() {
+ return (EAttribute) xmlPersistentAttributeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
* Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal <em>Persistence Unit Metadata Internal</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7613,68 +7682,6 @@ public class OrmPackage extends EPackageImpl
}
/**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass</em>'.
- * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass
- * @generated
- */
- public EClass getXmlMappedSuperclass() {
- return xmlMappedSuperclassEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal <em>Xml Entity Internal</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity Internal</em>'.
- * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal
- * @generated
- */
- public EClass getXmlEntityInternal() {
- return xmlEntityInternalEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml <em>Xml Entity For Xml</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity For Xml</em>'.
- * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml
- * @generated
- */
- public EClass getXmlEntityForXml() {
- return xmlEntityForXmlEClass;
- }
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getTableForXml <em>Table For Xml</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the reference '<em>Table For Xml</em>'.
- * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getTableForXml()
- * @see #getXmlEntityForXml()
- * @generated
- */
- public EReference getXmlEntityForXml_TableForXml() {
- return (EReference) xmlEntityForXmlEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getDiscriminatorColumnForXml <em>Discriminator Column For Xml</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the reference '<em>Discriminator Column For Xml</em>'.
- * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml#getDiscriminatorColumnForXml()
- * @see #getXmlEntityForXml()
- * @generated
- */
- public EReference getXmlEntityForXml_DiscriminatorColumnForXml() {
- return (EReference) xmlEntityForXmlEClass.getEStructuralFeatures().get(1);
- }
-
- /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -8296,36 +8303,36 @@ public class OrmPackage extends EPackageImpl
public static final EReference ENTITY_MAPPINGS_INTERNAL__PERSISTENT_TYPES = eINSTANCE.getEntityMappingsInternal_PersistentTypes();
/**
- * The meta object literal for the '<em><b>Table Generators</b></em>' containment reference list feature.
+ * The meta object literal for the '<em><b>Sequence Generators</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public static final EReference ENTITY_MAPPINGS_INTERNAL__TABLE_GENERATORS = eINSTANCE.getEntityMappingsInternal_TableGenerators();
+ public static final EReference ENTITY_MAPPINGS_INTERNAL__SEQUENCE_GENERATORS = eINSTANCE.getEntityMappingsInternal_SequenceGenerators();
/**
- * The meta object literal for the '<em><b>Named Queries</b></em>' containment reference list feature.
+ * The meta object literal for the '<em><b>Table Generators</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public static final EReference ENTITY_MAPPINGS_INTERNAL__NAMED_QUERIES = eINSTANCE.getEntityMappingsInternal_NamedQueries();
+ public static final EReference ENTITY_MAPPINGS_INTERNAL__TABLE_GENERATORS = eINSTANCE.getEntityMappingsInternal_TableGenerators();
/**
- * The meta object literal for the '<em><b>Named Native Queries</b></em>' containment reference list feature.
+ * The meta object literal for the '<em><b>Named Queries</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public static final EReference ENTITY_MAPPINGS_INTERNAL__NAMED_NATIVE_QUERIES = eINSTANCE.getEntityMappingsInternal_NamedNativeQueries();
+ public static final EReference ENTITY_MAPPINGS_INTERNAL__NAMED_QUERIES = eINSTANCE.getEntityMappingsInternal_NamedQueries();
/**
- * The meta object literal for the '<em><b>Sequence Generators</b></em>' containment reference list feature.
+ * The meta object literal for the '<em><b>Named Native Queries</b></em>' containment reference list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public static final EReference ENTITY_MAPPINGS_INTERNAL__SEQUENCE_GENERATORS = eINSTANCE.getEntityMappingsInternal_SequenceGenerators();
+ public static final EReference ENTITY_MAPPINGS_INTERNAL__NAMED_NATIVE_QUERIES = eINSTANCE.getEntityMappingsInternal_NamedNativeQueries();
/**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.EntityMappings <em>Entity Mappings</em>}' class.
@@ -8496,6 +8503,52 @@ public class OrmPackage extends EPackageImpl
public static final EReference XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES = eINSTANCE.getXmlPersistentType_VirtualPersistentAttributes();
/**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMappedSuperclass()
+ * @generated
+ */
+ public static final EClass XML_MAPPED_SUPERCLASS = eINSTANCE.getXmlMappedSuperclass();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal <em>Xml Entity Internal</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityInternal()
+ * @generated
+ */
+ public static final EClass XML_ENTITY_INTERNAL = eINSTANCE.getXmlEntityInternal();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml <em>Xml Entity For Xml</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml()
+ * @generated
+ */
+ public static final EClass XML_ENTITY_FOR_XML = eINSTANCE.getXmlEntityForXml();
+
+ /**
+ * The meta object literal for the '<em><b>Table For Xml</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EReference XML_ENTITY_FOR_XML__TABLE_FOR_XML = eINSTANCE.getXmlEntityForXml_TableForXml();
+
+ /**
+ * The meta object literal for the '<em><b>Discriminator Column For Xml</b></em>' reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EReference XML_ENTITY_FOR_XML__DISCRIMINATOR_COLUMN_FOR_XML = eINSTANCE.getXmlEntityForXml_DiscriminatorColumnForXml();
+
+ /**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntity <em>Xml Entity</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -8568,24 +8621,6 @@ public class OrmPackage extends EPackageImpl
public static final EClass XML_NULL_ATTRIBUTE_MAPPING = eINSTANCE.getXmlNullAttributeMapping();
/**
- * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute <em>Xml Persistent Attribute</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentAttribute()
- * @generated
- */
- public static final EClass XML_PERSISTENT_ATTRIBUTE = eINSTANCE.getXmlPersistentAttribute();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENT_ATTRIBUTE__NAME = eINSTANCE.getXmlPersistentAttribute_Name();
-
- /**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlBasic <em>Xml Basic</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -8712,6 +8747,24 @@ public class OrmPackage extends EPackageImpl
public static final EClass XML_MANY_TO_MANY = eINSTANCE.getXmlManyToMany();
/**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute <em>Xml Persistent Attribute</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlPersistentAttribute()
+ * @generated
+ */
+ public static final EClass XML_PERSISTENT_ATTRIBUTE = eINSTANCE.getXmlPersistentAttribute();
+
+ /**
+ * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute XML_PERSISTENT_ATTRIBUTE__NAME = eINSTANCE.getXmlPersistentAttribute_Name();
+
+ /**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.PersistenceUnitMetadataInternal <em>Persistence Unit Metadata Internal</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -9344,51 +9397,5 @@ public class OrmPackage extends EPackageImpl
* @generated
*/
public static final EClass XML_QUERY_HINT = eINSTANCE.getXmlQueryHint();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMappedSuperclass()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS = eINSTANCE.getXmlMappedSuperclass();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal <em>Xml Entity Internal</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityInternal()
- * @generated
- */
- public static final EClass XML_ENTITY_INTERNAL = eINSTANCE.getXmlEntityInternal();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml <em>Xml Entity For Xml</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.core.internal.content.orm.XmlEntityForXml
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlEntityForXml()
- * @generated
- */
- public static final EClass XML_ENTITY_FOR_XML = eINSTANCE.getXmlEntityForXml();
-
- /**
- * The meta object literal for the '<em><b>Table For Xml</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_FOR_XML__TABLE_FOR_XML = eINSTANCE.getXmlEntityForXml_TableForXml();
-
- /**
- * The meta object literal for the '<em><b>Discriminator Column For Xml</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_FOR_XML__DISCRIMINATOR_COLUMN_FOR_XML = eINSTANCE.getXmlEntityForXml_DiscriminatorColumnForXml();
}
-} //JpaCoreXmlPackage
+} //OrmPackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasic.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasic.java
index 902791f127..28d7b929c6 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasic.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlBasic.java
@@ -1,8 +1,8 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 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.
+ * 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
@@ -696,4 +696,9 @@ public class XmlBasic extends XmlAttributeMapping
public int xmlSequence() {
return 1;
}
+
+ @Override
+ public boolean isOverridableAttributeMapping() {
+ return true;
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbedded.java
index 5615c83c2c..7c3a50f21a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbedded.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbedded.java
@@ -1,8 +1,8 @@
/*******************************************************************************
* Copyright (c) 2007 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.
+ * 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
@@ -308,19 +308,24 @@ public class XmlEmbedded extends XmlAttributeMapping implements IEmbedded
}
public Iterator<String> allOverridableAttributeNames() {
- if (embeddable() != null) {
- return new TransformationIterator(new FilteringIterator(embeddable().getPersistentType().attributes()) {
- protected boolean accept(Object o) {
- String key = ((IPersistentAttribute) o).getMappingKey();
- return key == IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY || key == IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
- }) {
- protected Object transform(Object next) {
- return ((IPersistentAttribute) next).getName();
- }
- };
+ return new TransformationIterator<IPersistentAttribute, String>(this.allOverridableAttributes()) {
+ @Override
+ protected String transform(IPersistentAttribute attribute) {
+ return attribute.getName();
+ }
+ };
+ }
+
+ public Iterator<IPersistentAttribute> allOverridableAttributes() {
+ if (this.embeddable() == null) {
+ return EmptyIterator.instance();
}
- return EmptyIterator.instance();
+ return new FilteringIterator<IPersistentAttribute>(this.embeddable().getPersistentType().attributes()) {
+ @Override
+ protected boolean accept(Object o) {
+ return ((IPersistentAttribute) o).isOverridableAttribute();
+ }
+ };
}
public IAttributeOverride createAttributeOverride(int index) {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedId.java
index e518537664..0cf1d64b91 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedId.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbeddedId.java
@@ -57,4 +57,9 @@ public class XmlEmbeddedId extends XmlAttributeMapping implements IEmbeddedId
public String getKey() {
return IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
}
-} // XmlEmbeddedId
+
+ @Override
+ public boolean isIdMapping() {
+ return true;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlId.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlId.java
index 4b94dccb2e..b45ab2960c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlId.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlId.java
@@ -1,8 +1,8 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 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.
+ * 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
@@ -669,4 +669,14 @@ public class XmlId extends XmlAttributeMapping
public ITableGenerator createTableGenerator() {
return OrmFactory.eINSTANCE.createXmlTableGenerator();
}
+
+ @Override
+ public boolean isOverridableAttributeMapping() {
+ return true;
+ }
+
+ @Override
+ public boolean isIdMapping() {
+ return true;
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOne.java
index b294986002..244e45f066 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOne.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlManyToOne.java
@@ -1,11 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 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
+ * Copyright (c) 2006, 2007 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
- *******************************************************************************/
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.core.internal.content.orm;
import org.eclipse.emf.ecore.EClass;
@@ -57,4 +58,9 @@ public class XmlManyToOne extends XmlSingleRelationshipMapping
protected void initializeOn(XmlAttributeMapping newMapping) {
newMapping.initializeFromXmlManyToOneMapping(this);
}
+
+ @Override
+ public boolean isOverridableAssociationMapping() {
+ return true;
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclass.java
index bdec6df23c..a3bd1285c3 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclass.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclass.java
@@ -1,8 +1,8 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 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.
+ * 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
@@ -72,27 +72,36 @@ public class XmlMappedSuperclass extends XmlTypeMapping
}
public Iterator<String> overridableAttributeNames() {
- return new TransformationIterator<IPersistentAttribute, String>(new FilteringIterator<IPersistentAttribute>(getPersistentType().attributes()) {
+ return this.namesOf(this.overridableAttributes());
+ }
+
+ public Iterator<IPersistentAttribute> overridableAttributes() {
+ return new FilteringIterator<IPersistentAttribute>(this.getPersistentType().attributes()) {
+ @Override
protected boolean accept(Object o) {
- String key = ((IPersistentAttribute) o).getMappingKey();
- return key == IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY || key == IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
- }) {
- protected String transform(IPersistentAttribute next) {
- return next.getName();
+ return ((IPersistentAttribute) o).isOverridableAttribute();
}
};
}
public Iterator<String> overridableAssociationNames() {
- return new TransformationIterator<IPersistentAttribute, String>(new FilteringIterator<IPersistentAttribute>(getPersistentType().attributes()) {
+ return this.namesOf(this.overridableAssociations());
+ }
+
+ public Iterator<IPersistentAttribute> overridableAssociations() {
+ return new FilteringIterator<IPersistentAttribute>(this.getPersistentType().attributes()) {
+ @Override
protected boolean accept(Object o) {
- String key = ((IPersistentAttribute) o).getMappingKey();
- return key == IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY || key == IMappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
+ return ((IPersistentAttribute) o).isOverridableAssociation();
}
- }) {
- protected String transform(IPersistentAttribute next) {
- return next.getName();
+ };
+ }
+
+ private Iterator<String> namesOf(Iterator<IPersistentAttribute> attributes) {
+ return new TransformationIterator<IPersistentAttribute, String>(attributes) {
+ @Override
+ protected String transform(IPersistentAttribute attribute) {
+ return attribute.getName();
}
};
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOne.java
index 98270a2ea9..3440896fd1 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOne.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOneToOne.java
@@ -1,8 +1,8 @@
/*******************************************************************************
* Copyright (c) 2007 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.
+ * 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
@@ -237,4 +237,9 @@ public class XmlOneToOne extends XmlSingleRelationshipMapping
public String getKey() {
return IMappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
}
-} // XmlOneToOne
+
+ @Override
+ public boolean isOverridableAssociationMapping() {
+ return true;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentAttribute.java
index 35f57f56f2..69948fa5f5 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentAttribute.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentAttribute.java
@@ -23,6 +23,7 @@ import org.eclipse.jpt.core.internal.JpaCorePackage;
import org.eclipse.jpt.core.internal.XmlEObject;
import org.eclipse.jpt.core.internal.content.java.JavaPersistentType;
import org.eclipse.jpt.core.internal.jdtutility.Attribute;
+import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
/**
* <!-- begin-user-doc -->
@@ -44,26 +45,6 @@ public class XmlPersistentAttribute extends XmlEObject
implements IPersistentAttribute
{
/**
- * The default value of the '{@link #getMappingKey() <em>Mapping Key</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappingKey()
- * @generated
- * @ordered
- */
- protected static final String MAPPING_KEY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMappingKey() <em>Mapping Key</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMappingKey()
- * @generated
- * @ordered
- */
- protected String mappingKey = MAPPING_KEY_EDEFAULT;
-
- /**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -85,11 +66,6 @@ public class XmlPersistentAttribute extends XmlEObject
private Collection<IXmlAttributeMappingProvider> attributeMappingProviders;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated NOT
- */
protected XmlPersistentAttribute() {
super();
this.attributeMappingProviders = buildAttributeMappingProviders();
@@ -110,11 +86,6 @@ public class XmlPersistentAttribute extends XmlEObject
return collection;
}
- protected XmlPersistentAttribute(String theMappingKey) {
- this();
- mappingKey = theMappingKey;
- }
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -125,45 +96,6 @@ public class XmlPersistentAttribute extends XmlEObject
return OrmPackage.Literals.XML_PERSISTENT_ATTRIBUTE;
}
- /* @see IJpaContentNode#getId() */
- public Object getId() {
- return IXmlContentNodes.PERSISTENT_ATTRIBUTE_ID;
- }
-
- /**
- * Returns the value of the '<em><b>Mapping Key</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mapping Key</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mapping Key</em>' attribute.
- * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIPersistentAttribute_MappingKey()
- * @model required="true" changeable="false"
- * @generated
- */
- public String getMappingKey() {
- return mappingKey;
- }
-
- public void setMappingKey(String newMappingKey, boolean default_) {
- if (mappingKey == newMappingKey) {
- return;
- }
- XmlAttributeMapping oldMapping = getMapping();
- XmlPersistentType persistentType = oldMapping.getPersistentType();
- persistentType.changeMapping(oldMapping, newMappingKey);
- setMappingKeyInternal(newMappingKey);
- }
-
- protected void setMappingKeyInternal(String newMappingKey) {
- String oldMappingKey = mappingKey;
- mappingKey = newMappingKey;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING_KEY, oldMappingKey, mappingKey));
- }
-
/**
* Returns the value of the '<em><b>Name</b></em>' attribute.
* <!-- begin-user-doc -->
@@ -197,40 +129,6 @@ public class XmlPersistentAttribute extends XmlEObject
eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME, oldName, name));
}
- public Iterator candidateMappingKeys() {
- Collection mappingKeys = new ArrayList();
- for (IXmlAttributeMappingProvider provider : attributeMappingProviders()) {
- mappingKeys.add(provider.key());
- }
- return mappingKeys.iterator();
- }
-
- public Collection<IXmlAttributeMappingProvider> attributeMappingProviders() {
- return this.attributeMappingProviders;
- }
-
- public XmlAttributeMapping getMapping() {
- return (XmlAttributeMapping) eContainer();
- }
-
- public XmlPersistentType persistentType() {
- return getMapping().getPersistentType();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @model kind="operation" required="true"
- * @generated NOT
- */
- public ITypeMapping typeMapping() {
- return persistentType().getMapping();
- }
-
- public boolean isVirtual() {
- return persistentType().getVirtualPersistentAttributes().contains(this);
- }
-
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -239,8 +137,6 @@ public class XmlPersistentAttribute extends XmlEObject
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING_KEY :
- return getMappingKey();
case OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME :
return getName();
}
@@ -285,8 +181,6 @@ public class XmlPersistentAttribute extends XmlEObject
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING_KEY :
- return MAPPING_KEY_EDEFAULT == null ? mappingKey != null : !MAPPING_KEY_EDEFAULT.equals(mappingKey);
case OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME :
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
}
@@ -308,8 +202,8 @@ public class XmlPersistentAttribute extends XmlEObject
}
if (baseClass == IPersistentAttribute.class) {
switch (derivedFeatureID) {
- case OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING_KEY :
- return JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING_KEY;
+ case OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING :
+ return JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING;
default :
return -1;
}
@@ -332,8 +226,8 @@ public class XmlPersistentAttribute extends XmlEObject
}
if (baseClass == IPersistentAttribute.class) {
switch (baseFeatureID) {
- case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING_KEY :
- return OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING_KEY;
+ case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING :
+ return OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING;
default :
return -1;
}
@@ -351,14 +245,61 @@ public class XmlPersistentAttribute extends XmlEObject
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
- result.append(" (mappingKey: ");
- result.append(mappingKey);
- result.append(", name: ");
+ result.append(" (name: ");
result.append(name);
result.append(')');
return result.toString();
}
+ public XmlAttributeMapping getMapping() {
+ return (XmlAttributeMapping) eContainer();
+ }
+
+ public String mappingKey() {
+ return this.getMapping().getKey();
+ }
+
+ public String defaultMappingKey() {
+ return null;
+ }
+
+ public void setSpecifiedMappingKey(String newKey) {
+ String oldKey = this.mappingKey();
+ if (newKey == oldKey) {
+ return;
+ }
+ this.persistentType().changeMapping(this.getMapping(), newKey);
+ }
+
+ public Object getId() {
+ return IXmlContentNodes.PERSISTENT_ATTRIBUTE_ID;
+ }
+
+ public Iterator<String> candidateMappingKeys() {
+ return new TransformationIterator<IXmlAttributeMappingProvider, String>(this.attributeMappingProviders.iterator()) {
+ @Override
+ protected String transform(IXmlAttributeMappingProvider provider) {
+ return provider.key();
+ }
+ };
+ }
+
+ public Collection<IXmlAttributeMappingProvider> attributeMappingProviders() {
+ return this.attributeMappingProviders;
+ }
+
+ public XmlPersistentType persistentType() {
+ return getMapping().getPersistentType();
+ }
+
+ public ITypeMapping typeMapping() {
+ return persistentType().getMapping();
+ }
+
+ public boolean isVirtual() {
+ return persistentType().getVirtualPersistentAttributes().contains(this);
+ }
+
public Attribute getAttribute() {
JavaPersistentType javaPersistentType = ((XmlPersistentType) typeMapping().getPersistentType()).findJavaPersistentType();
if (javaPersistentType == null) {
@@ -373,26 +314,28 @@ public class XmlPersistentAttribute extends XmlEObject
return null;
}
- public String defaultKey() {
- // TODO Auto-generated method stub
- return null;
- }
-
public String primaryKeyColumnName() {
return getMapping().primaryKeyColumnName();
}
@Override
public ITextRange getTextRange() {
- if (isVirtual()) {
- return persistentType().getAttributesTextRange();
- }
- else {
- return getMapping().getTextRange();
- }
+ return (this.isVirtual()) ? this.persistentType().getAttributesTextRange() : this.getMapping().getTextRange();
}
public ITextRange getNameTextRange() {
return getMapping().getNameTextRange();
}
-} \ No newline at end of file
+
+ public boolean isOverridableAttribute() {
+ return this.getMapping().isOverridableAttributeMapping();
+ }
+
+ public boolean isOverridableAssociation() {
+ return this.getMapping().isOverridableAssociationMapping();
+ }
+
+ public boolean isIdAttribute() {
+ return this.getMapping().isIdMapping();
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEntityContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEntityContext.java
index 25a5d62c74..668c1c5a5c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEntityContext.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaEntityContext.java
@@ -1,18 +1,18 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 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
+ * Copyright (c) 2006, 2007 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
- *******************************************************************************/
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.core.internal.platform;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
-import org.eclipse.jpt.core.internal.IMappingKeys;
import org.eclipse.jpt.core.internal.IPersistentAttribute;
import org.eclipse.jpt.core.internal.IPersistentType;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverride;
@@ -275,14 +275,16 @@ public class JavaEntityContext extends JavaTypeContext
}
private boolean entityHasNoId() {
- for (Iterator<IPersistentAttribute> stream = getEntity().getPersistentType().allAttributes(); stream.hasNext(); ) {
- IPersistentAttribute persistentAttribute = stream.next();
- String mappingKey = persistentAttribute.getMappingKey();
- if (mappingKey == IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY
- || mappingKey == IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY) {
- return false;
+ return ! this.entityHasId();
+ }
+
+ private boolean entityHasId() {
+ for (Iterator<IPersistentAttribute> stream = this.getEntity().getPersistentType().allAttributes(); stream.hasNext(); ) {
+ if (stream.next().isIdAttribute()) {
+ return true;
}
}
- return true;
+ return false;
}
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEntityContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEntityContext.java
index b8b115c063..2c067aecd5 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEntityContext.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlEntityContext.java
@@ -1,11 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 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
+ * Copyright (c) 2006, 2007 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
- *******************************************************************************/
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.core.internal.platform;
import java.util.ArrayList;
@@ -351,14 +352,16 @@ public class XmlEntityContext extends XmlTypeContext
}
private boolean entityHasNoId() {
- for (Iterator<IPersistentAttribute> stream = getEntity().getPersistentType().allAttributes(); stream.hasNext(); ) {
- IPersistentAttribute persistentAttribute = stream.next();
- String mappingKey = persistentAttribute.getMappingKey();
- if (mappingKey == IMappingKeys.ID_ATTRIBUTE_MAPPING_KEY
- || mappingKey == IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY) {
- return false;
+ return ! this.entityHasId();
+ }
+
+ private boolean entityHasId() {
+ for (Iterator<IPersistentAttribute> stream = this.getEntity().getPersistentType().allAttributes(); stream.hasNext(); ) {
+ if (stream.next().isIdAttribute()) {
+ return true;
}
}
- return true;
+ return false;
}
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTypeContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTypeContext.java
index 08a00cdbf4..b73079a2da 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTypeContext.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlTypeContext.java
@@ -265,7 +265,7 @@ public abstract class XmlTypeContext extends BaseContext
XmlAttributeMapping xmlAttributeMapping = null;
String mappingKey;
if (persistentType.getMapping().isXmlMetadataComplete()) {
- mappingKey = javaAttribute.defaultKey();
+ mappingKey = javaAttribute.defaultMappingKey();
}
else {
mappingKey = javaAttribute.getMapping().getKey();
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java
index 814ca005f7..e9b3bce03a 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PersistentAttributeDetailsPage.java
@@ -1,11 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 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
- *******************************************************************************/
+ * Copyright (c) 2006, 2007 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.ui.internal.details;
import java.util.ArrayList;
@@ -64,9 +65,9 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
private CComboViewer mappingCombo;
- private Map mappingComposites;
+ private Map<String, IJpaComposite<IAttributeMapping>> mappingComposites;
protected PageBook mappingPageBook;
- private IJpaComposite currentMappingComposite;
+ private IJpaComposite<IAttributeMapping> currentMappingComposite;
/**
* These IAtttributeMappingUiProviders will be used as elements in the attributeMapping combo
@@ -83,7 +84,7 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
super(parent, SWT.NONE, new BasicCommandStack(), widgetFactory);
persistentAttributeListener = buildAttributeListener();
attributeMappingListener = buildAttributeMappingListener();
- mappingComposites = new HashMap();
+ mappingComposites = new HashMap<String, IJpaComposite<IAttributeMapping>>();
this.attributeMappingUiProviders = buildAttributeMappingUiProviders();
this.defaultAttributeMappingUiProviders = buildDefaultAttributeMappingUiProviders();
this.nullAttributeMappingUiProvider = buildNullAttributeMappingUiProvider();
@@ -94,18 +95,18 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
}
protected Collection<IAttributeMappingUiProvider> buildAttributeMappingUiProviders() {
- Collection<IAttributeMappingUiProvider> attributeMappingUiProviders = new ArrayList<IAttributeMappingUiProvider>();
- attributeMappingUiProviders.add(BasicMappingUiProvider.instance());
- attributeMappingUiProviders.add(EmbeddedMappingUiProvider.instance());
- attributeMappingUiProviders.add(EmbeddedIdMappingUiProvider.instance());
- attributeMappingUiProviders.add(IdMappingUiProvider.instance());
- attributeMappingUiProviders.add(ManyToManyMappingUiProvider.instance());
- attributeMappingUiProviders.add(ManyToOneMappingUiProvider.instance());
- attributeMappingUiProviders.add(OneToManyMappingUiProvider.instance());
- attributeMappingUiProviders.add(OneToOneMappingUiProvider.instance());
- attributeMappingUiProviders.add(TransientMappingUiProvider.instance());
- attributeMappingUiProviders.add(VersionMappingUiProvider.instance());
- return attributeMappingUiProviders;
+ Collection<IAttributeMappingUiProvider> providers = new ArrayList<IAttributeMappingUiProvider>();
+ providers.add(BasicMappingUiProvider.instance());
+ providers.add(EmbeddedMappingUiProvider.instance());
+ providers.add(EmbeddedIdMappingUiProvider.instance());
+ providers.add(IdMappingUiProvider.instance());
+ providers.add(ManyToManyMappingUiProvider.instance());
+ providers.add(ManyToOneMappingUiProvider.instance());
+ providers.add(OneToManyMappingUiProvider.instance());
+ providers.add(OneToOneMappingUiProvider.instance());
+ providers.add(TransientMappingUiProvider.instance());
+ providers.add(VersionMappingUiProvider.instance());
+ return providers;
}
protected Collection<IAttributeMappingUiProvider> attributeMappingUiProviders() {
@@ -113,12 +114,10 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
}
protected Collection<IAttributeMappingUiProvider> buildDefaultAttributeMappingUiProviders() {
- if (this.defaultAttributeMappingUiProviders == null) {
- this.defaultAttributeMappingUiProviders = new ArrayList<IAttributeMappingUiProvider>();
- this.defaultAttributeMappingUiProviders.add(DefaultBasicMappingUiProvider.instance());
- this.defaultAttributeMappingUiProviders.add(DefaultEmbeddedMappingUiProvider.instance());
- }
- return this.defaultAttributeMappingUiProviders;
+ Collection<IAttributeMappingUiProvider> providers = new ArrayList<IAttributeMappingUiProvider>();
+ providers.add(DefaultBasicMappingUiProvider.instance());
+ providers.add(DefaultEmbeddedMappingUiProvider.instance());
+ return providers;
}
protected Collection<IAttributeMappingUiProvider> defaultAttributeMappingUiProviders() {
@@ -144,15 +143,16 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
private Adapter buildAttributeListener() {
return new AdapterImpl() {
+ @Override
public void notifyChanged(Notification notification) {
persistentAttributeChanged(notification);
}
};
}
- private void persistentAttributeChanged(Notification notification) {
+ void persistentAttributeChanged(Notification notification) {
switch (notification.getFeatureID(IPersistentAttribute.class)) {
- case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING_KEY:
+ case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING:
Display.getDefault().asyncExec(
new Runnable() {
public void run() {
@@ -165,13 +165,14 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
private Adapter buildAttributeMappingListener() {
return new AdapterImpl() {
+ @Override
public void notifyChanged(Notification notification) {
attributeMappingChanged(notification);
}
};
}
- private void attributeMappingChanged(Notification notification) {
+ void attributeMappingChanged(Notification notification) {
// switch (notification.getFeatureID(IAttributeMapping.class)) {
// case JpaCorePackage.IATTRIBUTE_MAPPING__DEFAULT:
// Display.getDefault().asyncExec(
@@ -220,19 +221,18 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
};
}
- private IAttributeMappingUiProvider[] uiProvidersFor(IPersistentAttribute persistentAttribute) {
+ IAttributeMappingUiProvider[] uiProvidersFor(IPersistentAttribute persistentAttribute) {
IAttributeMappingUiProvider[] providers = new IAttributeMappingUiProvider[attributeMappingUiProviders().size() +1];
providers[0] = this.nullAttributeMappingUiProvider;
for (IAttributeMappingUiProvider uiProvider : defaultAttributeMappingUiProviders()) {
- if (uiProvider.key() == persistentAttribute.defaultKey()) {
+ if (uiProvider.key() == persistentAttribute.defaultMappingKey()) {
providers[0] = uiProvider;
break;
}
}
- int i = 0;
+ int i = 1;
for (IAttributeMappingUiProvider uiProvider : attributeMappingUiProviders()) {
- i++;
- providers[i] = uiProvider;
+ providers[i++] = uiProvider;
}
return providers;
}
@@ -251,7 +251,7 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
return mappingPageBook;
}
- protected IJpaComposite buildMappingComposite(PageBook pageBook, String key) {
+ protected IJpaComposite<IAttributeMapping> buildMappingComposite(PageBook pageBook, String key) {
if (this.attributeMapping == null || this.attributeMapping.isDefault()) {
return defaultAttributeMappingUiProvider(key).buildAttributeMappingComposite(pageBook, this.commandStack, getWidgetFactory());
}
@@ -259,14 +259,14 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
return attributeMappingUiProvider(key).buildAttributeMappingComposite(pageBook, this.commandStack, getWidgetFactory());
}
- private void mappingChanged(SelectionChangedEvent event) {
+ void mappingChanged(SelectionChangedEvent event) {
if (isPopulating()) {
return;
}
if (event.getSelection() instanceof StructuredSelection) {
IAttributeMappingUiProvider provider = (IAttributeMappingUiProvider) ((StructuredSelection) event.getSelection()).getFirstElement();
- boolean default_ = defaultAttributeMappingUiProviders().contains(provider);
- attribute.setMappingKey(provider.key(), default_);
+ String key = (this.defaultAttributeMappingUiProviders().contains(provider) ? null : provider.key());
+ attribute.setSpecifiedMappingKey(key);
}
}
@@ -281,6 +281,7 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
populateMappingComboAndPage();
}
+ @Override
protected void engageListeners() {
if (attribute != null) {
attribute.eAdapters().add(persistentAttributeListener);
@@ -290,6 +291,7 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
}
}
+ @Override
protected void disengageListeners() {
if (attribute != null) {
attribute.eAdapters().remove(persistentAttributeListener);
@@ -335,14 +337,14 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
currentMappingKey = mappingKey;
- IJpaComposite composite = mappingCompositeFor(mappingKey);
+ IJpaComposite<IAttributeMapping> composite = mappingCompositeFor(mappingKey);
mappingPageBook.showPage(composite.getControl());
currentMappingComposite = composite;
currentMappingComposite.populate(attributeMapping);
}
- private void setComboData(Iterator availableMappingKeys) {
+ private void setComboData(Iterator<String> availableMappingKeys) {
if (attribute != mappingCombo.getInput()) {
mappingCombo.setInput(attribute);
}
@@ -350,15 +352,15 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
mappingCombo.setSelection(new StructuredSelection(mappingCombo.getElementAt(0)));
}
else {
- IAttributeMappingUiProvider provider = attributeMappingUiProvider(attribute.getMappingKey());
+ IAttributeMappingUiProvider provider = attributeMappingUiProvider(attribute.mappingKey());
if (provider != null && ! provider.equals(((StructuredSelection) mappingCombo.getSelection()).getFirstElement())) {
mappingCombo.setSelection(new StructuredSelection(provider));
}
}
}
- private IJpaComposite mappingCompositeFor(String key) {
- IJpaComposite composite = (IJpaComposite) mappingComposites.get(key);
+ private IJpaComposite<IAttributeMapping> mappingCompositeFor(String key) {
+ IJpaComposite<IAttributeMapping> composite = mappingComposites.get(key);
if (composite != null) {
return composite;
}
@@ -378,10 +380,11 @@ public abstract class PersistentAttributeDetailsPage extends BaseJpaDetailsPage
// return mappingCombo.getCombo().setFocus();
// }
+ @Override
public void dispose() {
disengageListeners();
- for (Iterator i = mappingComposites.values().iterator(); i.hasNext(); ) {
- ((IJpaComposite) i.next()).dispose();
+ for (Iterator<IJpaComposite<IAttributeMapping>> stream = mappingComposites.values().iterator(); stream.hasNext(); ) {
+ stream.next().dispose();
}
super.dispose();
}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java
index b6a61ec7a4..882208beb7 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/java/structure/JavaPersistentAttributeItemProvider.java
@@ -1,13 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2007 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
- *******************************************************************************/
+ * Copyright (c) 2007 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.ui.internal.java.structure;
import org.eclipse.emf.common.notify.AdapterFactory;
@@ -92,7 +91,7 @@ public class JavaPersistentAttributeItemProvider extends ItemProviderAdapter
updateChildren(notification);
switch (notification.getFeatureID(IPersistentAttribute.class)) {
- case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING_KEY:
+ case JpaCorePackage.IPERSISTENT_ATTRIBUTE__MAPPING:
fireNotifyChanged(new ViewerNotification(notification, notification
.getNotifier(), false, true));
return;
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java
index 524a814c87..a306697493 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/xml/structure/XmlPersistentAttributeItemProvider.java
@@ -1,11 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 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
- *******************************************************************************/
+ * Copyright (c) 2006, 2007 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.ui.internal.xml.structure;
import org.eclipse.emf.common.notify.AdapterFactory;
@@ -91,7 +92,7 @@ public class XmlPersistentAttributeItemProvider extends ItemProviderAdapter
updateChildren(notification);
switch (notification.getFeatureID(XmlPersistentAttribute.class)) {
- case OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING_KEY:
+ case OrmPackage.XML_PERSISTENT_ATTRIBUTE__MAPPING:
case OrmPackage.XML_PERSISTENT_ATTRIBUTE__NAME:
fireNotifyChanged(new ViewerNotification(notification, notification
.getNotifier(), false, true));

Back to the top