Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2007-05-17 14:43:34 +0000
committerkmoore2007-05-17 14:43:34 +0000
commit45df0e2b58b5b18fe68f56a427f2ce735401f693 (patch)
tree8365d3a845f4bbd7babf4d965b0f3e8f4bb9e29d
parent50fe83b6b93f4f3cefbe1373689d81763bc72288 (diff)
downloadwebtools.dali-45df0e2b58b5b18fe68f56a427f2ce735401f693.tar.gz
webtools.dali-45df0e2b58b5b18fe68f56a427f2ce735401f693.tar.xz
webtools.dali-45df0e2b58b5b18fe68f56a427f2ce735401f693.zip
181073 - ClassCastException switching xml type mappings
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/orm.ecore5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/JpaCorePackage.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JpaJavaPackage.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEmbedded.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEmbedded.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityInternal.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdClass.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMappedSuperclass.java143
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentAttribute.java1
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MappedSuperclassTranslator.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/JavaClassRef.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMultiRelationshipMappingContext.java6
21 files changed, 214 insertions, 45 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel b/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
index d8d22e7810..46170d1128 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
+++ b/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
@@ -522,7 +522,9 @@
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference orm.ecore#//XmlPersistentType/specifiedPersistentAttributes"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference orm.ecore#//XmlPersistentType/virtualPersistentAttributes"/>
</genClasses>
- <genClasses ecoreClass="orm.ecore#//XmlMappedSuperclass"/>
+ <genClasses ecoreClass="orm.ecore#//XmlMappedSuperclass">
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMappedSuperclass/idClassForXml"/>
+ </genClasses>
<genClasses ecoreClass="orm.ecore#//XmlEntityInternal"/>
<genClasses ecoreClass="orm.ecore#//XmlEntityForXml">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference orm.ecore#//XmlEntityForXml/tableForXml"/>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore b/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
index e6f628b2cc..113446be18 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
+++ b/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
@@ -83,7 +83,10 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="virtualPersistentAttributes"
upperBound="-1" eType="#//XmlPersistentAttribute" resolveProxies="false"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass" eSuperTypes="#//XmlTypeMapping core.ecore#//mappings/IMappedSuperclass"/>
+ <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass" eSuperTypes="#//XmlTypeMapping core.ecore#//mappings/IMappedSuperclass">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="idClassForXml" eType="#//XmlIdClass"
+ containment="true" resolveProxies="false"/>
+ </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="XmlEntityInternal" eSuperTypes="#//XmlTypeMapping #//XmlEntityForXml #//XmlEntity"/>
<eClassifiers xsi:type="ecore:EClass" name="XmlEntityForXml" abstract="true" interface="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="tableForXml" eType="#//XmlTable"
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java
index 0e98a0841b..bb58e2c118 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/IJpaPlatform.java
@@ -55,9 +55,7 @@ public interface IJpaPlatform
*/
void setProject(IJpaProject jpaProject);
-
// ********** Persistence Unit ********************************************
-
boolean containsPersistenceUnitNamed(String name);
PersistenceUnit persistenceUnitNamed(String name);
@@ -66,17 +64,13 @@ public interface IJpaPlatform
int persistenceUnitSize();
-
// ********** Persistent Types ********************************************
-
/**
* Return all persistent types for the persistence unit with the given name
*/
Iterator<IPersistentType> persistentTypes(String persistenceUnitName);
-
-
+
// ************************************************************************
-
/**
* Get the valid persistence XML files from the project
*/
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 0be500a7e0..0ff0f2c762 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
@@ -17,7 +17,6 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jem.java.JavaRefPackage;
import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage;
import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage;
import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
@@ -827,7 +826,6 @@ public class JpaCorePackage extends EPackageImpl
isInited = true;
// Initialize simple dependencies
EcorePackage.eINSTANCE.eClass();
- JavaRefPackage.eINSTANCE.eClass();
// Obtain or create and register interdependencies
JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) instanceof JpaCoreMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) : JpaCoreMappingsPackage.eINSTANCE);
JpaJavaPackage theJpaJavaPackage = (JpaJavaPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) instanceof JpaJavaPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) : JpaJavaPackage.eINSTANCE);
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 33ea8c9570..120ef850cf 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
@@ -15,7 +15,6 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jem.java.JavaRefPackage;
import org.eclipse.jpt.core.internal.JpaCorePackage;
import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage;
import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
@@ -382,7 +381,6 @@ public class JpaJavaPackage extends EPackageImpl
isInited = true;
// Initialize simple dependencies
EcorePackage.eINSTANCE.eClass();
- JavaRefPackage.eINSTANCE.eClass();
// Obtain or create and register interdependencies
JpaCorePackage theJpaCorePackage = (JpaCorePackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) instanceof JpaCorePackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) : JpaCorePackage.eINSTANCE);
JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) instanceof JpaCoreMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) : JpaCoreMappingsPackage.eINSTANCE);
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 d4551755c8..91119c2750 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
@@ -230,7 +230,7 @@ public class JavaEmbedded extends JavaAttributeMapping implements IEmbedded
}
public EList<IAttributeOverride> getAttributeOverrides() {
- EList<IAttributeOverride> list = new BasicEList<IAttributeOverride>();
+ EList<IAttributeOverride> list = new EObjectContainmentEList<IAttributeOverride>(IAttributeOverride.class, this, JpaJavaMappingsPackage.JAVA_EMBEDDED__ATTRIBUTE_OVERRIDES);
list.addAll(getSpecifiedAttributeOverrides());
list.addAll(getDefaultAttributeOverrides());
return list;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java
index 462c868876..9a54e511d2 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java
@@ -1641,7 +1641,7 @@ public class JavaEntity extends JavaTypeMapping implements IEntity
}
public EList<IAttributeOverride> getAttributeOverrides() {
- EList<IAttributeOverride> list = new BasicEList<IAttributeOverride>();
+ EList<IAttributeOverride> list = new EObjectContainmentEList<IAttributeOverride>(IAttributeOverride.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__ATTRIBUTE_OVERRIDES);
list.addAll(getSpecifiedAttributeOverrides());
list.addAll(getDefaultAttributeOverrides());
return list;
@@ -1726,7 +1726,7 @@ public class JavaEntity extends JavaTypeMapping implements IEntity
}
public EList<IAssociationOverride> getAssociationOverrides() {
- EList<IAssociationOverride> list = new BasicEList<IAssociationOverride>();
+ EList<IAssociationOverride> list = new EObjectContainmentEList<IAssociationOverride>(IAssociationOverride.class, this, JpaJavaMappingsPackage.JAVA_ENTITY__ASSOCIATION_OVERRIDES);
list.addAll(getSpecifiedAssociationOverrides());
list.addAll(getDefaultAssociationOverrides());
return list;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java
index 757ada9d1b..f875b9acbe 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java
@@ -21,7 +21,6 @@ import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.Expression;
import org.eclipse.jpt.core.internal.IPersistentType;
import org.eclipse.jpt.core.internal.ITypeMapping;
-import org.eclipse.jpt.core.internal.content.java.JavaPersistentType;
import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
import org.eclipse.jpt.core.internal.jdtutility.Attribute;
import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter;
@@ -595,9 +594,8 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
return JDTTools.resolve(Signature.toString(signature), jdtType);
}
- //TODO grr, this will cause ClassCastExceptions, how should I handle it??
public IEntity getEntity() {
- ITypeMapping typeMapping = ((JavaPersistentType) eContainer().eContainer()).getMapping();
+ ITypeMapping typeMapping = typeMapping();
if (typeMapping instanceof IEntity) {
return (IEntity) typeMapping;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java
index 79c4be0f42..68d20ef27d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java
@@ -13,7 +13,6 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jem.java.JavaRefPackage;
import org.eclipse.jpt.core.internal.JpaCorePackage;
import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage;
import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
@@ -3933,7 +3932,6 @@ public class JpaJavaMappingsPackage extends EPackageImpl
isInited = true;
// Initialize simple dependencies
EcorePackage.eINSTANCE.eClass();
- JavaRefPackage.eINSTANCE.eClass();
// Obtain or create and register interdependencies
JpaCorePackage theJpaCorePackage = (JpaCorePackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) instanceof JpaCorePackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) : JpaCorePackage.eINSTANCE);
JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) instanceof JpaCoreMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) : JpaCoreMappingsPackage.eINSTANCE);
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 e925faf222..78dc86ccf0 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
@@ -15,7 +15,6 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jem.java.JavaRefPackage;
import org.eclipse.jpt.core.internal.JpaCorePackage;
import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage;
import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage;
@@ -673,13 +672,22 @@ public class OrmPackage extends EPackageImpl
public static final int XML_MAPPED_SUPERCLASS__ID_CLASS = XML_TYPE_MAPPING_FEATURE_COUNT + 0;
/**
+ * The feature id for the '<em><b>Id Class For Xml</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML = XML_TYPE_MAPPING_FEATURE_COUNT + 1;
+
+ /**
* The number of structural features of the '<em>Xml Mapped Superclass</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_MAPPED_SUPERCLASS_FEATURE_COUNT = XML_TYPE_MAPPING_FEATURE_COUNT + 1;
+ public static final int XML_MAPPED_SUPERCLASS_FEATURE_COUNT = XML_TYPE_MAPPING_FEATURE_COUNT + 2;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlEntityInternal <em>Xml Entity Internal</em>}' class.
@@ -6373,7 +6381,6 @@ public class OrmPackage extends EPackageImpl
isInited = true;
// Initialize simple dependencies
EcorePackage.eINSTANCE.eClass();
- JavaRefPackage.eINSTANCE.eClass();
// Obtain or create and register interdependencies
JpaCorePackage theJpaCorePackage = (JpaCorePackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) instanceof JpaCorePackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) : JpaCorePackage.eINSTANCE);
JpaCoreMappingsPackage theJpaCoreMappingsPackage = (JpaCoreMappingsPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) instanceof JpaCoreMappingsPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCoreMappingsPackage.eNS_URI) : JpaCoreMappingsPackage.eINSTANCE);
@@ -6965,6 +6972,19 @@ public class OrmPackage extends EPackageImpl
}
/**
+ * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass#getIdClassForXml <em>Id Class For Xml</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Id Class For Xml</em>'.
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass#getIdClassForXml()
+ * @see #getXmlMappedSuperclass()
+ * @generated
+ */
+ public EReference getXmlMappedSuperclass_IdClassForXml() {
+ return (EReference) xmlMappedSuperclassEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
* 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 -->
@@ -8360,6 +8380,7 @@ public class OrmPackage extends EPackageImpl
createEReference(xmlPersistentTypeEClass, XML_PERSISTENT_TYPE__SPECIFIED_PERSISTENT_ATTRIBUTES);
createEReference(xmlPersistentTypeEClass, XML_PERSISTENT_TYPE__VIRTUAL_PERSISTENT_ATTRIBUTES);
xmlMappedSuperclassEClass = createEClass(XML_MAPPED_SUPERCLASS);
+ createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML);
xmlEntityInternalEClass = createEClass(XML_ENTITY_INTERNAL);
xmlEntityForXmlEClass = createEClass(XML_ENTITY_FOR_XML);
createEReference(xmlEntityForXmlEClass, XML_ENTITY_FOR_XML__TABLE_FOR_XML);
@@ -8660,6 +8681,7 @@ public class OrmPackage extends EPackageImpl
initEReference(getXmlPersistentType_SpecifiedPersistentAttributes(), this.getXmlPersistentAttribute(), null, "specifiedPersistentAttributes", null, 0, -1, XmlPersistentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getXmlPersistentType_VirtualPersistentAttributes(), this.getXmlPersistentAttribute(), null, "virtualPersistentAttributes", null, 0, -1, XmlPersistentType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(xmlMappedSuperclassEClass, XmlMappedSuperclass.class, "XmlMappedSuperclass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getXmlMappedSuperclass_IdClassForXml(), this.getXmlIdClass(), null, "idClassForXml", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(xmlEntityInternalEClass, XmlEntityInternal.class, "XmlEntityInternal", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(xmlEntityForXmlEClass, XmlEntityForXml.class, "XmlEntityForXml", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getXmlEntityForXml_TableForXml(), this.getXmlTable(), null, "tableForXml", null, 0, 1, XmlEntityForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -9154,6 +9176,14 @@ public class OrmPackage extends EPackageImpl
public static final EClass XML_MAPPED_SUPERCLASS = eINSTANCE.getXmlMappedSuperclass();
/**
+ * The meta object literal for the '<em><b>Id Class For Xml</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EReference XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML = eINSTANCE.getXmlMappedSuperclass_IdClassForXml();
+
+ /**
* 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 -->
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 7c3a50f21a..c7d382bad6 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
@@ -91,7 +91,7 @@ public class XmlEmbedded extends XmlAttributeMapping implements IEmbedded
}
public EList<IAttributeOverride> getAttributeOverrides() {
- EList<IAttributeOverride> list = new BasicEList<IAttributeOverride>();
+ EList<IAttributeOverride> list = new EObjectContainmentEList<IAttributeOverride>(IAttributeOverride.class, this, OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES);
list.addAll(getSpecifiedAttributeOverrides());
list.addAll(getDefaultAttributeOverrides());
return list;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityInternal.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityInternal.java
index e670a345d1..b9313d2eb7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityInternal.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlEntityInternal.java
@@ -542,7 +542,7 @@ public class XmlEntityInternal extends XmlTypeMapping
* @generated NOT
*/
public EList<ISecondaryTable> getSecondaryTables() {
- EList<ISecondaryTable> list = new BasicEList<ISecondaryTable>();
+ EList<ISecondaryTable> list = new EObjectContainmentEList<ISecondaryTable>(ISecondaryTable.class, this, OrmPackage.XML_ENTITY_INTERNAL__SECONDARY_TABLES);
list.addAll(getSpecifiedSecondaryTables());
list.addAll(getVirtualSecondaryTables());
return list;
@@ -943,7 +943,7 @@ public class XmlEntityInternal extends XmlTypeMapping
}
public EList<IAttributeOverride> getAttributeOverrides() {
- EList<IAttributeOverride> list = new BasicEList<IAttributeOverride>();
+ EList<IAttributeOverride> list = new EObjectContainmentEList<IAttributeOverride>(IAttributeOverride.class, this, OrmPackage.XML_ENTITY_INTERNAL__ATTRIBUTE_OVERRIDES);
list.addAll(getSpecifiedAttributeOverrides());
list.addAll(getDefaultAttributeOverrides());
return list;
@@ -992,7 +992,7 @@ public class XmlEntityInternal extends XmlTypeMapping
}
public EList<IAssociationOverride> getAssociationOverrides() {
- EList<IAssociationOverride> list = new BasicEList<IAssociationOverride>();
+ EList<IAssociationOverride> list = new EObjectContainmentEList<IAssociationOverride>(IAssociationOverride.class, this, OrmPackage.XML_ENTITY_INTERNAL__ASSOCIATION_OVERRIDES);
list.addAll(getSpecifiedAssociationOverrides());
list.addAll(getDefaultAssociationOverrides());
return list;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdClass.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdClass.java
index 32ec3ae6ec..84025b6c24 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdClass.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlIdClass.java
@@ -80,12 +80,12 @@ public class XmlIdClass extends XmlEObject
}
}
- private XmlEntityInternal xmlEntity() {
- return (XmlEntityInternal) eContainer();
+ private Owner owner() {
+ return (Owner) eContainer();
}
protected void valueChanged() {
- xmlEntity().setIdClass(getValue());
+ owner().setIdClass(getValue());
}
/**
@@ -205,4 +205,10 @@ public class XmlIdClass extends XmlEObject
result.append(')');
return result.toString();
}
+
+
+ public interface Owner
+ {
+ void setIdClass(String idClass);
+ }
} // XmlIdClass
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 22839b3bc0..7340896db3 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
@@ -10,8 +10,12 @@
package org.eclipse.jpt.core.internal.content.orm;
import java.util.Iterator;
+import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.IMappingKeys;
import org.eclipse.jpt.core.internal.IPersistentAttribute;
@@ -27,6 +31,12 @@ import org.eclipse.jpt.utility.internal.iterators.TransformationIterator;
* An implementation of the model object '<em><b>Xml Mapped Superclass</b></em>'.
* <!-- end-user-doc -->
*
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass#getIdClassForXml <em>Id Class For Xml</em>}</li>
+ * </ul>
+ * </p>
*
* @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMappedSuperclass()
* @model kind="class"
@@ -56,12 +66,62 @@ public class XmlMappedSuperclass extends XmlTypeMapping
protected String idClass = ID_CLASS_EDEFAULT;
/**
+ * The cached value of the '{@link #getIdClassForXml() <em>Id Class For Xml</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @see #getIdClassForXml()
* @generated
+ * @ordered
*/
+ protected XmlIdClass idClassForXml;
+
protected XmlMappedSuperclass() {
super();
+ this.eAdapters().add(this.buildListener());
+ }
+
+ protected Adapter buildListener() {
+ return new AdapterImpl() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ XmlMappedSuperclass.this.notifyChanged(notification);
+ }
+ };
+ }
+
+ protected void notifyChanged(Notification notification) {
+ switch (notification.getFeatureID(IMappedSuperclass.class)) {
+ case JpaCoreMappingsPackage.IMAPPED_SUPERCLASS__ID_CLASS :
+ idClassChanged();
+ break;
+ default :
+ break;
+ }
+ switch (notification.getFeatureID(XmlMappedSuperclass.class)) {
+ case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML :
+ xmlIdClassChanged();
+ break;
+ default :
+ break;
+ }
+ }
+
+ protected void idClassChanged() {
+ if (getIdClass() == null) {
+ setIdClassForXml(null);
+ }
+ else {
+ if (getIdClassForXml() == null) {
+ setIdClassForXml(OrmFactory.eINSTANCE.createXmlIdClass());
+ }
+ getIdClassForXml().setValue(getIdClass());
+ }
+ }
+
+ protected void xmlIdClassChanged() {
+ if (getIdClassForXml() == null) {
+ setIdClass(null);
+ }
}
/**
@@ -108,6 +168,79 @@ public class XmlMappedSuperclass extends XmlTypeMapping
}
/**
+ * Returns the value of the '<em><b>Id Class For Xml</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Id Class For Xml</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Id Class For Xml</em>' containment reference.
+ * @see #setIdClassForXml(XmlIdClass)
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMappedSuperclass_IdClassForXml()
+ * @model containment="true"
+ * @generated
+ */
+ public XmlIdClass getIdClassForXml() {
+ return idClassForXml;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetIdClassForXml(XmlIdClass newIdClassForXml, NotificationChain msgs) {
+ XmlIdClass oldIdClassForXml = idClassForXml;
+ idClassForXml = newIdClassForXml;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML, oldIdClassForXml, newIdClassForXml);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMappedSuperclass#getIdClassForXml <em>Id Class For Xml</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Id Class For Xml</em>' containment reference.
+ * @see #getIdClassForXml()
+ * @generated
+ */
+ public void setIdClassForXml(XmlIdClass newIdClassForXml) {
+ if (newIdClassForXml != idClassForXml) {
+ NotificationChain msgs = null;
+ if (idClassForXml != null)
+ msgs = ((InternalEObject) idClassForXml).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML, null, msgs);
+ if (newIdClassForXml != null)
+ msgs = ((InternalEObject) newIdClassForXml).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML, null, msgs);
+ msgs = basicSetIdClassForXml(newIdClassForXml, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML, newIdClassForXml, newIdClassForXml));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML :
+ return basicSetIdClassForXml(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -117,6 +250,8 @@ public class XmlMappedSuperclass extends XmlTypeMapping
switch (featureID) {
case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS :
return getIdClass();
+ case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML :
+ return getIdClassForXml();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -132,6 +267,9 @@ public class XmlMappedSuperclass extends XmlTypeMapping
case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS :
setIdClass((String) newValue);
return;
+ case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML :
+ setIdClassForXml((XmlIdClass) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -147,6 +285,9 @@ public class XmlMappedSuperclass extends XmlTypeMapping
case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS :
setIdClass(ID_CLASS_EDEFAULT);
return;
+ case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML :
+ setIdClassForXml((XmlIdClass) null);
+ return;
}
super.eUnset(featureID);
}
@@ -161,6 +302,8 @@ public class XmlMappedSuperclass extends XmlTypeMapping
switch (featureID) {
case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS :
return ID_CLASS_EDEFAULT == null ? idClass != null : !ID_CLASS_EDEFAULT.equals(idClass);
+ case OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS_FOR_XML :
+ return idClassForXml != null;
}
return super.eIsSet(featureID);
}
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 2a99462a5e..940c6556b8 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
@@ -18,7 +18,6 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.IJpaContentNode;
import org.eclipse.jpt.core.internal.IPersistentAttribute;
import org.eclipse.jpt.core.internal.ITextRange;
-import org.eclipse.jpt.core.internal.ITypeMapping;
import org.eclipse.jpt.core.internal.JpaCorePackage;
import org.eclipse.jpt.core.internal.XmlEObject;
import org.eclipse.jpt.core.internal.content.java.JavaPersistentAttribute;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java
index 0f585ebedf..24155f671f 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java
@@ -303,7 +303,7 @@ public class XmlPersistentType extends XmlEObject implements IPersistentType
* @generated NOT
*/
public EList<XmlAttributeMapping> getAttributeMappings() {
- EList<XmlAttributeMapping> list = new BasicEList<XmlAttributeMapping>();
+ EList<XmlAttributeMapping> list = new EObjectContainmentEList<XmlAttributeMapping>(XmlAttributeMapping.class, this, OrmPackage.XML_PERSISTENT_TYPE__ATTRIBUTE_MAPPINGS);
list.addAll(getSpecifiedAttributeMappings());
list.addAll(getVirtualAttributeMappings());
return list;
@@ -380,7 +380,7 @@ public class XmlPersistentType extends XmlEObject implements IPersistentType
* @generated NOT
*/
public EList<XmlPersistentAttribute> getPersistentAttributes() {
- EList<XmlPersistentAttribute> list = new BasicEList<XmlPersistentAttribute>();
+ EList<XmlPersistentAttribute> list = new EObjectEList<XmlPersistentAttribute>(XmlPersistentAttribute.class, this, OrmPackage.XML_PERSISTENT_TYPE__PERSISTENT_ATTRIBUTES);
list.addAll(getSpecifiedPersistentAttributes());
list.addAll(getVirtualPersistentAttributes());
return list;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java
index 7954567202..85d4996e0a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java
@@ -15,6 +15,7 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.IPersistentType;
+import org.eclipse.jpt.core.internal.ITypeMapping;
import org.eclipse.jpt.core.internal.mappings.ICascade;
import org.eclipse.jpt.core.internal.mappings.IEntity;
import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping;
@@ -499,9 +500,12 @@ public abstract class XmlRelationshipMapping extends XmlAttributeMapping
return RelationshipMappingTools.targetEntityIsValid(targetEntity);
}
- //TODO grr, this will cause ClassCastExceptions, how should I handle it??
public IEntity getEntity() {
- return (IEntity) ((XmlPersistentType) eContainer()).getMapping();
+ ITypeMapping typeMapping = getPersistentType().getMapping();
+ if (typeMapping instanceof IEntity) {
+ return (IEntity) typeMapping;
+ }
+ return null;
}
public String fullyQualifiedTargetEntity() {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MappedSuperclassTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MappedSuperclassTranslator.java
index b2d52bd8f9..aaf4743429 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MappedSuperclassTranslator.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MappedSuperclassTranslator.java
@@ -10,7 +10,6 @@ package org.eclipse.jpt.core.internal.content.orm.resource;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
-import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
import org.eclipse.wst.common.internal.emf.resource.Translator;
@@ -54,7 +53,6 @@ public class MappedSuperclassTranslator extends TypeMappingTranslator
}
protected Translator createIdClassTranslator() {
- return new Translator(ID_CLASS + "/" + ID_CLASS__CLASS, JpaCoreMappingsPackage.eINSTANCE.getIMappedSuperclass_IdClass(), DOM_ATTRIBUTE);
+ return new IdClassTranslator(ID_CLASS, JPA_CORE_XML_PKG.getXmlMappedSuperclass_IdClassForXml());
}
-
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/JavaClassRef.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/JavaClassRef.java
index 7c2d1a2ced..a1344b4a94 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/JavaClassRef.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/persistence/JavaClassRef.java
@@ -109,7 +109,7 @@ public class JavaClassRef extends XmlEObject
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, PersistencePackage.JAVA_CLASS_REF__JAVA_CLASS, oldJavaClass, javaClass));
}
-
+
public IType findJdtType() {
String fqClassName = getJavaClass();
if (StringTools.stringIsEmpty(fqClassName)) {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java
index bd7b202270..ece516c60f 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java
@@ -16,7 +16,6 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jem.java.JavaRefPackage;
import org.eclipse.jpt.core.internal.JpaCorePackage;
import org.eclipse.jpt.core.internal.content.java.JpaJavaPackage;
import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage;
@@ -4062,7 +4061,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl
isInited = true;
// Initialize simple dependencies
EcorePackage.eINSTANCE.eClass();
- JavaRefPackage.eINSTANCE.eClass();
// Obtain or create and register interdependencies
JpaCorePackage theJpaCorePackage = (JpaCorePackage) (EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) instanceof JpaCorePackage ? EPackage.Registry.INSTANCE.getEPackage(JpaCorePackage.eNS_URI) : JpaCorePackage.eINSTANCE);
JpaJavaPackage theJpaJavaPackage = (JpaJavaPackage) (EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) instanceof JpaJavaPackage ? EPackage.Registry.INSTANCE.getEPackage(JpaJavaPackage.eNS_URI) : JpaJavaPackage.eINSTANCE);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMultiRelationshipMappingContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMultiRelationshipMappingContext.java
index a559a6575e..eb621a135b 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMultiRelationshipMappingContext.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/XmlMultiRelationshipMappingContext.java
@@ -46,8 +46,8 @@ public abstract class XmlMultiRelationshipMappingContext
}
protected String joinTableDefaultName(DefaultsContext defaultsContext) {
- ITable owningTable = multiRelationshipMapping().getEntity().getTable();
- if (owningTable == null) {
+ String tableName = multiRelationshipMapping().typeMapping().getTableName();
+ if (tableName == null) {
return null;
}
IEntity targetEntity = targetEntity(defaultsContext);
@@ -55,7 +55,7 @@ public abstract class XmlMultiRelationshipMappingContext
return null;
}
ITable targetTable = targetEntity.getTable();
- return (targetTable == null) ? null : owningTable.getName() + "_" + targetTable.getName();
+ return (targetTable == null) ? null : tableName + "_" + targetTable.getName();
}
protected XmlMultiRelationshipMappingInternal multiRelationshipMapping() {

Back to the top