diff options
author | pfullbright | 2007-05-30 20:39:03 +0000 |
---|---|---|
committer | pfullbright | 2007-05-30 20:39:03 +0000 |
commit | 13af6cc28bb36543d57f9970304d7c7e3545e478 (patch) | |
tree | 9e109618f4068f0333722fe456c7c5a1679020a3 /jpa/plugins/org.eclipse.jpt.core | |
parent | bbcfcb3b55a480752c6eb404a2226a553d825d6f (diff) | |
download | webtools.dali-13af6cc28bb36543d57f9970304d7c7e3545e478.tar.gz webtools.dali-13af6cc28bb36543d57f9970304d7c7e3545e478.tar.xz webtools.dali-13af6cc28bb36543d57f9970304d7c7e3545e478.zip |
bug 186031 - fixed orderBy for xml
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core')
35 files changed, 583 insertions, 1956 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/core.ecore b/jpa/plugins/org.eclipse.jpt.core/model/core.ecore index 0a9e3d5bae..3f2f839fea 100644 --- a/jpa/plugins/org.eclipse.jpt.core/model/core.ecore +++ b/jpa/plugins/org.eclipse.jpt.core/model/core.ecore @@ -304,11 +304,19 @@ </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="IMultiRelationshipMapping" abstract="true" interface="true" eSuperTypes="#//mappings/INonOwningMapping"> + <eOperations name="isNoOrdering" ordered="false" unique="false" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/> + <eOperations name="setNoOrdering" ordered="false" unique="false"/> + <eOperations name="isOrderByPk" ordered="false" unique="false" lowerBound="1" + eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/> + <eOperations name="setOrderByPk" ordered="false" unique="false"/> + <eOperations name="isCustomOrdering" ordered="false" unique="false" lowerBound="1" + eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="orderBy" ordered="false" + unique="false" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="fetch" eType="#//mappings/DefaultLazyFetchType"/> <eStructuralFeatures xsi:type="ecore:EReference" name="joinTable" lowerBound="1" eType="#//mappings/IJoinTable" changeable="false" containment="true"/> - <eStructuralFeatures xsi:type="ecore:EReference" name="orderBy" lowerBound="1" - eType="#//mappings/IOrderBy" changeable="false" containment="true"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="mapKey" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="IOneToMany" abstract="true" interface="true" @@ -531,16 +539,6 @@ <eLiterals name="ORDINAL" value="1" literal="Ordinal"/> <eLiterals name="STRING" value="2" literal="String"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="IOrderBy" abstract="true" interface="true" - eSuperTypes="#//IJpaSourceObject"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//mappings/OrderingType"/> - </eClassifiers> - <eClassifiers xsi:type="ecore:EEnum" name="OrderingType"> - <eLiterals name="NONE" literal="None"/> - <eLiterals name="PRIMARY_KEY" value="1" literal="Primary Key"/> - <eLiterals name="CUSTOM" value="2" literal="Custom"/> - </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="IQuery" abstract="true" interface="true" eSuperTypes="#//IJpaSourceObject"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/> diff --git a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel b/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel index 9c2f77885c..13b24dc6e9 100644 --- a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel +++ b/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel @@ -146,11 +146,6 @@ <genEnumLiterals ecoreEnumLiteral="core.ecore#//mappings/EnumType/ORDINAL"/> <genEnumLiterals ecoreEnumLiteral="core.ecore#//mappings/EnumType/STRING"/> </genEnums> - <genEnums typeSafeEnumCompatible="false" ecoreEnum="core.ecore#//mappings/OrderingType"> - <genEnumLiterals ecoreEnumLiteral="core.ecore#//mappings/OrderingType/NONE"/> - <genEnumLiterals ecoreEnumLiteral="core.ecore#//mappings/OrderingType/PRIMARY_KEY"/> - <genEnumLiterals ecoreEnumLiteral="core.ecore#//mappings/OrderingType/CUSTOM"/> - </genEnums> <genEnums typeSafeEnumCompatible="false" ecoreEnum="core.ecore#//mappings/CascadeType"> <genEnumLiterals ecoreEnumLiteral="core.ecore#//mappings/CascadeType/ALL"/> <genEnumLiterals ecoreEnumLiteral="core.ecore#//mappings/CascadeType/PERSIST"/> @@ -278,11 +273,15 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/INonOwningMapping/mappedBy"/> </genClasses> <genClasses ecoreClass="core.ecore#//mappings/IMultiRelationshipMapping"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IMultiRelationshipMapping/orderBy"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IMultiRelationshipMapping/fetch"/> <genFeatures property="None" children="true" createChild="false" ecoreFeature="ecore:EReference core.ecore#//mappings/IMultiRelationshipMapping/joinTable"/> - <genFeatures notify="false" createChild="false" propertySortChoices="true" - ecoreFeature="ecore:EReference core.ecore#//mappings/IMultiRelationshipMapping/orderBy"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IMultiRelationshipMapping/mapKey"/> + <genOperations ecoreOperation="core.ecore#//mappings/IMultiRelationshipMapping/isNoOrdering"/> + <genOperations ecoreOperation="core.ecore#//mappings/IMultiRelationshipMapping/setNoOrdering"/> + <genOperations ecoreOperation="core.ecore#//mappings/IMultiRelationshipMapping/isOrderByPk"/> + <genOperations ecoreOperation="core.ecore#//mappings/IMultiRelationshipMapping/setOrderByPk"/> + <genOperations ecoreOperation="core.ecore#//mappings/IMultiRelationshipMapping/isCustomOrdering"/> </genClasses> <genClasses ecoreClass="core.ecore#//mappings/IOneToMany"/> <genClasses ecoreClass="core.ecore#//mappings/IManyToMany"/> @@ -372,10 +371,6 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IGeneratedValue/strategy"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IGeneratedValue/generator"/> </genClasses> - <genClasses image="false" ecoreClass="core.ecore#//mappings/IOrderBy"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IOrderBy/value"/> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IOrderBy/type"/> - </genClasses> <genClasses image="false" ecoreClass="core.ecore#//mappings/IQuery"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IQuery/name"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IQuery/query"/> @@ -462,7 +457,6 @@ <genClasses ecoreClass="java.ecore#//mappings/JavaGenerator"/> <genClasses ecoreClass="java.ecore#//mappings/JavaTableGenerator"/> <genClasses ecoreClass="java.ecore#//mappings/JavaSequenceGenerator"/> - <genClasses ecoreClass="java.ecore#//mappings/JavaOrderBy"/> <genClasses image="false" ecoreClass="java.ecore#//mappings/JavaAbstractQuery"/> <genClasses ecoreClass="java.ecore#//mappings/JavaNamedQuery"/> <genClasses ecoreClass="java.ecore#//mappings/JavaNamedNativeQuery"/> @@ -550,7 +544,6 @@ <genClasses image="false" ecoreClass="orm.ecore#//XmlMultiRelationshipMappingInternal"/> <genClasses image="false" ecoreClass="orm.ecore#//XmlMultiRelationshipMappingForXml"> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMultiRelationshipMappingForXml/joinTableForXml"/> - <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMultiRelationshipMappingForXml/orderByForXml"/> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference orm.ecore#//XmlMultiRelationshipMappingForXml/mapKeyForXml"/> </genClasses> <genClasses image="false" ecoreClass="orm.ecore#//XmlMultiRelationshipMapping"/> @@ -639,7 +632,6 @@ <genClasses image="false" ecoreClass="orm.ecore#//XmlGenerator"/> <genClasses ecoreClass="orm.ecore#//XmlSequenceGenerator"/> <genClasses ecoreClass="orm.ecore#//XmlTableGenerator"/> - <genClasses ecoreClass="orm.ecore#//XmlOrderBy"/> <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlQuery"/> <genClasses ecoreClass="orm.ecore#//XmlNamedQuery"/> <genClasses ecoreClass="orm.ecore#//XmlNamedNativeQuery"/> diff --git a/jpa/plugins/org.eclipse.jpt.core/model/java.ecore b/jpa/plugins/org.eclipse.jpt.core/model/java.ecore index 0f8e20fc21..7c3425fe7a 100644 --- a/jpa/plugins/org.eclipse.jpt.core/model/java.ecore +++ b/jpa/plugins/org.eclipse.jpt.core/model/java.ecore @@ -77,7 +77,6 @@ <eClassifiers xsi:type="ecore:EClass" name="JavaGenerator" abstract="true" eSuperTypes="#//JavaEObject core.ecore#//mappings/IGenerator"/> <eClassifiers xsi:type="ecore:EClass" name="JavaTableGenerator" eSuperTypes="#//mappings/JavaGenerator core.ecore#//mappings/ITableGenerator"/> <eClassifiers xsi:type="ecore:EClass" name="JavaSequenceGenerator" eSuperTypes="#//mappings/JavaGenerator core.ecore#//mappings/ISequenceGenerator"/> - <eClassifiers xsi:type="ecore:EClass" name="JavaOrderBy" eSuperTypes="#//JavaEObject core.ecore#//mappings/IOrderBy"/> <eClassifiers xsi:type="ecore:EClass" name="JavaAbstractQuery" abstract="true" eSuperTypes="#//JavaEObject core.ecore#//mappings/IQuery"/> <eClassifiers xsi:type="ecore:EClass" name="JavaNamedQuery" eSuperTypes="#//mappings/JavaAbstractQuery core.ecore#//mappings/INamedQuery"/> diff --git a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore b/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore index 113446be18..f6cafd0a04 100644 --- a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore +++ b/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore @@ -126,8 +126,6 @@ interface="true"> <eStructuralFeatures xsi:type="ecore:EReference" name="joinTableForXml" eType="#//XmlJoinTable" volatile="true" resolveProxies="false"/> - <eStructuralFeatures xsi:type="ecore:EReference" name="orderByForXml" eType="#//XmlOrderBy" - volatile="true" resolveProxies="false"/> <eStructuralFeatures xsi:type="ecore:EReference" name="mapKeyForXml" eType="#//XmlMapKey" containment="true" resolveProxies="false"/> </eClassifiers> @@ -264,7 +262,6 @@ <eClassifiers xsi:type="ecore:EClass" name="XmlGenerator" abstract="true" eSuperTypes="core.ecore#//XmlEObject core.ecore#//mappings/IGenerator"/> <eClassifiers xsi:type="ecore:EClass" name="XmlSequenceGenerator" eSuperTypes="#//XmlGenerator core.ecore#//mappings/ISequenceGenerator"/> <eClassifiers xsi:type="ecore:EClass" name="XmlTableGenerator" eSuperTypes="#//XmlGenerator core.ecore#//mappings/ITableGenerator"/> - <eClassifiers xsi:type="ecore:EClass" name="XmlOrderBy" eSuperTypes="core.ecore#//XmlEObject core.ecore#//mappings/IOrderBy"/> <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlQuery" abstract="true" eSuperTypes="core.ecore#//XmlEObject core.ecore#//mappings/IQuery"/> <eClassifiers xsi:type="ecore:EClass" name="XmlNamedQuery" eSuperTypes="#//AbstractXmlQuery core.ecore#//mappings/INamedQuery"/> <eClassifiers xsi:type="ecore:EClass" name="XmlNamedNativeQuery" eSuperTypes="#//AbstractXmlQuery core.ecore#//mappings/INamedNativeQuery"/> diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java index c037a2f862..50b81df365 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java @@ -52,7 +52,6 @@ import org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationship import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMappingProvider; import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany; import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy; import org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn; import org.eclipse.jpt.core.internal.content.java.mappings.JavaSequenceGenerator; import org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator; @@ -230,10 +229,10 @@ public class JavaPersistentType extends JavaEObject implements IPersistentType adapters.add(JavaBasic.LOB_ADAPTER); adapters.add(JavaManyToMany.DECLARATION_ANNOTATION_ADAPTER); adapters.add(JavaManyToOne.DECLARATION_ANNOTATION_ADAPTER); + adapters.add(JavaMultiRelationshipMapping.ORDER_BY_ADAPTER); adapters.add(JavaMultiRelationshipMapping.MAP_KEY_ADAPTER); adapters.add(JavaOneToMany.DECLARATION_ANNOTATION_ADAPTER); adapters.add(JavaOneToOne.DECLARATION_ANNOTATION_ADAPTER); - adapters.add(JavaOrderBy.DECLARATION_ANNOTATION_ADAPTER); adapters.add(JavaPrimaryKeyJoinColumn.MULTIPLE_DECLARATION_ANNOTATION_ADAPTER); adapters.add(JavaPrimaryKeyJoinColumn.SINGLE_DECLARATION_ANNOTATION_ADAPTER); // PrimaryKeyJoinColumns adapters.add(JavaSequenceGenerator.DECLARATION_ANNOTATION_ADAPTER); diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMultiRelationshipMapping.java index 557f9e6d66..c843c474e6 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMultiRelationshipMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMultiRelationshipMapping.java @@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.jdt.core.Signature; +import org.eclipse.jdt.core.dom.Annotation; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jpt.core.internal.ITextRange; import org.eclipse.jpt.core.internal.ITypeMapping; @@ -29,12 +30,13 @@ import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; import org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType; +import org.eclipse.jpt.core.internal.mappings.IEntity; import org.eclipse.jpt.core.internal.mappings.IJoinTable; import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.IOrderBy; import org.eclipse.jpt.core.internal.mappings.ITable; import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; +import org.eclipse.jpt.core.internal.platform.DefaultsContext; import org.eclipse.jpt.utility.internal.Filter; import org.eclipse.jpt.utility.internal.StringTools; import org.eclipse.jpt.utility.internal.iterators.FilteringIterator; @@ -72,7 +74,25 @@ public abstract class JavaMultiRelationshipMapping */ protected String mappedBy = MAPPED_BY_EDEFAULT; - private final AnnotationElementAdapter<String> mappedByAdapter; + /** + * The default value of the '{@link #getOrderBy() <em>Order By</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOrderBy() + * @generated + * @ordered + */ + protected static final String ORDER_BY_EDEFAULT = null; + + /** + * The cached value of the '{@link #getOrderBy() <em>Order By</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOrderBy() + * @generated + * @ordered + */ + protected String orderBy = ORDER_BY_EDEFAULT; /** * The default value of the '{@link #getFetch() <em>Fetch</em>}' attribute. @@ -105,16 +125,6 @@ public abstract class JavaMultiRelationshipMapping protected IJoinTable joinTable; /** - * The cached value of the '{@link #getOrderBy() <em>Order By</em>}' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getOrderBy() - * @generated - * @ordered - */ - protected IOrderBy orderBy; - - /** * The default value of the '{@link #getMapKey() <em>Map Key</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -134,6 +144,22 @@ public abstract class JavaMultiRelationshipMapping */ protected String mapKey = MAP_KEY_EDEFAULT; + private final AnnotationElementAdapter<String> mappedByAdapter; + + /* + * The @OrderBy annotation is a bit wack: + * - no annotation at all means "no ordering" + * - an annotation with no 'value' means "order by ascending primary key" + * - an annotation with a 'value' means "order by the settings in the 'value' string" + */ + private final AnnotationAdapter orderByAnnotationAdapter; + + private final AnnotationElementAdapter<String> orderByValueAdapter; + + public static final DeclarationAnnotationAdapter ORDER_BY_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ORDER_BY); + + private static final DeclarationAnnotationElementAdapter<String> ORDER_BY_VALUE_ADAPTER = buildOrderByValueAdapter(); + private final AnnotationAdapter mapKeyAnnotationAdapter; private final AnnotationElementAdapter<String> mapKeyNameAdapter; @@ -149,18 +175,51 @@ public abstract class JavaMultiRelationshipMapping protected JavaMultiRelationshipMapping(Attribute attribute) { super(attribute); this.mappedByAdapter = this.buildAnnotationElementAdapter(this.mappedByAdapter()); + this.orderByAnnotationAdapter = new MemberAnnotationAdapter(attribute, ORDER_BY_ADAPTER); + this.orderByValueAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, ORDER_BY_VALUE_ADAPTER); this.mapKeyAnnotationAdapter = new MemberAnnotationAdapter(attribute, MAP_KEY_ADAPTER); this.mapKeyNameAdapter = new ShortCircuitAnnotationElementAdapter<String>(attribute, MAP_KEY_NAME_ADAPTER); this.joinTable = JpaJavaMappingsFactory.eINSTANCE.createJavaJoinTable(buildOwner(), attribute); ((InternalEObject) this.joinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE, null, null); - this.orderBy = JpaJavaMappingsFactory.eINSTANCE.createJavaOrderBy(attribute); - ((InternalEObject) this.orderBy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY, null, null); } + /** + * return the Java adapter's 'mappedBy' element adapter config + */ + protected abstract DeclarationAnnotationElementAdapter<String> mappedByAdapter(); + @Override protected void notifyChanged(Notification notification) { super.notifyChanged(notification); + switch (notification.getFeatureID(INonOwningMapping.class)) { + case JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY : + this.mappedByAdapter.setValue((String) notification.getNewValue()); + break; + default : + break; + } switch (notification.getFeatureID(IMultiRelationshipMapping.class)) { + case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY : + String orderBy = (String) notification.getNewValue(); + if (orderBy == null) { + this.orderByAnnotationAdapter.removeAnnotation(); + } + else if ("".equals(orderBy)) { + Annotation orderByAnnotation = this.orderByAnnotationAdapter.getAnnotation(); + if (orderByAnnotation != null) { + // if the value is already "", then leave it alone (short circuit java change cycle) + if (!"".equals(orderByValueAdapter.getValue())) { + this.orderByValueAdapter.setValue(null); + } + } + else { + this.orderByAnnotationAdapter.newMarkerAnnotation(); + } + } + else { + this.orderByValueAdapter.setValue(orderBy); + } + break; case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY : String mk = (String) notification.getNewValue(); if (mk == null) { @@ -176,13 +235,6 @@ public abstract class JavaMultiRelationshipMapping default : break; } - switch (notification.getFeatureID(INonOwningMapping.class)) { - case JpaCoreMappingsPackage.INON_OWNING_MAPPING__MAPPED_BY : - this.mappedByAdapter.setValue((String) notification.getNewValue()); - break; - default : - break; - } } private ITable.Owner buildOwner() { @@ -198,11 +250,6 @@ public abstract class JavaMultiRelationshipMapping } /** - * return the Java adapter's 'mappedBy' element adapter config - */ - protected abstract DeclarationAnnotationElementAdapter<String> mappedByAdapter(); - - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -245,6 +292,89 @@ public abstract class JavaMultiRelationshipMapping eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY, oldMappedBy, mappedBy)); } + /** + * Returns the value of the '<em><b>Order By</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Order By</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Order By</em>' attribute. + * @see #setOrderBy(String) + * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIMultiRelationshipMapping_OrderBy() + * @model unique="false" ordered="false" + * @generated + */ + public String getOrderBy() { + return orderBy; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaMultiRelationshipMapping#getOrderBy <em>Order By</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Order By</em>' attribute. + * @see #getOrderBy() + * @generated + */ + public void setOrderBy(String newOrderBy) { + String oldOrderBy = orderBy; + orderBy = newOrderBy; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY, oldOrderBy, orderBy)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" unique="false" required="true" ordered="false" + * @generated NOT + */ + public boolean isNoOrdering() { + return getOrderBy() == null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated NOT + */ + public void setNoOrdering() { + setOrderBy(null); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" unique="false" required="true" ordered="false" + * @generated NOT + */ + public boolean isOrderByPk() { + return "".equals(getOrderBy()); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated NOT + */ + public void setOrderByPk() { + setOrderBy(""); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" unique="false" required="true" ordered="false" + * @generated NOT + */ + public boolean isCustomOrdering() { + return ! StringTools.stringIsEmpty(getOrderBy()); + } + public ITextRange mappedByTextRange() { return this.elementTextRange(this.mappedByAdapter()); } @@ -325,41 +455,6 @@ public abstract class JavaMultiRelationshipMapping } /** - * Returns the value of the '<em><b>Order By</b></em>' containment reference. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Order By</em>' reference isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Order By</em>' containment reference. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIMultiRelationshipMapping_OrderBy() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IOrderBy getOrderBy() { - return orderBy; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain basicSetOrderBy(IOrderBy newOrderBy, NotificationChain msgs) { - IOrderBy oldOrderBy = orderBy; - orderBy = newOrderBy; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY, oldOrderBy, newOrderBy); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** * Returns the value of the '<em><b>Map Key</b></em>' attribute. * <!-- begin-user-doc --> * <p> @@ -402,8 +497,6 @@ public abstract class JavaMultiRelationshipMapping switch (featureID) { case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : return basicSetJoinTable(null, msgs); - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : - return basicSetOrderBy(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -418,12 +511,12 @@ public abstract class JavaMultiRelationshipMapping switch (featureID) { case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY : return getMappedBy(); + case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : + return getOrderBy(); case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH : return getFetch(); case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : return getJoinTable(); - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : - return getOrderBy(); case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY : return getMapKey(); } @@ -441,6 +534,9 @@ public abstract class JavaMultiRelationshipMapping case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY : setMappedBy((String) newValue); return; + case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : + setOrderBy((String) newValue); + return; case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH : setFetch((DefaultLazyFetchType) newValue); return; @@ -462,6 +558,9 @@ public abstract class JavaMultiRelationshipMapping case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY : setMappedBy(MAPPED_BY_EDEFAULT); return; + case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : + setOrderBy(ORDER_BY_EDEFAULT); + return; case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH : setFetch(FETCH_EDEFAULT); return; @@ -482,12 +581,12 @@ public abstract class JavaMultiRelationshipMapping switch (featureID) { case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY : return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy); + case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : + return ORDER_BY_EDEFAULT == null ? orderBy != null : !ORDER_BY_EDEFAULT.equals(orderBy); case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH : return fetch != FETCH_EDEFAULT; case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : return joinTable != null; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : - return orderBy != null; case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY : return MAP_KEY_EDEFAULT == null ? mapKey != null : !MAP_KEY_EDEFAULT.equals(mapKey); } @@ -511,12 +610,12 @@ public abstract class JavaMultiRelationshipMapping } if (baseClass == IMultiRelationshipMapping.class) { switch (derivedFeatureID) { + case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : + return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH : return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH; case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; - case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY : - return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; case JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY : return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY; default : @@ -543,12 +642,12 @@ public abstract class JavaMultiRelationshipMapping } if (baseClass == IMultiRelationshipMapping.class) { switch (baseFeatureID) { + case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY : + return JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY; case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH : return JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH; case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : return JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY : - return JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY; case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY : return JpaJavaMappingsPackage.JAVA_MULTI_RELATIONSHIP_MAPPING__MAP_KEY; default : @@ -570,6 +669,8 @@ public abstract class JavaMultiRelationshipMapping StringBuffer result = new StringBuffer(super.toString()); result.append(" (mappedBy: "); result.append(mappedBy); + result.append(", orderBy: "); + result.append(orderBy); result.append(", fetch: "); result.append(fetch); result.append(", mapKey: "); @@ -578,15 +679,53 @@ public abstract class JavaMultiRelationshipMapping return result.toString(); } + public void refreshDefaults(DefaultsContext defaultsContext) { + super.refreshDefaults(defaultsContext); + // TODO + // if (isOrderByPk()) { + // refreshDefaultOrderBy(defaultsContext); + // } + } + + //primary key ordering when just the @OrderBy annotation is present + protected void refreshDefaultOrderBy(DefaultsContext defaultsContext) { + IEntity targetEntity = getResolvedTargetEntity(); + if (targetEntity != null) { + setOrderBy(targetEntity.primaryKeyAttributeName() + " ASC"); + } + } + @Override public void updateFromJava(CompilationUnit astRoot) { super.updateFromJava(astRoot); setMappedBy(this.mappedByAdapter.getValue(astRoot)); - this.getJavaOrderBy().updateFromJava(astRoot); + updateOrderByFromJava(astRoot); this.getJavaJoinTable().updateFromJava(astRoot); updateMapKeyFromJava(astRoot); } + private void updateOrderByFromJava(CompilationUnit astRoot) { + String orderBy = this.orderByValueAdapter.getValue(astRoot); + if (orderBy == null) { + if (orderByAnnotation(astRoot) == null) { + this.setNoOrdering(); + } + else { + this.setOrderByPk(); + } + } + else if ("".equals(orderBy)) { + this.setOrderByPk(); + } + else { + this.setOrderBy(orderBy); + } + } + + private Annotation orderByAnnotation(CompilationUnit astRoot) { + return this.orderByAnnotationAdapter.getAnnotation(astRoot); + } + private void updateMapKeyFromJava(CompilationUnit astRoot) { this.setMapKey(this.mapKeyNameAdapter.getValue(astRoot)); } @@ -595,10 +734,6 @@ public abstract class JavaMultiRelationshipMapping return (JavaJoinTable) this.joinTable; } - private JavaOrderBy getJavaOrderBy() { - return (JavaOrderBy) this.orderBy; - } - @Override protected void updateFetchFromJava(CompilationUnit astRoot) { setFetch(DefaultLazyFetchType.fromJavaAnnotationValue(this.getFetchAdapter().getValue(astRoot))); @@ -666,6 +801,10 @@ public abstract class JavaMultiRelationshipMapping } // ********** static methods ********** + private static DeclarationAnnotationElementAdapter<String> buildOrderByValueAdapter() { + return ConversionDeclarationAnnotationElementAdapter.forStrings(ORDER_BY_ADAPTER, JPA.ORDER_BY__VALUE, false); + } + private static DeclarationAnnotationElementAdapter<String> buildMapKeyNameAdapter() { return ConversionDeclarationAnnotationElementAdapter.forStrings(MAP_KEY_ADAPTER, JPA.MAP_KEY__NAME, false); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOrderBy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOrderBy.java deleted file mode 100644 index e26c8a72ef..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOrderBy.java +++ /dev/null @@ -1,437 +0,0 @@ -/******************************************************************************* - * 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.core.internal.content.java.mappings; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jdt.core.dom.Annotation; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jdt.core.dom.NormalAnnotation; -import org.eclipse.jpt.core.internal.ITextRange; -import org.eclipse.jpt.core.internal.content.java.JavaEObject; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ConversionDeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.Member; -import org.eclipse.jpt.core.internal.jdtutility.MemberAnnotationAdapter; -import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter; -import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter; -import org.eclipse.jpt.core.internal.mappings.IEntity; -import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.IOrderBy; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.OrderingType; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Java Order By</b></em>'. - * <!-- end-user-doc --> - * - * - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOrderBy() - * @model kind="class" - * @generated - */ -public class JavaOrderBy extends JavaEObject implements IOrderBy -{ - /** - * The default value of the '{@link #getValue() <em>Value</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getValue() - * @generated - * @ordered - */ - protected static final String VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getValue() <em>Value</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getValue() - * @generated - * @ordered - */ - protected String value = VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getType() <em>Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getType() - * @generated - * @ordered - */ - protected static final OrderingType TYPE_EDEFAULT = OrderingType.NONE; - - /** - * The cached value of the '{@link #getType() <em>Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getType() - * @generated - * @ordered - */ - protected OrderingType type = TYPE_EDEFAULT; - - private final Member member; - - private final AnnotationAdapter annotationAdapter; - - private final AnnotationElementAdapter<String> valueAdapter; - - public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.ORDER_BY); - - private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter(); - - protected JavaOrderBy() { - throw new UnsupportedOperationException("User JavaOrderBy(Member) instead"); - } - - protected JavaOrderBy(Member member) { - super(); - this.member = member; - this.annotationAdapter = this.buildOrderByAnnotationAdapter(); - this.valueAdapter = new ShortCircuitAnnotationElementAdapter<String>(this.member, VALUE_ADAPTER); - } - - private AnnotationAdapter buildOrderByAnnotationAdapter() { - return new MemberAnnotationAdapter(this.member, DECLARATION_ANNOTATION_ADAPTER); - } - - @Override - protected void notifyChanged(Notification notification) { - super.notifyChanged(notification); - switch (notification.getFeatureID(IOrderBy.class)) { - case JpaJavaMappingsPackage.JAVA_ORDER_BY__VALUE : - if (getType() == OrderingType.CUSTOM) { - this.valueAdapter.setValue((String) notification.getNewValue()); - } - break; - case JpaJavaMappingsPackage.JAVA_ORDER_BY__TYPE : - OrderingType newOrderingType = (OrderingType) notification.getNewValue(); - if (newOrderingType == OrderingType.NONE) { - if (this.annotationAdapter.getAnnotation() != null) { - this.annotationAdapter.removeAnnotation(); - } - } - else if (newOrderingType == OrderingType.PRIMARY_KEY) { - Annotation annotation = this.annotationAdapter.getAnnotation(); - if (annotation == null) { - this.annotationAdapter.newMarkerAnnotation(); - } - else if (annotation.isNormalAnnotation()) { - if (((NormalAnnotation) annotation).values().size() != 0) { - this.annotationAdapter.removeAnnotation(); - this.annotationAdapter.newMarkerAnnotation(); - } - } - else if (!annotation.isMarkerAnnotation()) { - this.annotationAdapter.removeAnnotation(); - this.annotationAdapter.newMarkerAnnotation(); - } - } - else if (newOrderingType == OrderingType.CUSTOM) { - Annotation annotation = this.annotationAdapter.getAnnotation(); - if (annotation == null) { - this.annotationAdapter.newSingleMemberAnnotation(); - this.valueAdapter.setValue(getValue()); - } - else if (!annotation.isSingleMemberAnnotation()) { - this.annotationAdapter.removeAnnotation(); - this.annotationAdapter.newSingleMemberAnnotation(); - this.valueAdapter.setValue(getValue()); - } - } - else { - throw new IllegalStateException("unknown 'orderBy' type: " + newOrderingType); - } - break; - default : - break; - } - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - protected EClass eStaticClass() { - return JpaJavaMappingsPackage.Literals.JAVA_ORDER_BY; - } - - /** - * Returns the value of the '<em><b>Value</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Value</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Value</em>' attribute. - * @see #setValue(String) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIOrderBy_Value() - * @model - * @generated - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy#getValue <em>Value</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Value</em>' attribute. - * @see #getValue() - * @generated - */ - public void setValue(String newValue) { - String oldValue = value; - value = newValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ORDER_BY__VALUE, oldValue, value)); - } - - /** - * Returns the value of the '<em><b>Type</b></em>' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.OrderingType}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Type</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Type</em>' attribute. - * @see org.eclipse.jpt.core.internal.mappings.OrderingType - * @see #setType(OrderingType) - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIOrderBy_Type() - * @model - * @generated - */ - public OrderingType getType() { - return type; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy#getType <em>Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Type</em>' attribute. - * @see org.eclipse.jpt.core.internal.mappings.OrderingType - * @see #getType() - * @generated - */ - public void setType(OrderingType newType) { - OrderingType oldType = type; - type = newType == null ? TYPE_EDEFAULT : newType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_ORDER_BY__TYPE, oldType, type)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ORDER_BY__VALUE : - return getValue(); - case JpaJavaMappingsPackage.JAVA_ORDER_BY__TYPE : - return getType(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ORDER_BY__VALUE : - setValue((String) newValue); - return; - case JpaJavaMappingsPackage.JAVA_ORDER_BY__TYPE : - setType((OrderingType) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ORDER_BY__VALUE : - setValue(VALUE_EDEFAULT); - return; - case JpaJavaMappingsPackage.JAVA_ORDER_BY__TYPE : - setType(TYPE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case JpaJavaMappingsPackage.JAVA_ORDER_BY__VALUE : - return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); - case JpaJavaMappingsPackage.JAVA_ORDER_BY__TYPE : - return type != TYPE_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { - if (baseClass == IOrderBy.class) { - switch (derivedFeatureID) { - case JpaJavaMappingsPackage.JAVA_ORDER_BY__VALUE : - return JpaCoreMappingsPackage.IORDER_BY__VALUE; - case JpaJavaMappingsPackage.JAVA_ORDER_BY__TYPE : - return JpaCoreMappingsPackage.IORDER_BY__TYPE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { - if (baseClass == IOrderBy.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IORDER_BY__VALUE : - return JpaJavaMappingsPackage.JAVA_ORDER_BY__VALUE; - case JpaCoreMappingsPackage.IORDER_BY__TYPE : - return JpaJavaMappingsPackage.JAVA_ORDER_BY__TYPE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (value: "); - result.append(value); - result.append(", type: "); - result.append(type); - result.append(')'); - return result.toString(); - } - - private IMultiRelationshipMapping multiRelationshipMapping() { - return (IMultiRelationshipMapping) eContainer(); - } - - public void refreshDefaults(DefaultsContext defaultsContext) { - if (getType() == OrderingType.PRIMARY_KEY) { - refreshValue(defaultsContext); - } - } - - //primary key ordering when just the @OrderBy annotation is present - protected void refreshValue(DefaultsContext defaultsContext) { - IEntity targetEntity = multiRelationshipMapping().getResolvedTargetEntity(); - if (targetEntity != null) { - setValue(targetEntity.primaryKeyAttributeName() + " ASC"); - } - } - - /* - * The @OrderBy annotation is a bit wack: - * - no annotation at all means "no ordering" - * - an annotation with no 'value' means "order by ascending primary key" - * - an annotation with a 'value' means "order by the settings in the 'value' string" - */ - public void updateFromJava(CompilationUnit astRoot) { - Annotation annotation = annotation(astRoot); - if (annotation == null) { - setType(OrderingType.NONE); - } - else if (annotation.isMarkerAnnotation()) { - setType(OrderingType.PRIMARY_KEY); - } - else if (annotation.isSingleMemberAnnotation()) { - setType(OrderingType.CUSTOM); - } - else if (annotation.isNormalAnnotation()) { - if (((NormalAnnotation) annotation).values().size() == 0) { - // an empty normal annotation is treated the same as a marker annotation - setType(OrderingType.PRIMARY_KEY); - } - else { - setType(OrderingType.CUSTOM); - } - } - else { - throw new IllegalStateException("unknown annotation type: " + annotation); - } - setValue(this.valueAdapter.getValue(astRoot)); - } - - /** - * allow owners to verify the annotation - */ - public Annotation annotation(CompilationUnit astRoot) { - return this.annotationAdapter.getAnnotation(astRoot); - } - - //******** IJpaSourceObject implementation *********/ - public ITextRange validationTextRange() { - return this.member.annotationTextRange(DECLARATION_ANNOTATION_ADAPTER); - } - - // ********** static methods ********** - private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() { - return ConversionDeclarationAnnotationElementAdapter.forStrings(DECLARATION_ANNOTATION_ADAPTER, JPA.ORDER_BY__VALUE, false); - } -} // JavaOrderBy diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsFactory.java index 6c7a045177..cd845074d4 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsFactory.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsFactory.java @@ -138,8 +138,6 @@ public class JpaJavaMappingsFactory extends EFactoryImpl return createJavaTableGenerator(); case JpaJavaMappingsPackage.JAVA_SEQUENCE_GENERATOR : return createJavaSequenceGenerator(); - case JpaJavaMappingsPackage.JAVA_ORDER_BY : - return createJavaOrderBy(); case JpaJavaMappingsPackage.JAVA_NAMED_QUERY : return createJavaNamedQuery(); case JpaJavaMappingsPackage.JAVA_NAMED_NATIVE_QUERY : @@ -373,10 +371,6 @@ public class JpaJavaMappingsFactory extends EFactoryImpl throw new UnsupportedOperationException("Use createJavaSequenceGenerator(Member) instead"); } - public JavaOrderBy createJavaOrderBy() { - throw new UnsupportedOperationException("Use createJavaOrderBy(Member) instead"); - } - public JavaNamedQuery createJavaNamedQuery() { throw new UnsupportedOperationException("Use createJavaNamedQuery(Member, IndexedDeclarationAnnotationAdapter) instead"); } @@ -422,11 +416,6 @@ public class JpaJavaMappingsFactory extends EFactoryImpl return javaQueryHint; } - public JavaOrderBy createJavaOrderBy(Member member) { - JavaOrderBy javaOrderBy = new JavaOrderBy(member); - return javaOrderBy; - } - public JavaSequenceGenerator createJavaSequenceGenerator(Member member) { JavaSequenceGenerator javaSequenceGenerator = new JavaSequenceGenerator(member); return javaSequenceGenerator; 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 68d20ef27d..da4c6465bf 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 @@ -1221,31 +1221,31 @@ public class JpaJavaMappingsPackage extends EPackageImpl public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; /** - * The feature id for the '<em><b>Fetch</b></em>' attribute. + * The feature id for the '<em><b>Order By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1; + public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1; /** - * The feature id for the '<em><b>Join Table</b></em>' containment reference. + * The feature id for the '<em><b>Fetch</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2; + public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2; /** - * The feature id for the '<em><b>Order By</b></em>' containment reference. + * The feature id for the '<em><b>Join Table</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3; + public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Map Key</b></em>' attribute. @@ -1330,31 +1330,31 @@ public class JpaJavaMappingsPackage extends EPackageImpl public static final int JAVA_ONE_TO_MANY__MAPPED_BY = JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY; /** - * The feature id for the '<em><b>Fetch</b></em>' attribute. + * The feature id for the '<em><b>Order By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int JAVA_ONE_TO_MANY__FETCH = JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH; + public static final int JAVA_ONE_TO_MANY__ORDER_BY = JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY; /** - * The feature id for the '<em><b>Join Table</b></em>' containment reference. + * The feature id for the '<em><b>Fetch</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int JAVA_ONE_TO_MANY__JOIN_TABLE = JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; + public static final int JAVA_ONE_TO_MANY__FETCH = JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH; /** - * The feature id for the '<em><b>Order By</b></em>' containment reference. + * The feature id for the '<em><b>Join Table</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int JAVA_ONE_TO_MANY__ORDER_BY = JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY; + public static final int JAVA_ONE_TO_MANY__JOIN_TABLE = JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; /** * The feature id for the '<em><b>Map Key</b></em>' attribute. @@ -1439,31 +1439,31 @@ public class JpaJavaMappingsPackage extends EPackageImpl public static final int JAVA_MANY_TO_MANY__MAPPED_BY = JAVA_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY; /** - * The feature id for the '<em><b>Fetch</b></em>' attribute. + * The feature id for the '<em><b>Order By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int JAVA_MANY_TO_MANY__FETCH = JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH; + public static final int JAVA_MANY_TO_MANY__ORDER_BY = JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY; /** - * The feature id for the '<em><b>Join Table</b></em>' containment reference. + * The feature id for the '<em><b>Fetch</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int JAVA_MANY_TO_MANY__JOIN_TABLE = JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; + public static final int JAVA_MANY_TO_MANY__FETCH = JAVA_MULTI_RELATIONSHIP_MAPPING__FETCH; /** - * The feature id for the '<em><b>Order By</b></em>' containment reference. + * The feature id for the '<em><b>Join Table</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int JAVA_MANY_TO_MANY__ORDER_BY = JAVA_MULTI_RELATIONSHIP_MAPPING__ORDER_BY; + public static final int JAVA_MANY_TO_MANY__JOIN_TABLE = JAVA_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; /** * The feature id for the '<em><b>Map Key</b></em>' attribute. @@ -3247,43 +3247,6 @@ public class JpaJavaMappingsPackage extends EPackageImpl public static final int JAVA_SEQUENCE_GENERATOR_FEATURE_COUNT = JAVA_GENERATOR_FEATURE_COUNT + 3; /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy <em>Java Order By</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOrderBy() - * @generated - */ - public static final int JAVA_ORDER_BY = 37; - - /** - * The feature id for the '<em><b>Value</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int JAVA_ORDER_BY__VALUE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the '<em><b>Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int JAVA_ORDER_BY__TYPE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the '<em>Java Order By</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int JAVA_ORDER_BY_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 2; - - /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery <em>Java Abstract Query</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -3291,7 +3254,7 @@ public class JpaJavaMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaAbstractQuery() * @generated */ - public static final int JAVA_ABSTRACT_QUERY = 38; + public static final int JAVA_ABSTRACT_QUERY = 37; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -3337,7 +3300,7 @@ public class JpaJavaMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNamedQuery() * @generated */ - public static final int JAVA_NAMED_QUERY = 39; + public static final int JAVA_NAMED_QUERY = 38; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -3383,7 +3346,7 @@ public class JpaJavaMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaNamedNativeQuery() * @generated */ - public static final int JAVA_NAMED_NATIVE_QUERY = 40; + public static final int JAVA_NAMED_NATIVE_QUERY = 39; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -3447,7 +3410,7 @@ public class JpaJavaMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaQueryHint() * @generated */ - public static final int JAVA_QUERY_HINT = 41; + public static final int JAVA_QUERY_HINT = 40; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -3484,7 +3447,7 @@ public class JpaJavaMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaUniqueConstraint() * @generated */ - public static final int JAVA_UNIQUE_CONSTRAINT = 42; + public static final int JAVA_UNIQUE_CONSTRAINT = 41; /** * The feature id for the '<em><b>Column Names</b></em>' attribute list. @@ -3512,7 +3475,7 @@ public class JpaJavaMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaCascade() * @generated */ - public static final int JAVA_CASCADE = 43; + public static final int JAVA_CASCADE = 42; /** * The feature id for the '<em><b>All</b></em>' attribute. @@ -3825,13 +3788,6 @@ public class JpaJavaMappingsPackage extends EPackageImpl * <!-- end-user-doc --> * @generated */ - private EClass javaOrderByEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ private EClass javaAbstractQueryEClass = null; /** @@ -4390,18 +4346,6 @@ public class JpaJavaMappingsPackage extends EPackageImpl } /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy <em>Java Order By</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Java Order By</em>'. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy - * @generated - */ - public EClass getJavaOrderBy() { - return javaOrderByEClass; - } - - /** * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery <em>Java Abstract Query</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -4552,7 +4496,6 @@ public class JpaJavaMappingsPackage extends EPackageImpl javaGeneratorEClass = createEClass(JAVA_GENERATOR); javaTableGeneratorEClass = createEClass(JAVA_TABLE_GENERATOR); javaSequenceGeneratorEClass = createEClass(JAVA_SEQUENCE_GENERATOR); - javaOrderByEClass = createEClass(JAVA_ORDER_BY); javaAbstractQueryEClass = createEClass(JAVA_ABSTRACT_QUERY); javaNamedQueryEClass = createEClass(JAVA_NAMED_QUERY); javaNamedNativeQueryEClass = createEClass(JAVA_NAMED_NATIVE_QUERY); @@ -4660,8 +4603,6 @@ public class JpaJavaMappingsPackage extends EPackageImpl javaTableGeneratorEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getITableGenerator()); javaSequenceGeneratorEClass.getESuperTypes().add(this.getJavaGenerator()); javaSequenceGeneratorEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getISequenceGenerator()); - javaOrderByEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); - javaOrderByEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIOrderBy()); javaAbstractQueryEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject()); javaAbstractQueryEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIQuery()); javaNamedQueryEClass.getESuperTypes().add(this.getJavaAbstractQuery()); @@ -4712,7 +4653,6 @@ public class JpaJavaMappingsPackage extends EPackageImpl initEClass(javaGeneratorEClass, JavaGenerator.class, "JavaGenerator", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(javaTableGeneratorEClass, JavaTableGenerator.class, "JavaTableGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(javaSequenceGeneratorEClass, JavaSequenceGenerator.class, "JavaSequenceGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(javaOrderByEClass, JavaOrderBy.class, "JavaOrderBy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(javaAbstractQueryEClass, JavaAbstractQuery.class, "JavaAbstractQuery", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(javaNamedQueryEClass, JavaNamedQuery.class, "JavaNamedQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(javaNamedNativeQueryEClass, JavaNamedNativeQuery.class, "JavaNamedNativeQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -5097,16 +5037,6 @@ public class JpaJavaMappingsPackage extends EPackageImpl public static final EClass JAVA_SEQUENCE_GENERATOR = eINSTANCE.getJavaSequenceGenerator(); /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy <em>Java Order By</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy - * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaOrderBy() - * @generated - */ - public static final EClass JAVA_ORDER_BY = eINSTANCE.getJavaOrderBy(); - - /** * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery <em>Java Abstract Query</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsAdapterFactory.java index 707bd54b73..e4df5bf85b 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsAdapterFactory.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsAdapterFactory.java @@ -51,7 +51,6 @@ import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapp import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping; import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany; import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy; import org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride; import org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn; import org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint; @@ -94,7 +93,6 @@ import org.eclipse.jpt.core.internal.mappings.INamedQuery; import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; import org.eclipse.jpt.core.internal.mappings.IOneToMany; import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOrderBy; import org.eclipse.jpt.core.internal.mappings.IOverride; import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; import org.eclipse.jpt.core.internal.mappings.IQuery; @@ -351,11 +349,6 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl } @Override - public Adapter caseJavaOrderBy(JavaOrderBy object) { - return createJavaOrderByAdapter(); - } - - @Override public Adapter caseJavaAbstractQuery(JavaAbstractQuery object) { return createJavaAbstractQueryAdapter(); } @@ -601,11 +594,6 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl } @Override - public Adapter caseIOrderBy(IOrderBy object) { - return createIOrderByAdapter(); - } - - @Override public Adapter caseIQuery(IQuery object) { return createIQueryAdapter(); } @@ -1117,20 +1105,6 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy <em>Java Order By</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy - * @generated - */ - public Adapter createJavaOrderByAdapter() { - return null; - } - - /** * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaAbstractQuery <em>Java Abstract Query</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; @@ -1803,20 +1777,6 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOrderBy <em>IOrder By</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOrderBy - * @generated - */ - public Adapter createIOrderByAdapter() { - return null; - } - - /** * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IQuery <em>IQuery</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsSwitch.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsSwitch.java index bf202a455a..887ae78c16 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsSwitch.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsSwitch.java @@ -50,7 +50,6 @@ import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullAttributeMapp import org.eclipse.jpt.core.internal.content.java.mappings.JavaNullTypeMapping; import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToMany; import org.eclipse.jpt.core.internal.content.java.mappings.JavaOneToOne; -import org.eclipse.jpt.core.internal.content.java.mappings.JavaOrderBy; import org.eclipse.jpt.core.internal.content.java.mappings.JavaOverride; import org.eclipse.jpt.core.internal.content.java.mappings.JavaPrimaryKeyJoinColumn; import org.eclipse.jpt.core.internal.content.java.mappings.JavaQueryHint; @@ -93,7 +92,6 @@ import org.eclipse.jpt.core.internal.mappings.INamedQuery; import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; import org.eclipse.jpt.core.internal.mappings.IOneToMany; import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOrderBy; import org.eclipse.jpt.core.internal.mappings.IOverride; import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; import org.eclipse.jpt.core.internal.mappings.IQuery; @@ -1031,23 +1029,6 @@ public class JpaJavaMappingsSwitch<T> result = defaultCase(theEObject); return result; } - case JpaJavaMappingsPackage.JAVA_ORDER_BY : { - JavaOrderBy javaOrderBy = (JavaOrderBy) theEObject; - T result = caseJavaOrderBy(javaOrderBy); - if (result == null) - result = caseJavaEObject(javaOrderBy); - if (result == null) - result = caseIOrderBy(javaOrderBy); - if (result == null) - result = caseJpaEObject(javaOrderBy); - if (result == null) - result = caseIJpaSourceObject(javaOrderBy); - if (result == null) - result = caseIJpaEObject(javaOrderBy); - if (result == null) - result = defaultCase(theEObject); - return result; - } case JpaJavaMappingsPackage.JAVA_ABSTRACT_QUERY : { JavaAbstractQuery javaAbstractQuery = (JavaAbstractQuery) theEObject; T result = caseJavaAbstractQuery(javaAbstractQuery); @@ -1659,21 +1640,6 @@ public class JpaJavaMappingsSwitch<T> } /** - * Returns the result of interpretting the object as an instance of '<em>Java Order By</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Java Order By</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseJavaOrderBy(JavaOrderBy object) { - return null; - } - - /** * Returns the result of interpretting the object as an instance of '<em>Java Abstract Query</em>'. * <!-- begin-user-doc --> * This implementation returns null; @@ -2394,21 +2360,6 @@ public class JpaJavaMappingsSwitch<T> } /** - * Returns the result of interpretting the object as an instance of '<em>IOrder By</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IOrder By</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOrderBy(IOrderBy object) { - return null; - } - - /** * Returns the result of interpretting the object as an instance of '<em>IQuery</em>'. * <!-- begin-user-doc --> * This implementation returns null; 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 e3231bbe6a..75b6486828 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 @@ -142,8 +142,6 @@ public class OrmFactory extends EFactoryImpl return createXmlSequenceGenerator(); case OrmPackage.XML_TABLE_GENERATOR : return createXmlTableGenerator(); - case OrmPackage.XML_ORDER_BY : - return createXmlOrderBy(); case OrmPackage.XML_NAMED_QUERY : return createXmlNamedQuery(); case OrmPackage.XML_NAMED_NATIVE_QUERY : @@ -593,16 +591,6 @@ public class OrmFactory extends EFactoryImpl * <!-- end-user-doc --> * @generated */ - public XmlOrderBy createXmlOrderBy() { - XmlOrderBy xmlOrderBy = new XmlOrderBy(); - return xmlOrderBy; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ public XmlNamedQuery createXmlNamedQuery() { XmlNamedQuery xmlNamedQuery = new XmlNamedQuery(); return xmlNamedQuery; 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 78dc86ccf0..5dd4524349 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 @@ -1973,31 +1973,31 @@ public class OrmPackage extends EPackageImpl public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 0; /** - * The feature id for the '<em><b>Fetch</b></em>' attribute. + * The feature id for the '<em><b>Order By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1; + public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 1; /** - * The feature id for the '<em><b>Join Table</b></em>' containment reference. + * The feature id for the '<em><b>Fetch</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2; + public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 2; /** - * The feature id for the '<em><b>Order By</b></em>' containment reference. + * The feature id for the '<em><b>Join Table</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3; + public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Map Key</b></em>' attribute. @@ -2018,22 +2018,13 @@ public class OrmPackage extends EPackageImpl public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 5; /** - * The feature id for the '<em><b>Order By For Xml</b></em>' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY_FOR_XML = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 6; - - /** * The feature id for the '<em><b>Map Key For Xml</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 7; + public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 6; /** * The number of structural features of the '<em>Xml Multi Relationship Mapping Internal</em>' class. @@ -2042,7 +2033,7 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL_FEATURE_COUNT = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 8; + public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL_FEATURE_COUNT = XML_RELATIONSHIP_MAPPING_FEATURE_COUNT + 7; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml <em>Xml Multi Relationship Mapping For Xml</em>}' class. @@ -2064,22 +2055,13 @@ public class OrmPackage extends EPackageImpl public static final int XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__JOIN_TABLE_FOR_XML = 0; /** - * The feature id for the '<em><b>Order By For Xml</b></em>' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__ORDER_BY_FOR_XML = 1; - - /** * The feature id for the '<em><b>Map Key For Xml</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__MAP_KEY_FOR_XML = 2; + public static final int XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__MAP_KEY_FOR_XML = 1; /** * The number of structural features of the '<em>Xml Multi Relationship Mapping For Xml</em>' class. @@ -2088,7 +2070,7 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML_FEATURE_COUNT = 3; + 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. @@ -2155,31 +2137,31 @@ public class OrmPackage extends EPackageImpl public static final int XML_MULTI_RELATIONSHIP_MAPPING__MAPPED_BY = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAPPED_BY; /** - * The feature id for the '<em><b>Fetch</b></em>' attribute. + * The feature id for the '<em><b>Order By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__FETCH = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH; + public static final int XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; /** - * The feature id for the '<em><b>Join Table</b></em>' containment reference. + * The feature id for the '<em><b>Fetch</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; + public static final int XML_MULTI_RELATIONSHIP_MAPPING__FETCH = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH; /** - * The feature id for the '<em><b>Order By</b></em>' containment reference. + * The feature id for the '<em><b>Join Table</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MULTI_RELATIONSHIP_MAPPING__ORDER_BY = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; + public static final int XML_MULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; /** * The feature id for the '<em><b>Map Key</b></em>' attribute. @@ -2273,31 +2255,31 @@ public class OrmPackage extends EPackageImpl public static final int XML_ONE_TO_MANY__MAPPED_BY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY; /** - * The feature id for the '<em><b>Fetch</b></em>' attribute. + * The feature id for the '<em><b>Order By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__FETCH = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH; + public static final int XML_ONE_TO_MANY__ORDER_BY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY; /** - * The feature id for the '<em><b>Join Table</b></em>' containment reference. + * The feature id for the '<em><b>Fetch</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__JOIN_TABLE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE; + public static final int XML_ONE_TO_MANY__FETCH = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH; /** - * The feature id for the '<em><b>Order By</b></em>' containment reference. + * The feature id for the '<em><b>Join Table</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__ORDER_BY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY; + public static final int XML_ONE_TO_MANY__JOIN_TABLE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE; /** * The feature id for the '<em><b>Map Key</b></em>' attribute. @@ -2318,15 +2300,6 @@ public class OrmPackage extends EPackageImpl public static final int XML_ONE_TO_MANY__JOIN_TABLE_FOR_XML = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML; /** - * The feature id for the '<em><b>Order By For Xml</b></em>' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__ORDER_BY_FOR_XML = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY_FOR_XML; - - /** * The feature id for the '<em><b>Map Key For Xml</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2418,31 +2391,31 @@ public class OrmPackage extends EPackageImpl public static final int XML_MANY_TO_MANY__MAPPED_BY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY; /** - * The feature id for the '<em><b>Fetch</b></em>' attribute. + * The feature id for the '<em><b>Order By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__FETCH = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH; + public static final int XML_MANY_TO_MANY__ORDER_BY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY; /** - * The feature id for the '<em><b>Join Table</b></em>' containment reference. + * The feature id for the '<em><b>Fetch</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__JOIN_TABLE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE; + public static final int XML_MANY_TO_MANY__FETCH = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH; /** - * The feature id for the '<em><b>Order By</b></em>' containment reference. + * The feature id for the '<em><b>Join Table</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__ORDER_BY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY; + public static final int XML_MANY_TO_MANY__JOIN_TABLE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE; /** * The feature id for the '<em><b>Map Key</b></em>' attribute. @@ -2463,15 +2436,6 @@ public class OrmPackage extends EPackageImpl public static final int XML_MANY_TO_MANY__JOIN_TABLE_FOR_XML = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML; /** - * The feature id for the '<em><b>Order By For Xml</b></em>' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__ORDER_BY_FOR_XML = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY_FOR_XML; - - /** * The feature id for the '<em><b>Map Key For Xml</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -5479,43 +5443,6 @@ public class OrmPackage extends EPackageImpl public static final int XML_TABLE_GENERATOR_FEATURE_COUNT = XML_GENERATOR_FEATURE_COUNT + 19; /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOrderBy <em>Xml Order By</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.jpt.core.internal.content.orm.XmlOrderBy - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOrderBy() - * @generated - */ - public static final int XML_ORDER_BY = 53; - - /** - * The feature id for the '<em><b>Value</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int XML_ORDER_BY__VALUE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the '<em><b>Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int XML_ORDER_BY__TYPE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the '<em>Xml Order By</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int XML_ORDER_BY_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2; - - /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery <em>Abstract Xml Query</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -5523,7 +5450,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getAbstractXmlQuery() * @generated */ - public static final int ABSTRACT_XML_QUERY = 54; + public static final int ABSTRACT_XML_QUERY = 53; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -5569,7 +5496,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlNamedQuery() * @generated */ - public static final int XML_NAMED_QUERY = 55; + public static final int XML_NAMED_QUERY = 54; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -5615,7 +5542,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlNamedNativeQuery() * @generated */ - public static final int XML_NAMED_NATIVE_QUERY = 56; + public static final int XML_NAMED_NATIVE_QUERY = 55; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -5679,7 +5606,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlQueryHint() * @generated */ - public static final int XML_QUERY_HINT = 57; + public static final int XML_QUERY_HINT = 56; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -5716,7 +5643,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlUniqueConstraint() * @generated */ - public static final int XML_UNIQUE_CONSTRAINT = 58; + public static final int XML_UNIQUE_CONSTRAINT = 57; /** * The feature id for the '<em><b>Column Names</b></em>' attribute list. @@ -5744,7 +5671,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlCascade() * @generated */ - public static final int XML_CASCADE = 59; + public static final int XML_CASCADE = 58; /** * The feature id for the '<em><b>All</b></em>' attribute. @@ -5808,7 +5735,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlIdClass() * @generated */ - public static final int XML_ID_CLASS = 60; + public static final int XML_ID_CLASS = 59; /** * The feature id for the '<em><b>Value</b></em>' attribute. @@ -5836,7 +5763,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlInheritance() * @generated */ - public static final int XML_INHERITANCE = 61; + public static final int XML_INHERITANCE = 60; /** * The feature id for the '<em><b>Strategy</b></em>' attribute. @@ -5864,7 +5791,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMapKey() * @generated */ - public static final int XML_MAP_KEY = 62; + public static final int XML_MAP_KEY = 61; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -6260,13 +6187,6 @@ public class OrmPackage extends EPackageImpl * <!-- end-user-doc --> * @generated */ - private EClass xmlOrderByEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ private EClass abstractXmlQueryEClass = null; /** @@ -7257,19 +7177,6 @@ public class OrmPackage extends EPackageImpl } /** - * Returns the meta object for the reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getOrderByForXml <em>Order By For Xml</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the reference '<em>Order By For Xml</em>'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getOrderByForXml() - * @see #getXmlMultiRelationshipMappingForXml() - * @generated - */ - public EReference getXmlMultiRelationshipMappingForXml_OrderByForXml() { - return (EReference) xmlMultiRelationshipMappingForXmlEClass.getEStructuralFeatures().get(1); - } - - /** * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getMapKeyForXml <em>Map Key For Xml</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -7279,7 +7186,7 @@ public class OrmPackage extends EPackageImpl * @generated */ public EReference getXmlMultiRelationshipMappingForXml_MapKeyForXml() { - return (EReference) xmlMultiRelationshipMappingForXmlEClass.getEStructuralFeatures().get(2); + return (EReference) xmlMultiRelationshipMappingForXmlEClass.getEStructuralFeatures().get(1); } /** @@ -8148,18 +8055,6 @@ public class OrmPackage extends EPackageImpl } /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlOrderBy <em>Xml Order By</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>Xml Order By</em>'. - * @see org.eclipse.jpt.core.internal.content.orm.XmlOrderBy - * @generated - */ - public EClass getXmlOrderBy() { - return xmlOrderByEClass; - } - - /** * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery <em>Abstract Xml Query</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -8403,7 +8298,6 @@ public class OrmPackage extends EPackageImpl xmlMultiRelationshipMappingInternalEClass = createEClass(XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL); xmlMultiRelationshipMappingForXmlEClass = createEClass(XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML); createEReference(xmlMultiRelationshipMappingForXmlEClass, XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__JOIN_TABLE_FOR_XML); - createEReference(xmlMultiRelationshipMappingForXmlEClass, XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__ORDER_BY_FOR_XML); createEReference(xmlMultiRelationshipMappingForXmlEClass, XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__MAP_KEY_FOR_XML); xmlMultiRelationshipMappingEClass = createEClass(XML_MULTI_RELATIONSHIP_MAPPING); xmlOneToManyEClass = createEClass(XML_ONE_TO_MANY); @@ -8474,7 +8368,6 @@ public class OrmPackage extends EPackageImpl xmlGeneratorEClass = createEClass(XML_GENERATOR); xmlSequenceGeneratorEClass = createEClass(XML_SEQUENCE_GENERATOR); xmlTableGeneratorEClass = createEClass(XML_TABLE_GENERATOR); - xmlOrderByEClass = createEClass(XML_ORDER_BY); abstractXmlQueryEClass = createEClass(ABSTRACT_XML_QUERY); xmlNamedQueryEClass = createEClass(XML_NAMED_QUERY); xmlNamedNativeQueryEClass = createEClass(XML_NAMED_NATIVE_QUERY); @@ -8619,8 +8512,6 @@ public class OrmPackage extends EPackageImpl xmlSequenceGeneratorEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getISequenceGenerator()); xmlTableGeneratorEClass.getESuperTypes().add(this.getXmlGenerator()); xmlTableGeneratorEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getITableGenerator()); - xmlOrderByEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); - xmlOrderByEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIOrderBy()); abstractXmlQueryEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject()); abstractXmlQueryEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIQuery()); xmlNamedQueryEClass.getESuperTypes().add(this.getAbstractXmlQuery()); @@ -8704,7 +8595,6 @@ public class OrmPackage extends EPackageImpl initEClass(xmlMultiRelationshipMappingInternalEClass, XmlMultiRelationshipMappingInternal.class, "XmlMultiRelationshipMappingInternal", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(xmlMultiRelationshipMappingForXmlEClass, XmlMultiRelationshipMappingForXml.class, "XmlMultiRelationshipMappingForXml", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getXmlMultiRelationshipMappingForXml_JoinTableForXml(), this.getXmlJoinTable(), null, "joinTableForXml", null, 0, 1, XmlMultiRelationshipMappingForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getXmlMultiRelationshipMappingForXml_OrderByForXml(), this.getXmlOrderBy(), null, "orderByForXml", null, 0, 1, XmlMultiRelationshipMappingForXml.class, !IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getXmlMultiRelationshipMappingForXml_MapKeyForXml(), this.getXmlMapKey(), null, "mapKeyForXml", null, 0, 1, XmlMultiRelationshipMappingForXml.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(xmlMultiRelationshipMappingEClass, XmlMultiRelationshipMapping.class, "XmlMultiRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(xmlOneToManyEClass, XmlOneToMany.class, "XmlOneToMany", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -8777,7 +8667,6 @@ public class OrmPackage extends EPackageImpl initEClass(xmlGeneratorEClass, XmlGenerator.class, "XmlGenerator", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(xmlSequenceGeneratorEClass, XmlSequenceGenerator.class, "XmlSequenceGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(xmlTableGeneratorEClass, XmlTableGenerator.class, "XmlTableGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEClass(xmlOrderByEClass, XmlOrderBy.class, "XmlOrderBy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(abstractXmlQueryEClass, AbstractXmlQuery.class, "AbstractXmlQuery", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(xmlNamedQueryEClass, XmlNamedQuery.class, "XmlNamedQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(xmlNamedNativeQueryEClass, XmlNamedNativeQuery.class, "XmlNamedNativeQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -9388,14 +9277,6 @@ public class OrmPackage extends EPackageImpl public static final EReference XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__JOIN_TABLE_FOR_XML = eINSTANCE.getXmlMultiRelationshipMappingForXml_JoinTableForXml(); /** - * The meta object literal for the '<em><b>Order By For Xml</b></em>' reference feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EReference XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__ORDER_BY_FOR_XML = eINSTANCE.getXmlMultiRelationshipMappingForXml_OrderByForXml(); - - /** * The meta object literal for the '<em><b>Map Key For Xml</b></em>' containment reference feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -10020,16 +9901,6 @@ public class OrmPackage extends EPackageImpl public static final EClass XML_TABLE_GENERATOR = eINSTANCE.getXmlTableGenerator(); /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOrderBy <em>Xml Order By</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.jpt.core.internal.content.orm.XmlOrderBy - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOrderBy() - * @generated - */ - public static final EClass XML_ORDER_BY = eINSTANCE.getXmlOrderBy(); - - /** * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery <em>Abstract Xml Query</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 7c18ea9e7c..e82e1dc496 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 @@ -14,7 +14,6 @@ import java.util.Iterator; import java.util.List; import java.util.Set; import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.common.util.BasicEList; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; @@ -77,7 +76,6 @@ public class XmlEmbedded extends XmlAttributeMapping implements IEmbedded super(); } - @Override protected void addInsignificantFeatureIdsTo(Set<Integer> insignificantFeatureIds) { super.addInsignificantFeatureIdsTo(insignificantFeatureIds); diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingForXml.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingForXml.java index a58b4e041c..333d0cc30c 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingForXml.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingForXml.java @@ -19,7 +19,6 @@ import org.eclipse.emf.ecore.EObject; * The following features are supported: * <ul> * <li>{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getJoinTableForXml <em>Join Table For Xml</em>}</li> - * <li>{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getOrderByForXml <em>Order By For Xml</em>}</li> * <li>{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getMapKeyForXml <em>Map Key For Xml</em>}</li> * </ul> * </p> @@ -57,32 +56,6 @@ public interface XmlMultiRelationshipMappingForXml extends EObject void setJoinTableForXml(XmlJoinTable value); /** - * Returns the value of the '<em><b>Order By For Xml</b></em>' reference. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Order By For Xml</em>' reference isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Order By For Xml</em>' reference. - * @see #setOrderByForXml(XmlOrderBy) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlMultiRelationshipMappingForXml_OrderByForXml() - * @model resolveProxies="false" volatile="true" - * @generated - */ - XmlOrderBy getOrderByForXml(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingForXml#getOrderByForXml <em>Order By For Xml</em>}' reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Order By For Xml</em>' reference. - * @see #getOrderByForXml() - * @generated - */ - void setOrderByForXml(XmlOrderBy value); - - /** * Returns the value of the '<em><b>Map Key For Xml</b></em>' containment reference. * <!-- begin-user-doc --> * <p> diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java index 26ef44e803..a7c3849405 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java @@ -21,11 +21,13 @@ import org.eclipse.jpt.core.internal.ITypeMapping; import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper; import org.eclipse.jpt.core.internal.emfutility.DOMUtilities; import org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType; +import org.eclipse.jpt.core.internal.mappings.IEntity; import org.eclipse.jpt.core.internal.mappings.IJoinTable; import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; -import org.eclipse.jpt.core.internal.mappings.IOrderBy; import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; +import org.eclipse.jpt.core.internal.platform.DefaultsContext; +import org.eclipse.jpt.utility.internal.StringTools; import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode; /** @@ -64,6 +66,26 @@ public abstract class XmlMultiRelationshipMappingInternal protected String mappedBy = MAPPED_BY_EDEFAULT; /** + * The default value of the '{@link #getOrderBy() <em>Order By</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOrderBy() + * @generated + * @ordered + */ + protected static final String ORDER_BY_EDEFAULT = null; + + /** + * The cached value of the '{@link #getOrderBy() <em>Order By</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOrderBy() + * @generated + * @ordered + */ + protected String orderBy = ORDER_BY_EDEFAULT; + + /** * The default value of the '{@link #getFetch() <em>Fetch</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -94,16 +116,6 @@ public abstract class XmlMultiRelationshipMappingInternal protected IJoinTable joinTable; /** - * The cached value of the '{@link #getOrderBy() <em>Order By</em>}' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getOrderBy() - * @generated - * @ordered - */ - protected IOrderBy orderBy; - - /** * The default value of the '{@link #getMapKey() <em>Map Key</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -137,8 +149,6 @@ public abstract class XmlMultiRelationshipMappingInternal super(); this.joinTable = OrmFactory.eINSTANCE.createXmlJoinTable(buildJoinTableOwner()); ((InternalEObject) this.joinTable).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE, null, null); - this.orderBy = OrmFactory.eINSTANCE.createXmlOrderBy(); - ((InternalEObject) this.orderBy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY, null, null); this.eAdapters().add(this.buildListener()); } @@ -241,6 +251,89 @@ public abstract class XmlMultiRelationshipMappingInternal eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY, oldMappedBy, mappedBy)); } + /** + * Returns the value of the '<em><b>Order By</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Order By</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Order By</em>' attribute. + * @see #setOrderBy(String) + * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIMultiRelationshipMapping_OrderBy() + * @model unique="false" ordered="false" + * @generated + */ + public String getOrderBy() { + return orderBy; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal#getOrderBy <em>Order By</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Order By</em>' attribute. + * @see #getOrderBy() + * @generated + */ + public void setOrderBy(String newOrderBy) { + String oldOrderBy = orderBy; + orderBy = newOrderBy; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY, oldOrderBy, orderBy)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" unique="false" required="true" ordered="false" + * @generated NOT + */ + public boolean isNoOrdering() { + return getOrderBy() == null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated NOT + */ + public void setNoOrdering() { + setOrderBy(null); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" unique="false" required="true" ordered="false" + * @generated NOT + */ + public boolean isOrderByPk() { + return "".equals(getOrderBy()); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated NOT + */ + public void setOrderByPk() { + setOrderBy(""); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" unique="false" required="true" ordered="false" + * @generated NOT + */ + public boolean isCustomOrdering() { + return ! StringTools.stringIsEmpty(getOrderBy()); + } + public ITextRange mappedByTextRange() { if (node == null) { return typeMapping().validationTextRange(); @@ -326,41 +419,6 @@ public abstract class XmlMultiRelationshipMappingInternal } /** - * Returns the value of the '<em><b>Order By</b></em>' containment reference. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Order By</em>' reference isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Order By</em>' containment reference. - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIMultiRelationshipMapping_OrderBy() - * @model containment="true" required="true" changeable="false" - * @generated - */ - public IOrderBy getOrderBy() { - return orderBy; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain basicSetOrderBy(IOrderBy newOrderBy, NotificationChain msgs) { - IOrderBy oldOrderBy = orderBy; - orderBy = newOrderBy; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY, oldOrderBy, newOrderBy); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** * Returns the value of the '<em><b>Map Key</b></em>' attribute. * <!-- begin-user-doc --> * <p> @@ -417,23 +475,6 @@ public abstract class XmlMultiRelationshipMappingInternal } } - public XmlOrderBy getOrderByForXml() { - if (getOrderByInternal().isAllFeaturesUnset()) { - return null; - } - return getOrderByInternal(); - } - - private XmlOrderBy getOrderByInternal() { - return (XmlOrderBy) getOrderBy(); - } - - public void setOrderByForXml(XmlOrderBy newOrderByForXml) { - XmlOrderBy oldValue = newOrderByForXml == null ? (XmlOrderBy) getOrderBy() : null; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY_FOR_XML, oldValue, newOrderByForXml)); - } - /** * Returns the value of the '<em><b>Map Key For Xml</b></em>' containment reference. * <!-- begin-user-doc --> @@ -503,8 +544,6 @@ public abstract class XmlMultiRelationshipMappingInternal switch (featureID) { case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE : return basicSetJoinTable(null, msgs); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : - return basicSetOrderBy(null, msgs); case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : return basicSetMapKeyForXml(null, msgs); } @@ -521,18 +560,16 @@ public abstract class XmlMultiRelationshipMappingInternal switch (featureID) { case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY : return getMappedBy(); + case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : + return getOrderBy(); case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH : return getFetch(); case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE : return getJoinTable(); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : - return getOrderBy(); case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY : return getMapKey(); case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML : return getJoinTableForXml(); - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY_FOR_XML : - return getOrderByForXml(); case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : return getMapKeyForXml(); } @@ -550,6 +587,9 @@ public abstract class XmlMultiRelationshipMappingInternal case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY : setMappedBy((String) newValue); return; + case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : + setOrderBy((String) newValue); + return; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH : setFetch((DefaultLazyFetchType) newValue); return; @@ -559,9 +599,6 @@ public abstract class XmlMultiRelationshipMappingInternal case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML : setJoinTableForXml((XmlJoinTable) newValue); return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY_FOR_XML : - setOrderByForXml((XmlOrderBy) newValue); - return; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : setMapKeyForXml((XmlMapKey) newValue); return; @@ -580,6 +617,9 @@ public abstract class XmlMultiRelationshipMappingInternal case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY : setMappedBy(MAPPED_BY_EDEFAULT); return; + case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : + setOrderBy(ORDER_BY_EDEFAULT); + return; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH : setFetch(FETCH_EDEFAULT); return; @@ -589,9 +629,6 @@ public abstract class XmlMultiRelationshipMappingInternal case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML : setJoinTableForXml((XmlJoinTable) null); return; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY_FOR_XML : - setOrderByForXml((XmlOrderBy) null); - return; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : setMapKeyForXml((XmlMapKey) null); return; @@ -609,18 +646,16 @@ public abstract class XmlMultiRelationshipMappingInternal switch (featureID) { case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAPPED_BY : return MAPPED_BY_EDEFAULT == null ? mappedBy != null : !MAPPED_BY_EDEFAULT.equals(mappedBy); + case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : + return ORDER_BY_EDEFAULT == null ? orderBy != null : !ORDER_BY_EDEFAULT.equals(orderBy); case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH : return fetch != FETCH_EDEFAULT; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE : return joinTable != null; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : - return orderBy != null; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY : return MAP_KEY_EDEFAULT == null ? mapKey != null : !MAP_KEY_EDEFAULT.equals(mapKey); case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML : return getJoinTableForXml() != null; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY_FOR_XML : - return getOrderByForXml() != null; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : return mapKeyForXml != null; } @@ -644,12 +679,12 @@ public abstract class XmlMultiRelationshipMappingInternal } if (baseClass == IMultiRelationshipMapping.class) { switch (derivedFeatureID) { + case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : + return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH : return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE : return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY : - return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY : return JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY; default : @@ -660,8 +695,6 @@ public abstract class XmlMultiRelationshipMappingInternal switch (derivedFeatureID) { case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML : return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__JOIN_TABLE_FOR_XML; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY_FOR_XML : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__ORDER_BY_FOR_XML; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML : return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__MAP_KEY_FOR_XML; default : @@ -694,12 +727,12 @@ public abstract class XmlMultiRelationshipMappingInternal } if (baseClass == IMultiRelationshipMapping.class) { switch (baseFeatureID) { + case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY : + return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY; case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__FETCH : return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__FETCH; case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE : return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE; - case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__ORDER_BY : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY; case JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__MAP_KEY : return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY; default : @@ -710,8 +743,6 @@ public abstract class XmlMultiRelationshipMappingInternal switch (baseFeatureID) { case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__JOIN_TABLE_FOR_XML : return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__JOIN_TABLE_FOR_XML; - case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__ORDER_BY_FOR_XML : - return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__ORDER_BY_FOR_XML; case OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_FOR_XML__MAP_KEY_FOR_XML : return OrmPackage.XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__MAP_KEY_FOR_XML; default : @@ -739,6 +770,8 @@ public abstract class XmlMultiRelationshipMappingInternal StringBuffer result = new StringBuffer(super.toString()); result.append(" (mappedBy: "); result.append(mappedBy); + result.append(", orderBy: "); + result.append(orderBy); result.append(", fetch: "); result.append(fetch); result.append(", mapKey: "); @@ -755,14 +788,6 @@ public abstract class XmlMultiRelationshipMappingInternal setJoinTableForXmlGen(getJoinTableForXml()); } - public void makeOrderByForXmlNull() { - setOrderByForXml(null); - } - - public void makeOrderByForXmlNonNull() { - setOrderByForXml(getOrderByForXml()); - } - @Override public void initializeFromXmlMulitRelationshipMapping(XmlMultiRelationshipMappingInternal oldMapping) { super.initializeFromXmlMulitRelationshipMapping(oldMapping); @@ -772,4 +797,20 @@ public abstract class XmlMultiRelationshipMappingInternal public Iterator<String> candidateMapKeyNames() { return this.allTargetEntityAttributeNames(); } + + public void refreshDefaults(DefaultsContext defaultsContext) { + super.refreshDefaults(defaultsContext); + // TODO + // if (isOrderByPk()) { + // refreshDefaultOrderBy(defaultsContext); + // } + } + + //primary key ordering when just the @OrderBy annotation is present + protected void refreshDefaultOrderBy(DefaultsContext defaultsContext) { + IEntity targetEntity = getResolvedTargetEntity(); + if (targetEntity != null) { + setOrderBy(targetEntity.primaryKeyAttributeName() + " ASC"); + } + } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOrderBy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOrderBy.java deleted file mode 100644 index 1a0f1950ea..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlOrderBy.java +++ /dev/null @@ -1,327 +0,0 @@ -/******************************************************************************* - * 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.core.internal.content.orm; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.jpt.core.internal.XmlEObject; -import org.eclipse.jpt.core.internal.mappings.IOrderBy; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.OrderingType; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>Xml Order By</b></em>'. - * <!-- end-user-doc --> - * - * - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlOrderBy() - * @model kind="class" - * @generated - */ -public class XmlOrderBy extends XmlEObject implements IOrderBy -{ - /** - * The default value of the '{@link #getValue() <em>Value</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getValue() - * @generated - * @ordered - */ - protected static final String VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getValue() <em>Value</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getValue() - * @generated - * @ordered - */ - protected String value = VALUE_EDEFAULT; - - /** - * The default value of the '{@link #getType() <em>Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getType() - * @generated - * @ordered - */ - protected static final OrderingType TYPE_EDEFAULT = OrderingType.NONE; - - /** - * The cached value of the '{@link #getType() <em>Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getType() - * @generated - * @ordered - */ - protected OrderingType type = TYPE_EDEFAULT; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected XmlOrderBy() { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - protected EClass eStaticClass() { - return OrmPackage.Literals.XML_ORDER_BY; - } - - /** - * Returns the value of the '<em><b>Value</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Value</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Value</em>' attribute. - * @see #setValue(String) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIOrderBy_Value() - * @model - * @generated - */ - public String getValue() { - return value; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOrderBy#getValue <em>Value</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Value</em>' attribute. - * @see #getValue() - * @generated - */ - public void setValueGen(String newValue) { - String oldValue = value; - value = newValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ORDER_BY__VALUE, oldValue, value)); - } - - public void setValue(String newValue) { - setValueGen(newValue); - if (newValue == null) { - setTypeGen(OrderingType.NONE); - } - else { - setTypeGen(OrderingType.CUSTOM); - } - } - - /** - * Returns the value of the '<em><b>Type</b></em>' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.OrderingType}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Type</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Type</em>' attribute. - * @see org.eclipse.jpt.core.internal.mappings.OrderingType - * @see #setType(OrderingType) - * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIOrderBy_Type() - * @model - * @generated - */ - public OrderingType getType() { - return type; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOrderBy#getType <em>Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Type</em>' attribute. - * @see org.eclipse.jpt.core.internal.mappings.OrderingType - * @see #getType() - * @generated - */ - public void setTypeGen(OrderingType newType) { - OrderingType oldType = type; - type = newType == null ? TYPE_EDEFAULT : newType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ORDER_BY__TYPE, oldType, type)); - } - - public void setType(OrderingType newType) { - setTypeGen(newType); - if (newType == OrderingType.NONE) { - multiRelationshipMapping().makeOrderByForXmlNull(); - } - else { - if (newType == OrderingType.CUSTOM) { - setValueGen(""); - } - else { - setValueGen(null); - } - multiRelationshipMapping().makeOrderByForXmlNonNull(); - } - } - - private XmlMultiRelationshipMappingInternal multiRelationshipMapping() { - return (XmlMultiRelationshipMappingInternal) eContainer(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case OrmPackage.XML_ORDER_BY__VALUE : - return getValue(); - case OrmPackage.XML_ORDER_BY__TYPE : - return getType(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case OrmPackage.XML_ORDER_BY__VALUE : - setValue((String) newValue); - return; - case OrmPackage.XML_ORDER_BY__TYPE : - setType((OrderingType) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case OrmPackage.XML_ORDER_BY__VALUE : - setValue(VALUE_EDEFAULT); - return; - case OrmPackage.XML_ORDER_BY__TYPE : - setType(TYPE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case OrmPackage.XML_ORDER_BY__VALUE : - return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); - case OrmPackage.XML_ORDER_BY__TYPE : - return type != TYPE_EDEFAULT; - } - return super.eIsSet(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { - if (baseClass == IOrderBy.class) { - switch (derivedFeatureID) { - case OrmPackage.XML_ORDER_BY__VALUE : - return JpaCoreMappingsPackage.IORDER_BY__VALUE; - case OrmPackage.XML_ORDER_BY__TYPE : - return JpaCoreMappingsPackage.IORDER_BY__TYPE; - default : - return -1; - } - } - return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { - if (baseClass == IOrderBy.class) { - switch (baseFeatureID) { - case JpaCoreMappingsPackage.IORDER_BY__VALUE : - return OrmPackage.XML_ORDER_BY__VALUE; - case JpaCoreMappingsPackage.IORDER_BY__TYPE : - return OrmPackage.XML_ORDER_BY__TYPE; - default : - return -1; - } - } - return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) - return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (value: "); - result.append(value); - result.append(", type: "); - result.append(type); - result.append(')'); - return result.toString(); - } - - // private IMultiRelationshipMapping multiRelationshipMapping() { - // return (IMultiRelationshipMapping) eContainer(); - // } - // - public void refreshDefaults(DefaultsContext defaultsContext) { - // IEntity targetEntity = multiRelationshipMapping().getResolvedTargetEntity(); - // if (targetEntity != null) { - // setValue(targetEntity.primaryKeyAttributeName() + " ASC"); - // } - } -} // XmlOrderBy diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToManyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToManyTranslator.java index d3268989c6..f2775fcbf2 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToManyTranslator.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/ManyToManyTranslator.java @@ -35,7 +35,6 @@ public class ManyToManyTranslator extends MultiRelationshipTranslator createFetchTypeTranslator(), createMappedByTranslator(), createOrderByTranslator(), - //getOrderByTranslator(), createMapKeyTranslator(), getJoinTableTranslator(), createCascadeTranslator() diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiRelationshipTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiRelationshipTranslator.java index ef8061725e..20b5c7be42 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiRelationshipTranslator.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/MultiRelationshipTranslator.java @@ -8,7 +8,6 @@ *******************************************************************************/ package org.eclipse.jpt.core.internal.content.orm.resource; -import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping; import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; import org.eclipse.wst.common.internal.emf.resource.Translator; @@ -17,12 +16,9 @@ public abstract class MultiRelationshipTranslator extends RelationshipTranslator { private JoinTableTranslator tableTranslator; - //private OrderByRefTranslator orderByTranslator; - public MultiRelationshipTranslator(String domNameAndPath) { super(domNameAndPath); this.tableTranslator = createTableTranslator(); - //this.orderByTranslator = createOrderByTranslator(); } protected Translator createFetchTypeTranslator() { @@ -38,17 +34,8 @@ public abstract class MultiRelationshipTranslator extends RelationshipTranslator return this.tableTranslator; } -// protected OrderByRefTranslator getOrderByTranslator() { -// return this.orderByTranslator; -// } -// -// protected OrderByRefTranslator createOrderByTranslator() { -// this.orderByTranslator = new OrderByRefTranslator(); -// return this.orderByTranslator; -// } - - protected Translator createOrderByTranslator() { - return new Translator(ORDER_BY , (EStructuralFeature) null); + protected OrderByTranslator createOrderByTranslator() { + return new OrderByTranslator(); } protected Translator createMapKeyTranslator() { @@ -57,6 +44,5 @@ public abstract class MultiRelationshipTranslator extends RelationshipTranslator protected void setMapping(IMultiRelationshipMapping multiRelationshipMapping) { this.getJoinTableTranslator().setMapping(multiRelationshipMapping); - //this.getOrderByTranslator().setMapping(mapping); } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToManyTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToManyTranslator.java index cd623331f6..740d998852 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToManyTranslator.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OneToManyTranslator.java @@ -35,7 +35,6 @@ public class OneToManyTranslator extends MultiRelationshipTranslator createFetchTypeTranslator(), createMappedByTranslator(), createOrderByTranslator(), - //getOrderByTranslator(), createMapKeyTranslator(), getJoinTableTranslator(), createCascadeTranslator() diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrderByRefTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrderByRefTranslator.java deleted file mode 100644 index a2a282ec02..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrderByRefTranslator.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * 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.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.IMultiRelationshipMapping; -import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; -import org.eclipse.jpt.core.internal.mappings.OrderingType; -import org.eclipse.wst.common.internal.emf.resource.Translator; - -public class OrderByRefTranslator extends Translator implements OrmXmlMapper -{ - protected static final OrmPackage JPA_CORE_XML_PKG = - OrmPackage.eINSTANCE; - - private static Translator[] children; - - private IMultiRelationshipMapping mapping; - - public OrderByRefTranslator() { - super(ORDER_BY, JPA_CORE_XML_PKG.getXmlMultiRelationshipMappingForXml_OrderByForXml()); - this.fStyle = EMPTY_TAG; - } - - - public Translator[] getChildren(Object target, int versionID) { - if (children == null) { - children = createChildren(); - } - return children; - } - - private static Translator[] createChildren() { - return new Translator[] { - new Translator(TEXT_ATTRIBUTE_VALUE, JpaCoreMappingsPackage.eINSTANCE.getIOrderBy_Value()) - }; - } - - public EObject createEMFObject(String nodeName, String readAheadName) { - return this.mapping.getOrderBy(); - } - - protected IMultiRelationshipMapping getMapping() { - return this.mapping; - } - - void setMapping(IMultiRelationshipMapping mapping) { - this.mapping = mapping; - } - - @Override - public Object convertStringToValue(String strValue, EObject owner) { - if (strValue == null) { - if (mapping.getOrderBy().getType() == OrderingType.PRIMARY_KEY) { - return Boolean.TRUE; - } - } - return super.convertStringToValue(strValue, owner); - } - - public boolean isSetMOFValue(EObject emfObject) { - boolean isSet = feature != null && emfObject.eIsSet(feature); - return isSet && (mapping.getOrderBy().getType() == OrderingType.PRIMARY_KEY); - } - - @Override - public boolean isManagedByParent() { - return (mapping.getOrderBy().getType() == OrderingType.PRIMARY_KEY); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrderByTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrderByTranslator.java new file mode 100644 index 0000000000..78f118d7d5 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrderByTranslator.java @@ -0,0 +1,20 @@ +/******************************************************************************* + * 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.core.internal.content.orm.resource; + +import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage; +import org.eclipse.wst.common.internal.emf.resource.Translator; + +public class OrderByTranslator extends Translator implements OrmXmlMapper +{ + public OrderByTranslator() { + super(ORDER_BY, JpaCoreMappingsPackage.eINSTANCE.getIMultiRelationshipMapping_OrderBy(), END_TAG_NO_INDENT); + } +} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmAdapterFactory.java index 0b5cb18202..2e42c3c2dd 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmAdapterFactory.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmAdapterFactory.java @@ -71,7 +71,6 @@ import org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery; import org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping; import org.eclipse.jpt.core.internal.content.orm.XmlOneToMany; import org.eclipse.jpt.core.internal.content.orm.XmlOneToOne; -import org.eclipse.jpt.core.internal.content.orm.XmlOrderBy; import org.eclipse.jpt.core.internal.content.orm.XmlOverride; import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType; @@ -116,7 +115,6 @@ import org.eclipse.jpt.core.internal.mappings.INamedQuery; import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; import org.eclipse.jpt.core.internal.mappings.IOneToMany; import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOrderBy; import org.eclipse.jpt.core.internal.mappings.IOverride; import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; import org.eclipse.jpt.core.internal.mappings.IQuery; @@ -453,11 +451,6 @@ public class OrmAdapterFactory extends AdapterFactoryImpl } @Override - public Adapter caseXmlOrderBy(XmlOrderBy object) { - return createXmlOrderByAdapter(); - } - - @Override public Adapter caseAbstractXmlQuery(AbstractXmlQuery object) { return createAbstractXmlQueryAdapter(); } @@ -733,11 +726,6 @@ public class OrmAdapterFactory extends AdapterFactoryImpl } @Override - public Adapter caseIOrderBy(IOrderBy object) { - return createIOrderByAdapter(); - } - - @Override public Adapter caseIQuery(IQuery object) { return createIQueryAdapter(); } @@ -1501,20 +1489,6 @@ public class OrmAdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlOrderBy <em>Xml Order By</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.content.orm.XmlOrderBy - * @generated - */ - public Adapter createXmlOrderByAdapter() { - return null; - } - - /** * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.AbstractXmlQuery <em>Abstract Xml Query</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; @@ -2089,20 +2063,6 @@ public class OrmAdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOrderBy <em>IOrder By</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOrderBy - * @generated - */ - public Adapter createIOrderByAdapter() { - return null; - } - - /** * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IQuery <em>IQuery</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmSwitch.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmSwitch.java index 6969850722..54e5ce9cda 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmSwitch.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmSwitch.java @@ -70,7 +70,6 @@ import org.eclipse.jpt.core.internal.content.orm.XmlNamedQuery; import org.eclipse.jpt.core.internal.content.orm.XmlNullAttributeMapping; import org.eclipse.jpt.core.internal.content.orm.XmlOneToMany; import org.eclipse.jpt.core.internal.content.orm.XmlOneToOne; -import org.eclipse.jpt.core.internal.content.orm.XmlOrderBy; import org.eclipse.jpt.core.internal.content.orm.XmlOverride; import org.eclipse.jpt.core.internal.content.orm.XmlPersistentAttribute; import org.eclipse.jpt.core.internal.content.orm.XmlPersistentType; @@ -115,7 +114,6 @@ import org.eclipse.jpt.core.internal.mappings.INamedQuery; import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; import org.eclipse.jpt.core.internal.mappings.IOneToMany; import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOrderBy; import org.eclipse.jpt.core.internal.mappings.IOverride; import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; import org.eclipse.jpt.core.internal.mappings.IQuery; @@ -1341,25 +1339,6 @@ public class OrmSwitch<T> result = defaultCase(theEObject); return result; } - case OrmPackage.XML_ORDER_BY : { - XmlOrderBy xmlOrderBy = (XmlOrderBy) theEObject; - T result = caseXmlOrderBy(xmlOrderBy); - if (result == null) - result = caseXmlEObject(xmlOrderBy); - if (result == null) - result = caseIOrderBy(xmlOrderBy); - if (result == null) - result = caseJpaEObject(xmlOrderBy); - if (result == null) - result = caseIXmlEObject(xmlOrderBy); - if (result == null) - result = caseIJpaSourceObject(xmlOrderBy); - if (result == null) - result = caseIJpaEObject(xmlOrderBy); - if (result == null) - result = defaultCase(theEObject); - return result; - } case OrmPackage.ABSTRACT_XML_QUERY : { AbstractXmlQuery abstractXmlQuery = (AbstractXmlQuery) theEObject; T result = caseAbstractXmlQuery(abstractXmlQuery); @@ -2289,21 +2268,6 @@ public class OrmSwitch<T> } /** - * Returns the result of interpretting the object as an instance of '<em>Xml Order By</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>Xml Order By</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseXmlOrderBy(XmlOrderBy object) { - return null; - } - - /** * Returns the result of interpretting the object as an instance of '<em>Abstract Xml Query</em>'. * <!-- begin-user-doc --> * This implementation returns null; @@ -2934,21 +2898,6 @@ public class OrmSwitch<T> } /** - * Returns the result of interpretting the object as an instance of '<em>IOrder By</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IOrder By</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOrderBy(IOrderBy object) { - return null; - } - - /** * Returns the result of interpretting the object as an instance of '<em>IQuery</em>'. * <!-- begin-user-doc --> * This implementation returns null; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractJoinColumn.java index 74ee7da63c..8cdd52ff5d 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractJoinColumn.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IAbstractJoinColumn.java @@ -2,7 +2,7 @@ * <copyright> * </copyright> * - * $Id: IAbstractJoinColumn.java,v 1.8 2007/05/23 18:40:10 kmoore Exp $ + * $Id: IAbstractJoinColumn.java,v 1.9 2007/05/30 20:39:02 pfullbright Exp $ */ package org.eclipse.jpt.core.internal.mappings; @@ -117,11 +117,10 @@ public interface IAbstractJoinColumn extends INamedColumn * Return the wrapper for the datasource table for the referenced column */ Table dbReferencedColumnTable(); - + /** * return the list of join columns containing the join column */ List<? extends IAbstractJoinColumn> joinColumns(); - } } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinColumn.java index f6f3b2268e..fe077636f4 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinColumn.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IJoinColumn.java @@ -9,7 +9,6 @@ ******************************************************************************/ package org.eclipse.jpt.core.internal.mappings; - /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>IJoin Column</b></em>'. diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMultiRelationshipMapping.java index 5e5f0bcfd0..85db84e718 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMultiRelationshipMapping.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMultiRelationshipMapping.java @@ -19,9 +19,9 @@ import java.util.Iterator; * <p> * The following features are supported: * <ul> + * <li>{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getOrderBy <em>Order By</em>}</li> * <li>{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getFetch <em>Fetch</em>}</li> * <li>{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getJoinTable <em>Join Table</em>}</li> - * <li>{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getOrderBy <em>Order By</em>}</li> * <li>{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getMapKey <em>Map Key</em>}</li> * </ul> * </p> @@ -33,6 +33,32 @@ import java.util.Iterator; public interface IMultiRelationshipMapping extends INonOwningMapping { /** + * Returns the value of the '<em><b>Order By</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Order By</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Order By</em>' attribute. + * @see #setOrderBy(String) + * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMultiRelationshipMapping_OrderBy() + * @model unique="false" ordered="false" + * @generated + */ + String getOrderBy(); + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getOrderBy <em>Order By</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Order By</em>' attribute. + * @see #getOrderBy() + * @generated + */ + void setOrderBy(String value); + + /** * Returns the value of the '<em><b>Fetch</b></em>' attribute. * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType}. * <!-- begin-user-doc --> @@ -84,21 +110,6 @@ public interface IMultiRelationshipMapping extends INonOwningMapping boolean isJoinTableSpecified(); /** - * Returns the value of the '<em><b>Order By</b></em>' containment reference. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Order By</em>' reference isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Order By</em>' containment reference. - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMultiRelationshipMapping_OrderBy() - * @model containment="true" required="true" changeable="false" - * @generated - */ - IOrderBy getOrderBy(); - - /** * Returns the value of the '<em><b>Map Key</b></em>' attribute. * <!-- begin-user-doc --> * <p> @@ -124,5 +135,45 @@ public interface IMultiRelationshipMapping extends INonOwningMapping */ void setMapKey(String value); + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" unique="false" required="true" ordered="false" + * @generated + */ + boolean isNoOrdering(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + void setNoOrdering(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" unique="false" required="true" ordered="false" + * @generated + */ + boolean isOrderByPk(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model + * @generated + */ + void setOrderByPk(); + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @model kind="operation" unique="false" required="true" ordered="false" + * @generated + */ + boolean isCustomOrdering(); + Iterator<String> candidateMapKeyNames(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOrderBy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOrderBy.java deleted file mode 100644 index 90075968c3..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IOrderBy.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * 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.core.internal.mappings; - -import org.eclipse.jpt.core.internal.IJpaSourceObject; -import org.eclipse.jpt.core.internal.platform.DefaultsContext; - -/** - * <!-- begin-user-doc --> - * A representation of the model object '<em><b>IOrder By</b></em>'. - * <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.eclipse.jpt.core.internal.mappings.IOrderBy#getValue <em>Value</em>}</li> - * <li>{@link org.eclipse.jpt.core.internal.mappings.IOrderBy#getType <em>Type</em>}</li> - * </ul> - * </p> - * - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOrderBy() - * @model kind="class" interface="true" abstract="true" - * @generated - */ -public interface IOrderBy extends IJpaSourceObject -{ - /** - * Returns the value of the '<em><b>Value</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Value</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Value</em>' attribute. - * @see #setValue(String) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOrderBy_Value() - * @model - * @generated - */ - String getValue(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IOrderBy#getValue <em>Value</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Value</em>' attribute. - * @see #getValue() - * @generated - */ - void setValue(String value); - - /** - * Returns the value of the '<em><b>Type</b></em>' attribute. - * The literals are from the enumeration {@link org.eclipse.jpt.core.internal.mappings.OrderingType}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Type</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Type</em>' attribute. - * @see org.eclipse.jpt.core.internal.mappings.OrderingType - * @see #setType(OrderingType) - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOrderBy_Type() - * @model - * @generated - */ - OrderingType getType(); - - /** - * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IOrderBy#getType <em>Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Type</em>' attribute. - * @see org.eclipse.jpt.core.internal.mappings.OrderingType - * @see #getType() - * @generated - */ - void setType(OrderingType value); - - void refreshDefaults(DefaultsContext defaultsContext); -} // IOrderBy diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISecondaryTable.java index 14ecb50e94..9e64992251 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISecondaryTable.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ISecondaryTable.java @@ -122,6 +122,7 @@ public interface ISecondaryTable extends ITable public Table dbReferencedColumnTable() { return getTypeMapping().primaryDbTable(); } + public List<IPrimaryKeyJoinColumn> joinColumns() { return this.secondaryTable.getPrimaryKeyJoinColumns(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsFactory.java index f8bf52bf92..71e1442228 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsFactory.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsFactory.java @@ -101,8 +101,6 @@ public class JpaCoreMappingsFactory extends EFactoryImpl return createGenerationTypeFromString(eDataType, initialValue); case JpaCoreMappingsPackage.ENUM_TYPE : return createEnumTypeFromString(eDataType, initialValue); - case JpaCoreMappingsPackage.ORDERING_TYPE : - return createOrderingTypeFromString(eDataType, initialValue); case JpaCoreMappingsPackage.CASCADE_TYPE : return createCascadeTypeFromString(eDataType, initialValue); default : @@ -136,8 +134,6 @@ public class JpaCoreMappingsFactory extends EFactoryImpl return convertGenerationTypeToString(eDataType, instanceValue); case JpaCoreMappingsPackage.ENUM_TYPE : return convertEnumTypeToString(eDataType, instanceValue); - case JpaCoreMappingsPackage.ORDERING_TYPE : - return convertOrderingTypeToString(eDataType, instanceValue); case JpaCoreMappingsPackage.CASCADE_TYPE : return convertCascadeTypeToString(eDataType, instanceValue); default : @@ -339,27 +335,6 @@ public class JpaCoreMappingsFactory extends EFactoryImpl * <!-- end-user-doc --> * @generated */ - public OrderingType createOrderingTypeFromString(EDataType eDataType, String initialValue) { - OrderingType result = OrderingType.get(initialValue); - if (result == null) - throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String convertOrderingTypeToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ public CascadeType createCascadeTypeFromString(EDataType eDataType, String initialValue) { CascadeType result = CascadeType.get(initialValue); if (result == null) 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 ece516c60f..b5399b7eed 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 @@ -1332,31 +1332,31 @@ public class JpaCoreMappingsPackage extends EPackageImpl public static final int IMULTI_RELATIONSHIP_MAPPING__MAPPED_BY = INON_OWNING_MAPPING__MAPPED_BY; /** - * The feature id for the '<em><b>Fetch</b></em>' attribute. + * The feature id for the '<em><b>Order By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int IMULTI_RELATIONSHIP_MAPPING__FETCH = INON_OWNING_MAPPING_FEATURE_COUNT + 0; + public static final int IMULTI_RELATIONSHIP_MAPPING__ORDER_BY = INON_OWNING_MAPPING_FEATURE_COUNT + 0; /** - * The feature id for the '<em><b>Join Table</b></em>' containment reference. + * The feature id for the '<em><b>Fetch</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = INON_OWNING_MAPPING_FEATURE_COUNT + 1; + public static final int IMULTI_RELATIONSHIP_MAPPING__FETCH = INON_OWNING_MAPPING_FEATURE_COUNT + 1; /** - * The feature id for the '<em><b>Order By</b></em>' containment reference. + * The feature id for the '<em><b>Join Table</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int IMULTI_RELATIONSHIP_MAPPING__ORDER_BY = INON_OWNING_MAPPING_FEATURE_COUNT + 2; + public static final int IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = INON_OWNING_MAPPING_FEATURE_COUNT + 2; /** * The feature id for the '<em><b>Map Key</b></em>' attribute. @@ -1441,31 +1441,31 @@ public class JpaCoreMappingsPackage extends EPackageImpl public static final int IONE_TO_MANY__MAPPED_BY = IMULTI_RELATIONSHIP_MAPPING__MAPPED_BY; /** - * The feature id for the '<em><b>Fetch</b></em>' attribute. + * The feature id for the '<em><b>Order By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int IONE_TO_MANY__FETCH = IMULTI_RELATIONSHIP_MAPPING__FETCH; + public static final int IONE_TO_MANY__ORDER_BY = IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; /** - * The feature id for the '<em><b>Join Table</b></em>' containment reference. + * The feature id for the '<em><b>Fetch</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int IONE_TO_MANY__JOIN_TABLE = IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; + public static final int IONE_TO_MANY__FETCH = IMULTI_RELATIONSHIP_MAPPING__FETCH; /** - * The feature id for the '<em><b>Order By</b></em>' containment reference. + * The feature id for the '<em><b>Join Table</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int IONE_TO_MANY__ORDER_BY = IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; + public static final int IONE_TO_MANY__JOIN_TABLE = IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; /** * The feature id for the '<em><b>Map Key</b></em>' attribute. @@ -1550,31 +1550,31 @@ public class JpaCoreMappingsPackage extends EPackageImpl public static final int IMANY_TO_MANY__MAPPED_BY = IMULTI_RELATIONSHIP_MAPPING__MAPPED_BY; /** - * The feature id for the '<em><b>Fetch</b></em>' attribute. + * The feature id for the '<em><b>Order By</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int IMANY_TO_MANY__FETCH = IMULTI_RELATIONSHIP_MAPPING__FETCH; + public static final int IMANY_TO_MANY__ORDER_BY = IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; /** - * The feature id for the '<em><b>Join Table</b></em>' containment reference. + * The feature id for the '<em><b>Fetch</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int IMANY_TO_MANY__JOIN_TABLE = IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; + public static final int IMANY_TO_MANY__FETCH = IMULTI_RELATIONSHIP_MAPPING__FETCH; /** - * The feature id for the '<em><b>Order By</b></em>' containment reference. + * The feature id for the '<em><b>Join Table</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int IMANY_TO_MANY__ORDER_BY = IMULTI_RELATIONSHIP_MAPPING__ORDER_BY; + public static final int IMANY_TO_MANY__JOIN_TABLE = IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE; /** * The feature id for the '<em><b>Map Key</b></em>' attribute. @@ -3231,43 +3231,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl public static final int IGENERATED_VALUE_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IOrderBy <em>IOrder By</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.jpt.core.internal.mappings.IOrderBy - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOrderBy() - * @generated - */ - public static final int IORDER_BY = 36; - - /** - * The feature id for the '<em><b>Value</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int IORDER_BY__VALUE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0; - - /** - * The feature id for the '<em><b>Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int IORDER_BY__TYPE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the '<em>IOrder By</em>' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int IORDER_BY_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2; - - /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IQuery <em>IQuery</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -3275,7 +3238,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQuery() * @generated */ - public static final int IQUERY = 37; + public static final int IQUERY = 36; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -3321,7 +3284,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedQuery() * @generated */ - public static final int INAMED_QUERY = 38; + public static final int INAMED_QUERY = 37; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -3367,7 +3330,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedNativeQuery() * @generated */ - public static final int INAMED_NATIVE_QUERY = 39; + public static final int INAMED_NATIVE_QUERY = 38; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -3431,7 +3394,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQueryHint() * @generated */ - public static final int IQUERY_HINT = 40; + public static final int IQUERY_HINT = 39; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -3468,7 +3431,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade() * @generated */ - public static final int ICASCADE = 41; + public static final int ICASCADE = 40; /** * The feature id for the '<em><b>All</b></em>' attribute. @@ -3532,7 +3495,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultEagerFetchType() * @generated */ - public static final int DEFAULT_EAGER_FETCH_TYPE = 42; + public static final int DEFAULT_EAGER_FETCH_TYPE = 41; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType <em>Default Lazy Fetch Type</em>}' enum. @@ -3542,7 +3505,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultLazyFetchType() * @generated */ - public static final int DEFAULT_LAZY_FETCH_TYPE = 43; + public static final int DEFAULT_LAZY_FETCH_TYPE = 42; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean <em>Default False Boolean</em>}' enum. @@ -3552,7 +3515,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultFalseBoolean() * @generated */ - public static final int DEFAULT_FALSE_BOOLEAN = 44; + public static final int DEFAULT_FALSE_BOOLEAN = 43; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean <em>Default True Boolean</em>}' enum. @@ -3562,7 +3525,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultTrueBoolean() * @generated */ - public static final int DEFAULT_TRUE_BOOLEAN = 45; + public static final int DEFAULT_TRUE_BOOLEAN = 44; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.TemporalType <em>Temporal Type</em>}' enum. @@ -3572,7 +3535,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getTemporalType() * @generated */ - public static final int TEMPORAL_TYPE = 46; + public static final int TEMPORAL_TYPE = 45; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.InheritanceType <em>Inheritance Type</em>}' enum. @@ -3582,7 +3545,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getInheritanceType() * @generated */ - public static final int INHERITANCE_TYPE = 47; + public static final int INHERITANCE_TYPE = 46; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DiscriminatorType <em>Discriminator Type</em>}' enum. @@ -3592,7 +3555,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDiscriminatorType() * @generated */ - public static final int DISCRIMINATOR_TYPE = 48; + public static final int DISCRIMINATOR_TYPE = 47; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.GenerationType <em>Generation Type</em>}' enum. @@ -3602,7 +3565,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getGenerationType() * @generated */ - public static final int GENERATION_TYPE = 49; + public static final int GENERATION_TYPE = 48; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.EnumType <em>Enum Type</em>}' enum. @@ -3612,17 +3575,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getEnumType() * @generated */ - public static final int ENUM_TYPE = 50; - - /** - * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.OrderingType <em>Ordering Type</em>}' enum. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.jpt.core.internal.mappings.OrderingType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getOrderingType() - * @generated - */ - public static final int ORDERING_TYPE = 51; + public static final int ENUM_TYPE = 49; /** * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.CascadeType <em>Cascade Type</em>}' enum. @@ -3632,7 +3585,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getCascadeType() * @generated */ - public static final int CASCADE_TYPE = 52; + public static final int CASCADE_TYPE = 50; /** * <!-- begin-user-doc --> @@ -3891,13 +3844,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl * <!-- end-user-doc --> * @generated */ - private EClass iOrderByEClass = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ private EClass iQueryEClass = null; /** @@ -3996,13 +3942,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl * <!-- end-user-doc --> * @generated */ - private EEnum orderingTypeEEnum = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ private EEnum cascadeTypeEEnum = null; /** @@ -5226,41 +5165,41 @@ public class JpaCoreMappingsPackage extends EPackageImpl } /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getFetch <em>Fetch</em>}'. + * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getOrderBy <em>Order By</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Fetch</em>'. - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getFetch() + * @return the meta object for the attribute '<em>Order By</em>'. + * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getOrderBy() * @see #getIMultiRelationshipMapping() * @generated */ - public EAttribute getIMultiRelationshipMapping_Fetch() { + public EAttribute getIMultiRelationshipMapping_OrderBy() { return (EAttribute) iMultiRelationshipMappingEClass.getEStructuralFeatures().get(0); } /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getJoinTable <em>Join Table</em>}'. + * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getFetch <em>Fetch</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @return the meta object for the containment reference '<em>Join Table</em>'. - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getJoinTable() + * @return the meta object for the attribute '<em>Fetch</em>'. + * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getFetch() * @see #getIMultiRelationshipMapping() * @generated */ - public EReference getIMultiRelationshipMapping_JoinTable() { - return (EReference) iMultiRelationshipMappingEClass.getEStructuralFeatures().get(1); + public EAttribute getIMultiRelationshipMapping_Fetch() { + return (EAttribute) iMultiRelationshipMappingEClass.getEStructuralFeatures().get(1); } /** - * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getOrderBy <em>Order By</em>}'. + * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getJoinTable <em>Join Table</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @return the meta object for the containment reference '<em>Order By</em>'. - * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getOrderBy() + * @return the meta object for the containment reference '<em>Join Table</em>'. + * @see org.eclipse.jpt.core.internal.mappings.IMultiRelationshipMapping#getJoinTable() * @see #getIMultiRelationshipMapping() * @generated */ - public EReference getIMultiRelationshipMapping_OrderBy() { + public EReference getIMultiRelationshipMapping_JoinTable() { return (EReference) iMultiRelationshipMappingEClass.getEStructuralFeatures().get(2); } @@ -6235,44 +6174,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl } /** - * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IOrderBy <em>IOrder By</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for class '<em>IOrder By</em>'. - * @see org.eclipse.jpt.core.internal.mappings.IOrderBy - * @generated - */ - public EClass getIOrderBy() { - return iOrderByEClass; - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IOrderBy#getValue <em>Value</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Value</em>'. - * @see org.eclipse.jpt.core.internal.mappings.IOrderBy#getValue() - * @see #getIOrderBy() - * @generated - */ - public EAttribute getIOrderBy_Value() { - return (EAttribute) iOrderByEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.IOrderBy#getType <em>Type</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Type</em>'. - * @see org.eclipse.jpt.core.internal.mappings.IOrderBy#getType() - * @see #getIOrderBy() - * @generated - */ - public EAttribute getIOrderBy_Type() { - return (EAttribute) iOrderByEClass.getEStructuralFeatures().get(1); - } - - /** * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IQuery <em>IQuery</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -6597,18 +6498,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl } /** - * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.OrderingType <em>Ordering Type</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for enum '<em>Ordering Type</em>'. - * @see org.eclipse.jpt.core.internal.mappings.OrderingType - * @generated - */ - public EEnum getOrderingType() { - return orderingTypeEEnum; - } - - /** * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.CascadeType <em>Cascade Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -6739,9 +6628,9 @@ public class JpaCoreMappingsPackage extends EPackageImpl iNonOwningMappingEClass = createEClass(INON_OWNING_MAPPING); createEAttribute(iNonOwningMappingEClass, INON_OWNING_MAPPING__MAPPED_BY); iMultiRelationshipMappingEClass = createEClass(IMULTI_RELATIONSHIP_MAPPING); + createEAttribute(iMultiRelationshipMappingEClass, IMULTI_RELATIONSHIP_MAPPING__ORDER_BY); createEAttribute(iMultiRelationshipMappingEClass, IMULTI_RELATIONSHIP_MAPPING__FETCH); createEReference(iMultiRelationshipMappingEClass, IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE); - createEReference(iMultiRelationshipMappingEClass, IMULTI_RELATIONSHIP_MAPPING__ORDER_BY); createEAttribute(iMultiRelationshipMappingEClass, IMULTI_RELATIONSHIP_MAPPING__MAP_KEY); iOneToManyEClass = createEClass(IONE_TO_MANY); iManyToManyEClass = createEClass(IMANY_TO_MANY); @@ -6818,9 +6707,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl iGeneratedValueEClass = createEClass(IGENERATED_VALUE); createEAttribute(iGeneratedValueEClass, IGENERATED_VALUE__STRATEGY); createEAttribute(iGeneratedValueEClass, IGENERATED_VALUE__GENERATOR); - iOrderByEClass = createEClass(IORDER_BY); - createEAttribute(iOrderByEClass, IORDER_BY__VALUE); - createEAttribute(iOrderByEClass, IORDER_BY__TYPE); iQueryEClass = createEClass(IQUERY); createEAttribute(iQueryEClass, IQUERY__NAME); createEAttribute(iQueryEClass, IQUERY__QUERY); @@ -6848,7 +6734,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl discriminatorTypeEEnum = createEEnum(DISCRIMINATOR_TYPE); generationTypeEEnum = createEEnum(GENERATION_TYPE); enumTypeEEnum = createEEnum(ENUM_TYPE); - orderingTypeEEnum = createEEnum(ORDERING_TYPE); cascadeTypeEEnum = createEEnum(CASCADE_TYPE); } @@ -6921,7 +6806,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl iTableGeneratorEClass.getESuperTypes().add(this.getIGenerator()); iSequenceGeneratorEClass.getESuperTypes().add(this.getIGenerator()); iGeneratedValueEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); - iOrderByEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); iQueryEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); iNamedQueryEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject()); iNamedQueryEClass.getESuperTypes().add(this.getIQuery()); @@ -7025,10 +6909,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl initEClass(iNonOwningMappingEClass, INonOwningMapping.class, "INonOwningMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getINonOwningMapping_MappedBy(), theEcorePackage.getEString(), "mappedBy", null, 0, 1, INonOwningMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(iMultiRelationshipMappingEClass, IMultiRelationshipMapping.class, "IMultiRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getIMultiRelationshipMapping_OrderBy(), theEcorePackage.getEString(), "orderBy", null, 0, 1, IMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); initEAttribute(getIMultiRelationshipMapping_Fetch(), this.getDefaultLazyFetchType(), "fetch", null, 0, 1, IMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getIMultiRelationshipMapping_JoinTable(), this.getIJoinTable(), null, "joinTable", null, 1, 1, IMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getIMultiRelationshipMapping_OrderBy(), this.getIOrderBy(), null, "orderBy", null, 1, 1, IMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getIMultiRelationshipMapping_MapKey(), theEcorePackage.getEString(), "mapKey", null, 0, 1, IMultiRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + addEOperation(iMultiRelationshipMappingEClass, ecorePackage.getEBoolean(), "isNoOrdering", 1, 1); + addEOperation(iMultiRelationshipMappingEClass, null, "setNoOrdering"); + addEOperation(iMultiRelationshipMappingEClass, theEcorePackage.getEBoolean(), "isOrderByPk", 1, 1); + addEOperation(iMultiRelationshipMappingEClass, null, "setOrderByPk"); + addEOperation(iMultiRelationshipMappingEClass, theEcorePackage.getEBoolean(), "isCustomOrdering", 1, 1); initEClass(iOneToManyEClass, IOneToMany.class, "IOneToMany", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(iManyToManyEClass, IManyToMany.class, "IManyToMany", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(iSingleRelationshipMappingEClass, ISingleRelationshipMapping.class, "ISingleRelationshipMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -7105,9 +6994,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl initEClass(iGeneratedValueEClass, IGeneratedValue.class, "IGeneratedValue", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getIGeneratedValue_Strategy(), this.getGenerationType(), "strategy", null, 0, 1, IGeneratedValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getIGeneratedValue_Generator(), theEcorePackage.getEString(), "generator", null, 0, 1, IGeneratedValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEClass(iOrderByEClass, IOrderBy.class, "IOrderBy", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIOrderBy_Value(), theEcorePackage.getEString(), "value", null, 0, 1, IOrderBy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getIOrderBy_Type(), this.getOrderingType(), "type", null, 0, 1, IOrderBy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(iQueryEClass, IQuery.class, "IQuery", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getIQuery_Name(), theEcorePackage.getEString(), "name", null, 0, 1, IQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getIQuery_Query(), theEcorePackage.getEString(), "query", null, 0, 1, IQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -7167,10 +7053,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl addEEnumLiteral(enumTypeEEnum, EnumType.DEFAULT); addEEnumLiteral(enumTypeEEnum, EnumType.ORDINAL); addEEnumLiteral(enumTypeEEnum, EnumType.STRING); - initEEnum(orderingTypeEEnum, OrderingType.class, "OrderingType"); - addEEnumLiteral(orderingTypeEEnum, OrderingType.NONE); - addEEnumLiteral(orderingTypeEEnum, OrderingType.PRIMARY_KEY); - addEEnumLiteral(orderingTypeEEnum, OrderingType.CUSTOM); initEEnum(cascadeTypeEEnum, CascadeType.class, "CascadeType"); addEEnumLiteral(cascadeTypeEEnum, CascadeType.ALL); addEEnumLiteral(cascadeTypeEEnum, CascadeType.PERSIST); @@ -7943,28 +7825,28 @@ public class JpaCoreMappingsPackage extends EPackageImpl public static final EClass IMULTI_RELATIONSHIP_MAPPING = eINSTANCE.getIMultiRelationshipMapping(); /** - * The meta object literal for the '<em><b>Fetch</b></em>' attribute feature. + * The meta object literal for the '<em><b>Order By</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - public static final EAttribute IMULTI_RELATIONSHIP_MAPPING__FETCH = eINSTANCE.getIMultiRelationshipMapping_Fetch(); + public static final EAttribute IMULTI_RELATIONSHIP_MAPPING__ORDER_BY = eINSTANCE.getIMultiRelationshipMapping_OrderBy(); /** - * The meta object literal for the '<em><b>Join Table</b></em>' containment reference feature. + * The meta object literal for the '<em><b>Fetch</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - public static final EReference IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = eINSTANCE.getIMultiRelationshipMapping_JoinTable(); + public static final EAttribute IMULTI_RELATIONSHIP_MAPPING__FETCH = eINSTANCE.getIMultiRelationshipMapping_Fetch(); /** - * The meta object literal for the '<em><b>Order By</b></em>' containment reference feature. + * The meta object literal for the '<em><b>Join Table</b></em>' containment reference feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - public static final EReference IMULTI_RELATIONSHIP_MAPPING__ORDER_BY = eINSTANCE.getIMultiRelationshipMapping_OrderBy(); + public static final EReference IMULTI_RELATIONSHIP_MAPPING__JOIN_TABLE = eINSTANCE.getIMultiRelationshipMapping_JoinTable(); /** * The meta object literal for the '<em><b>Map Key</b></em>' attribute feature. @@ -8611,32 +8493,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl public static final EAttribute IGENERATED_VALUE__GENERATOR = eINSTANCE.getIGeneratedValue_Generator(); /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IOrderBy <em>IOrder By</em>}' class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.jpt.core.internal.mappings.IOrderBy - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOrderBy() - * @generated - */ - public static final EClass IORDER_BY = eINSTANCE.getIOrderBy(); - - /** - * The meta object literal for the '<em><b>Value</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute IORDER_BY__VALUE = eINSTANCE.getIOrderBy_Value(); - - /** - * The meta object literal for the '<em><b>Type</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute IORDER_BY__TYPE = eINSTANCE.getIOrderBy_Type(); - - /** * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IQuery <em>IQuery</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -8873,16 +8729,6 @@ public class JpaCoreMappingsPackage extends EPackageImpl public static final EEnum ENUM_TYPE = eINSTANCE.getEnumType(); /** - * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.OrderingType <em>Ordering Type</em>}' enum. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see org.eclipse.jpt.core.internal.mappings.OrderingType - * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getOrderingType() - * @generated - */ - public static final EEnum ORDERING_TYPE = eINSTANCE.getOrderingType(); - - /** * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.CascadeType <em>Cascade Type</em>}' enum. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java index fa2fc4e816..5a79a56363 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java @@ -45,7 +45,6 @@ import org.eclipse.jpt.core.internal.mappings.INamedQuery; import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; import org.eclipse.jpt.core.internal.mappings.IOneToMany; import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOrderBy; import org.eclipse.jpt.core.internal.mappings.IOverride; import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; import org.eclipse.jpt.core.internal.mappings.IQuery; @@ -298,11 +297,6 @@ public class JpaCoreMappingsAdapterFactory extends AdapterFactoryImpl } @Override - public Adapter caseIOrderBy(IOrderBy object) { - return createIOrderByAdapter(); - } - - @Override public Adapter caseIQuery(IQuery object) { return createIQueryAdapter(); } @@ -871,20 +865,6 @@ public class JpaCoreMappingsAdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IOrderBy <em>IOrder By</em>}'. - * <!-- begin-user-doc --> - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * <!-- end-user-doc --> - * @return the new adapter. - * @see org.eclipse.jpt.core.internal.mappings.IOrderBy - * @generated - */ - public Adapter createIOrderByAdapter() { - return null; - } - - /** * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IQuery <em>IQuery</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsSwitch.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsSwitch.java index 99bc98d55a..db4c09b572 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsSwitch.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsSwitch.java @@ -44,7 +44,6 @@ import org.eclipse.jpt.core.internal.mappings.INamedQuery; import org.eclipse.jpt.core.internal.mappings.INonOwningMapping; import org.eclipse.jpt.core.internal.mappings.IOneToMany; import org.eclipse.jpt.core.internal.mappings.IOneToOne; -import org.eclipse.jpt.core.internal.mappings.IOrderBy; import org.eclipse.jpt.core.internal.mappings.IOverride; import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn; import org.eclipse.jpt.core.internal.mappings.IQuery; @@ -628,17 +627,6 @@ public class JpaCoreMappingsSwitch<T> result = defaultCase(theEObject); return result; } - case JpaCoreMappingsPackage.IORDER_BY : { - IOrderBy iOrderBy = (IOrderBy) theEObject; - T result = caseIOrderBy(iOrderBy); - if (result == null) - result = caseIJpaSourceObject(iOrderBy); - if (result == null) - result = caseIJpaEObject(iOrderBy); - if (result == null) - result = defaultCase(theEObject); - return result; - } case JpaCoreMappingsPackage.IQUERY : { IQuery iQuery = (IQuery) theEObject; T result = caseIQuery(iQuery); @@ -1244,21 +1232,6 @@ public class JpaCoreMappingsSwitch<T> } /** - * Returns the result of interpretting the object as an instance of '<em>IOrder By</em>'. - * <!-- begin-user-doc --> - * This implementation returns null; - * returning a non-null result will terminate the switch. - * <!-- end-user-doc --> - * @param object the target of the switch. - * @return the result of interpretting the object as an instance of '<em>IOrder By</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIOrderBy(IOrderBy object) { - return null; - } - - /** * Returns the result of interpretting the object as an instance of '<em>IQuery</em>'. * <!-- begin-user-doc --> * This implementation returns null; diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMultiRelationshipMappingContext.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMultiRelationshipMappingContext.java index 091ec3a072..87b72940f7 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMultiRelationshipMappingContext.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/platform/JavaMultiRelationshipMappingContext.java @@ -36,7 +36,6 @@ public abstract class JavaMultiRelationshipMappingContext extends JavaRelationsh public void refreshDefaultsInternal(DefaultsContext defaultsContext) { super.refreshDefaultsInternal(defaultsContext); this.joinTableContext.refreshDefaults(defaultsContext); - getMapping().getOrderBy().refreshDefaults(defaultsContext); } @Override 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 eb621a135b..becd8cd84d 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 @@ -34,7 +34,6 @@ public abstract class XmlMultiRelationshipMappingContext public void refreshDefaults(final DefaultsContext defaultsContext) { super.refreshDefaults(defaultsContext); this.joinTableContext.refreshDefaults(defaultsContext); - multiRelationshipMapping().getOrderBy().refreshDefaults(defaultsContext); } @Override |