Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2007-05-14 15:47:23 -0400
committerkmoore2007-05-14 15:47:23 -0400
commit7825d87b06de7d464771e5e6fedf6b80b987c027 (patch)
tree967924893897c3f1961f974778de3c2807abcdf4
parentd73676bafc439be4ae1c2d635a64d787e04af63b (diff)
downloadwebtools.dali-7825d87b06de7d464771e5e6fedf6b80b987c027.tar.gz
webtools.dali-7825d87b06de7d464771e5e6fedf6b80b987c027.tar.xz
webtools.dali-7825d87b06de7d464771e5e6fedf6b80b987c027.zip
186046 - cascade support
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/core.ecore17
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel17
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/java.ecore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/orm.ecore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaCascade.java582
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinTable.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToMany.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaMultiRelationshipMapping.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToMany.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsFactory.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsAdapterFactory.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/util/JpaJavaMappingsSwitch.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlNamedColumn.java1
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlTable.java1
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlCascade.java488
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinTable.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlMultiRelationshipMappingInternal.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/CascadeTranslator.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlMapper.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/RelationshipTranslator.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmAdapterFactory.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/util/OrmSwitch.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/CascadeType.java343
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ICascade.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IMultiRelationshipMapping.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INonOwningMapping.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IRelationshipMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsFactory.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java374
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsSwitch.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java378
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java16
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java19
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java14
46 files changed, 3386 insertions, 52 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/core.ecore b/jpa/plugins/org.eclipse.jpt.core/model/core.ecore
index 69660ffa1c..6e0ea29f5f 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/core.ecore
+++ b/jpa/plugins/org.eclipse.jpt.core/model/core.ecore
@@ -295,6 +295,8 @@
changeable="false"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="resolvedTargetEntity"
eType="#//mappings/IEntity"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="cascade" eType="#//mappings/ICascade"
+ containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="INonOwningMapping" abstract="true"
interface="true" eSuperTypes="#//mappings/IRelationshipMapping">
@@ -558,5 +560,20 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EEnum" name="CascadeType">
+ <eLiterals name="ALL" literal="All"/>
+ <eLiterals name="PERSIST" value="1" literal="Persist"/>
+ <eLiterals name="MERGE" value="2" literal="Merge"/>
+ <eLiterals name="REMOVE" value="3" literal="Remove"/>
+ <eLiterals name="REFRESH" value="4" literal="Refresh"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="ICascade" abstract="true" interface="true"
+ eSuperTypes="#//IJpaSourceObject">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="all" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="persist" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="merge" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="remove" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="refresh" eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EBoolean"/>
+ </eClassifiers>
</eSubpackages>
</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel b/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
index f4b96ff1fb..1b5adbfc44 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
+++ b/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
@@ -151,6 +151,13 @@
<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"/>
+ <genEnumLiterals ecoreEnumLiteral="core.ecore#//mappings/CascadeType/MERGE"/>
+ <genEnumLiterals ecoreEnumLiteral="core.ecore#//mappings/CascadeType/REMOVE"/>
+ <genEnumLiterals ecoreEnumLiteral="core.ecore#//mappings/CascadeType/REFRESH"/>
+ </genEnums>
<genClasses ecoreClass="core.ecore#//mappings/IMappedSuperclass">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IMappedSuperclass/idClass"/>
</genClasses>
@@ -265,6 +272,7 @@
<genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IRelationshipMapping/defaultTargetEntity"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true"
ecoreFeature="ecore:EReference core.ecore#//mappings/IRelationshipMapping/resolvedTargetEntity"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference core.ecore#//mappings/IRelationshipMapping/cascade"/>
</genClasses>
<genClasses ecoreClass="core.ecore#//mappings/INonOwningMapping">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/INonOwningMapping/mappedBy"/>
@@ -382,6 +390,13 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IQueryHint/name"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IQueryHint/value"/>
</genClasses>
+ <genClasses image="false" ecoreClass="core.ecore#//mappings/ICascade">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ICascade/all"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ICascade/persist"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ICascade/merge"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ICascade/remove"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ICascade/refresh"/>
+ </genClasses>
</nestedGenPackages>
</genPackages>
<genPackages prefix="JpaJava" basePackage="org.eclipse.jpt.core.internal.content"
@@ -453,6 +468,7 @@
<genClasses ecoreClass="java.ecore#//mappings/JavaNamedNativeQuery"/>
<genClasses ecoreClass="java.ecore#//mappings/JavaQueryHint"/>
<genClasses ecoreClass="java.ecore#//mappings/JavaUniqueConstraint"/>
+ <genClasses ecoreClass="java.ecore#//mappings/JavaCascade"/>
</nestedGenPackages>
</genPackages>
<genPackages prefix="Orm" basePackage="org.eclipse.jpt.core.internal.content" disposableProviderFactory="true"
@@ -624,6 +640,7 @@
<genClasses ecoreClass="orm.ecore#//XmlNamedNativeQuery"/>
<genClasses ecoreClass="orm.ecore#//XmlQueryHint"/>
<genClasses ecoreClass="orm.ecore#//XmlUniqueConstraint"/>
+ <genClasses ecoreClass="orm.ecore#//XmlCascade"/>
</genPackages>
<genPackages prefix="Persistence" basePackage="org.eclipse.jpt.core.internal.content"
disposableProviderFactory="true" ecorePackage="persistence.ecore#/">
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/java.ecore b/jpa/plugins/org.eclipse.jpt.core/model/java.ecore
index 440a88ba4d..0f8e20fc21 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/java.ecore
+++ b/jpa/plugins/org.eclipse.jpt.core/model/java.ecore
@@ -84,5 +84,6 @@
<eClassifiers xsi:type="ecore:EClass" name="JavaNamedNativeQuery" eSuperTypes="#//mappings/JavaAbstractQuery core.ecore#//mappings/INamedNativeQuery"/>
<eClassifiers xsi:type="ecore:EClass" name="JavaQueryHint" eSuperTypes="#//JavaEObject core.ecore#//mappings/IQueryHint"/>
<eClassifiers xsi:type="ecore:EClass" name="JavaUniqueConstraint" eSuperTypes="#//JavaEObject core.ecore#//mappings/IUniqueConstraint"/>
+ <eClassifiers xsi:type="ecore:EClass" name="JavaCascade" eSuperTypes="#//JavaEObject core.ecore#//mappings/ICascade"/>
</eSubpackages>
</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore b/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
index 7f8568d5e9..4b56e9e6d7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
+++ b/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
@@ -261,4 +261,5 @@
<eClassifiers xsi:type="ecore:EClass" name="XmlNamedNativeQuery" eSuperTypes="#//AbstractXmlQuery core.ecore#//mappings/INamedNativeQuery"/>
<eClassifiers xsi:type="ecore:EClass" name="XmlQueryHint" eSuperTypes="core.ecore#//XmlEObject core.ecore#//mappings/IQueryHint"/>
<eClassifiers xsi:type="ecore:EClass" name="XmlUniqueConstraint" eSuperTypes="core.ecore#//XmlEObject core.ecore#//mappings/IUniqueConstraint"/>
+ <eClassifiers xsi:type="ecore:EClass" name="XmlCascade" eSuperTypes="core.ecore#//XmlEObject core.ecore#//mappings/ICascade"/>
</ecore:EPackage>
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 3153d89b9c..a843a4e905 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
@@ -753,7 +753,7 @@ public class JavaPersistentType extends JavaEObject implements IPersistentType
Iterator<JavaPersistentAttribute> stream = attributesNamed(attributeName);
if (stream.hasNext()) {
JavaPersistentAttribute attribute = stream.next();
- return (stream.hasNext()) ? null /*more than one*/ : attribute;
+ return (stream.hasNext()) ? null /*more than one*/: attribute;
}
return (parentPersistentType() == null) ? null : parentPersistentType().resolveAttribute(attributeName);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaCascade.java
new file mode 100644
index 0000000000..575052d90a
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaCascade.java
@@ -0,0 +1,582 @@
+/*******************************************************************************
+ * 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 java.util.Collection;
+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.CompilationUnit;
+import org.eclipse.jpt.core.internal.ITextRange;
+import org.eclipse.jpt.core.internal.content.java.JavaEObject;
+import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.jdtutility.Attribute;
+import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitArrayAnnotationElementAdapter;
+import org.eclipse.jpt.core.internal.mappings.CascadeType;
+import org.eclipse.jpt.core.internal.mappings.ICascade;
+import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Java Cascade</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaCascade()
+ * @model kind="class"
+ * @generated
+ */
+public class JavaCascade extends JavaEObject implements ICascade
+{
+ /**
+ * The default value of the '{@link #isAll() <em>All</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isAll()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean ALL_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isAll() <em>All</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isAll()
+ * @generated
+ * @ordered
+ */
+ protected boolean all = ALL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isPersist() <em>Persist</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isPersist()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean PERSIST_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isPersist() <em>Persist</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isPersist()
+ * @generated
+ * @ordered
+ */
+ protected boolean persist = PERSIST_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isMerge() <em>Merge</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isMerge()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean MERGE_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isMerge() <em>Merge</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isMerge()
+ * @generated
+ * @ordered
+ */
+ protected boolean merge = MERGE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isRemove() <em>Remove</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isRemove()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean REMOVE_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isRemove() <em>Remove</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isRemove()
+ * @generated
+ * @ordered
+ */
+ protected boolean remove = REMOVE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isRefresh() <em>Refresh</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isRefresh()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean REFRESH_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isRefresh() <em>Refresh</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isRefresh()
+ * @generated
+ * @ordered
+ */
+ protected boolean refresh = REFRESH_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected JavaCascade() {
+ super();
+ }
+
+ private Attribute attribute;
+
+ private AnnotationElementAdapter cascadeAdapter;
+
+ private DeclarationAnnotationElementAdapter<String[]> cascadeDeclarationAdapter;
+
+ protected JavaCascade(Attribute attribute, DeclarationAnnotationElementAdapter<String[]> cascadeAdapter) {
+ super();
+ this.attribute = attribute;
+ this.cascadeDeclarationAdapter = cascadeAdapter;
+ this.cascadeAdapter = new ShortCircuitArrayAnnotationElementAdapter(this.attribute, cascadeAdapter);
+ }
+
+ @Override
+ protected void notifyChanged(Notification notification) {
+ super.notifyChanged(notification);
+ switch (notification.getFeatureID(ICascade.class)) {
+ case JpaJavaMappingsPackage.JAVA_CASCADE__ALL :
+ updateJavaAnnotation(isAll(), CascadeType.ALL);
+ break;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE :
+ updateJavaAnnotation(isMerge(), CascadeType.MERGE);
+ break;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST :
+ updateJavaAnnotation(isPersist(), CascadeType.PERSIST);
+ break;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE :
+ updateJavaAnnotation(isRemove(), CascadeType.REMOVE);
+ break;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH :
+ updateJavaAnnotation(isRefresh(), CascadeType.REFRESH);
+ break;
+ default :
+ break;
+ }
+ }
+
+ private void updateJavaAnnotation(boolean isSet, CascadeType cascadeType) {
+ String[] javaValue = (String[]) this.cascadeAdapter.getValue();
+ CascadeType[] cascadeTypes = CascadeType.fromJavaAnnotationValue(javaValue);
+ Collection<CascadeType> cascadeCollection = CollectionTools.collection(cascadeTypes);
+ if (cascadeCollection.contains(cascadeType)) {
+ if (!isSet) {
+ if (javaValue.length == 1) {
+ this.cascadeAdapter.setValue(null);
+ }
+ else {
+ cascadeCollection.remove(cascadeType);
+ String[] newJavaValue = CascadeType.toJavaAnnotationValue(cascadeCollection.toArray(new CascadeType[cascadeCollection.size()]));
+ this.cascadeAdapter.setValue(newJavaValue);
+ }
+ }
+ }
+ else {
+ if (isSet) {
+ cascadeCollection.add(cascadeType);
+ String[] newJavaValue = CascadeType.toJavaAnnotationValue(cascadeCollection.toArray(new CascadeType[cascadeCollection.size()]));
+ this.cascadeAdapter.setValue(newJavaValue);
+ }
+ }
+ }
+
+ protected AnnotationElementAdapter getCascadeAdapter() {
+ return this.cascadeAdapter;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return JpaJavaMappingsPackage.Literals.JAVA_CASCADE;
+ }
+
+ /**
+ * Returns the value of the '<em><b>All</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>All</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>All</em>' attribute.
+ * @see #setAll(boolean)
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getICascade_All()
+ * @model
+ * @generated
+ */
+ public boolean isAll() {
+ return all;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade#isAll <em>All</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>All</em>' attribute.
+ * @see #isAll()
+ * @generated
+ */
+ public void setAll(boolean newAll) {
+ boolean oldAll = all;
+ all = newAll;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_CASCADE__ALL, oldAll, all));
+ }
+
+ /**
+ * Returns the value of the '<em><b>Persist</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Persist</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Persist</em>' attribute.
+ * @see #setPersist(boolean)
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getICascade_Persist()
+ * @model
+ * @generated
+ */
+ public boolean isPersist() {
+ return persist;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade#isPersist <em>Persist</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Persist</em>' attribute.
+ * @see #isPersist()
+ * @generated
+ */
+ public void setPersist(boolean newPersist) {
+ boolean oldPersist = persist;
+ persist = newPersist;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST, oldPersist, persist));
+ }
+
+ /**
+ * Returns the value of the '<em><b>Merge</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Merge</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Merge</em>' attribute.
+ * @see #setMerge(boolean)
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getICascade_Merge()
+ * @model
+ * @generated
+ */
+ public boolean isMerge() {
+ return merge;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade#isMerge <em>Merge</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Merge</em>' attribute.
+ * @see #isMerge()
+ * @generated
+ */
+ public void setMerge(boolean newMerge) {
+ boolean oldMerge = merge;
+ merge = newMerge;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_CASCADE__MERGE, oldMerge, merge));
+ }
+
+ /**
+ * Returns the value of the '<em><b>Remove</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Remove</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Remove</em>' attribute.
+ * @see #setRemove(boolean)
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getICascade_Remove()
+ * @model
+ * @generated
+ */
+ public boolean isRemove() {
+ return remove;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade#isRemove <em>Remove</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Remove</em>' attribute.
+ * @see #isRemove()
+ * @generated
+ */
+ public void setRemove(boolean newRemove) {
+ boolean oldRemove = remove;
+ remove = newRemove;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE, oldRemove, remove));
+ }
+
+ /**
+ * Returns the value of the '<em><b>Refresh</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Refresh</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Refresh</em>' attribute.
+ * @see #setRefresh(boolean)
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getICascade_Refresh()
+ * @model
+ * @generated
+ */
+ public boolean isRefresh() {
+ return refresh;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade#isRefresh <em>Refresh</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Refresh</em>' attribute.
+ * @see #isRefresh()
+ * @generated
+ */
+ public void setRefresh(boolean newRefresh) {
+ boolean oldRefresh = refresh;
+ refresh = newRefresh;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH, oldRefresh, refresh));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case JpaJavaMappingsPackage.JAVA_CASCADE__ALL :
+ return isAll() ? Boolean.TRUE : Boolean.FALSE;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST :
+ return isPersist() ? Boolean.TRUE : Boolean.FALSE;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE :
+ return isMerge() ? Boolean.TRUE : Boolean.FALSE;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE :
+ return isRemove() ? Boolean.TRUE : Boolean.FALSE;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH :
+ return isRefresh() ? Boolean.TRUE : Boolean.FALSE;
+ }
+ 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_CASCADE__ALL :
+ setAll(((Boolean) newValue).booleanValue());
+ return;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST :
+ setPersist(((Boolean) newValue).booleanValue());
+ return;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE :
+ setMerge(((Boolean) newValue).booleanValue());
+ return;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE :
+ setRemove(((Boolean) newValue).booleanValue());
+ return;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH :
+ setRefresh(((Boolean) newValue).booleanValue());
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case JpaJavaMappingsPackage.JAVA_CASCADE__ALL :
+ setAll(ALL_EDEFAULT);
+ return;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST :
+ setPersist(PERSIST_EDEFAULT);
+ return;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE :
+ setMerge(MERGE_EDEFAULT);
+ return;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE :
+ setRemove(REMOVE_EDEFAULT);
+ return;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH :
+ setRefresh(REFRESH_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case JpaJavaMappingsPackage.JAVA_CASCADE__ALL :
+ return all != ALL_EDEFAULT;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST :
+ return persist != PERSIST_EDEFAULT;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE :
+ return merge != MERGE_EDEFAULT;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE :
+ return remove != REMOVE_EDEFAULT;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH :
+ return refresh != REFRESH_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
+ if (baseClass == ICascade.class) {
+ switch (derivedFeatureID) {
+ case JpaJavaMappingsPackage.JAVA_CASCADE__ALL :
+ return JpaCoreMappingsPackage.ICASCADE__ALL;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST :
+ return JpaCoreMappingsPackage.ICASCADE__PERSIST;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__MERGE :
+ return JpaCoreMappingsPackage.ICASCADE__MERGE;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE :
+ return JpaCoreMappingsPackage.ICASCADE__REMOVE;
+ case JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH :
+ return JpaCoreMappingsPackage.ICASCADE__REFRESH;
+ 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 == ICascade.class) {
+ switch (baseFeatureID) {
+ case JpaCoreMappingsPackage.ICASCADE__ALL :
+ return JpaJavaMappingsPackage.JAVA_CASCADE__ALL;
+ case JpaCoreMappingsPackage.ICASCADE__PERSIST :
+ return JpaJavaMappingsPackage.JAVA_CASCADE__PERSIST;
+ case JpaCoreMappingsPackage.ICASCADE__MERGE :
+ return JpaJavaMappingsPackage.JAVA_CASCADE__MERGE;
+ case JpaCoreMappingsPackage.ICASCADE__REMOVE :
+ return JpaJavaMappingsPackage.JAVA_CASCADE__REMOVE;
+ case JpaCoreMappingsPackage.ICASCADE__REFRESH :
+ return JpaJavaMappingsPackage.JAVA_CASCADE__REFRESH;
+ 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(" (all: ");
+ result.append(all);
+ result.append(", persist: ");
+ result.append(persist);
+ result.append(", merge: ");
+ result.append(merge);
+ result.append(", remove: ");
+ result.append(remove);
+ result.append(", refresh: ");
+ result.append(refresh);
+ result.append(')');
+ return result.toString();
+ }
+
+ public Attribute getAttribute() {
+ return this.attribute;
+ }
+
+ public ITextRange validationTextRange() {
+ return getAttribute().annotationElementTextRange(this.cascadeDeclarationAdapter);
+ }
+
+ public void updateFromJava(CompilationUnit astRoot) {
+ String[] javaValue = (String[]) this.cascadeAdapter.getValue(astRoot);
+ CascadeType[] cascadeTypes = CascadeType.fromJavaAnnotationValue(javaValue);
+ Collection<CascadeType> cascadeCollection = CollectionTools.collection(cascadeTypes);
+ setAll(cascadeCollection.contains(CascadeType.ALL));
+ setPersist(cascadeCollection.contains(CascadeType.PERSIST));
+ setMerge(cascadeCollection.contains(CascadeType.MERGE));
+ setRemove(cascadeCollection.contains(CascadeType.REMOVE));
+ setRefresh(cascadeCollection.contains(CascadeType.REFRESH));
+ }
+} // JavaCascade
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java
index 05499c0825..6ef2c47006 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaEntity.java
@@ -2379,7 +2379,8 @@ public class JavaEntity extends JavaTypeMapping implements IEntity
private void updateIdClassFromJava(CompilationUnit astRoot) {
if (this.idClassAnnotationAdapter.getAnnotation(astRoot) == null) {
this.setIdClass(null);
- } else {
+ }
+ else {
this.setIdClass(this.idClassValueAdapter.getValue(astRoot));
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinTable.java
index eaa452075a..a3098641de 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinTable.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinTable.java
@@ -522,7 +522,7 @@ public class JavaJoinTable extends AbstractJavaTable implements IJoinTable
super.refreshDefaults(defaultsContext);
this.setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_TABLE_NAME_KEY));
}
-
+
public boolean isSpecified() {
return getMember().containsAnnotation(DECLARATION_ANNOTATION_ADAPTER);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToMany.java
index 15132f0758..e3c503c3f9 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToMany.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToMany.java
@@ -35,7 +35,7 @@ public class JavaManyToMany extends JavaMultiRelationshipMapping
private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__TARGET_ENTITY);
- private static final DeclarationAnnotationElementAdapter<String> CASCADE_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__CASCADE);
+ private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__CASCADE);
private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_MANY__FETCH);
@@ -74,7 +74,7 @@ public class JavaManyToMany extends JavaMultiRelationshipMapping
return TARGET_ENTITY_ADAPTER;
}
- protected DeclarationAnnotationElementAdapter<String> cascadeAdapter() {
+ protected DeclarationAnnotationElementAdapter<String[]> cascadeAdapter() {
return CASCADE_ADAPTER;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java
index 16c60c9018..c338197fa9 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaManyToOne.java
@@ -34,7 +34,7 @@ public class JavaManyToOne extends JavaSingleRelationshipMapping
private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__TARGET_ENTITY);
- private static final DeclarationAnnotationElementAdapter<String> CASCADE_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__CASCADE);
+ private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__CASCADE);
private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.MANY_TO_ONE__FETCH);
@@ -59,7 +59,7 @@ public class JavaManyToOne extends JavaSingleRelationshipMapping
return TARGET_ENTITY_ADAPTER;
}
- protected DeclarationAnnotationElementAdapter<String> cascadeAdapter() {
+ protected DeclarationAnnotationElementAdapter<String[]> cascadeAdapter() {
return CASCADE_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 41445b8d15..968928a8b7 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
@@ -317,7 +317,7 @@ public abstract class JavaMultiRelationshipMapping
}
return msgs;
}
-
+
public boolean isJoinTableSpecified() {
return getJavaJoinTable().isSpecified();
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java
index d04fa5881b..39e7a9886d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaNamedColumn.java
@@ -518,7 +518,7 @@ public abstract class JavaNamedColumn extends JavaEObject
private Iterator<String> candidateNames() {
Table dbTable = this.dbTable();
- return (dbTable != null) ? dbTable.columnNames() : EmptyIterator.<String>instance();
+ return (dbTable != null) ? dbTable.columnNames() : EmptyIterator.<String> instance();
}
private Iterator<String> candidateNames(Filter<String> filter) {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToMany.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToMany.java
index 87e1a9d074..42f5df0155 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToMany.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToMany.java
@@ -35,7 +35,7 @@ public class JavaOneToMany extends JavaMultiRelationshipMapping
private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__TARGET_ENTITY);
- private static final DeclarationAnnotationElementAdapter<String> CASCADE_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__CASCADE);
+ private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__CASCADE);
private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_MANY__FETCH);
@@ -74,7 +74,7 @@ public class JavaOneToMany extends JavaMultiRelationshipMapping
return TARGET_ENTITY_ADAPTER;
}
- protected DeclarationAnnotationElementAdapter<String> cascadeAdapter() {
+ protected DeclarationAnnotationElementAdapter<String[]> cascadeAdapter() {
return CASCADE_ADAPTER;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java
index 960b97c814..7303472eca 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaOneToOne.java
@@ -66,7 +66,7 @@ public class JavaOneToOne extends JavaSingleRelationshipMapping
private static final DeclarationAnnotationElementAdapter<String> TARGET_ENTITY_ADAPTER = buildTargetEntityAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__TARGET_ENTITY);
- private static final DeclarationAnnotationElementAdapter<String> CASCADE_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__CASCADE);
+ private static final DeclarationAnnotationElementAdapter<String[]> CASCADE_ADAPTER = buildEnumArrayAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__CASCADE);
private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildEnumAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.ONE_TO_ONE__FETCH);
@@ -106,7 +106,7 @@ public class JavaOneToOne extends JavaSingleRelationshipMapping
return TARGET_ENTITY_ADAPTER;
}
- protected DeclarationAnnotationElementAdapter<String> cascadeAdapter() {
+ protected DeclarationAnnotationElementAdapter<String[]> cascadeAdapter() {
return CASCADE_ADAPTER;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java
index 19f8e843af..26bd4be0fb 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaRelationshipMapping.java
@@ -11,6 +11,7 @@ package org.eclipse.jpt.core.internal.content.java.mappings;
import java.util.Iterator;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
@@ -27,12 +28,14 @@ import org.eclipse.jpt.core.internal.jdtutility.Attribute;
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.EnumArrayDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.jdtutility.EnumDeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.jdtutility.ExpressionConverter;
import org.eclipse.jpt.core.internal.jdtutility.JDTTools;
import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.jdtutility.SimpleTypeStringExpressionConverter;
import org.eclipse.jpt.core.internal.jdtutility.StringExpressionConverter;
+import org.eclipse.jpt.core.internal.mappings.ICascade;
import org.eclipse.jpt.core.internal.mappings.IEntity;
import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping;
import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
@@ -60,7 +63,6 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
{
private AnnotationElementAdapter<String> targetEntityAdapter;
- // private AnnotationElementAdapter cascadeAdapter;
/**
* all the relationship mappings have a 'fetch' setting;
* but the 1:1 and m:1 mappings have a default of EAGER,
@@ -128,6 +130,16 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
*/
protected IEntity resolvedTargetEntity;
+ /**
+ * The cached value of the '{@link #getCascade() <em>Cascade</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCascade()
+ * @generated
+ * @ordered
+ */
+ protected ICascade cascade;
+
protected JavaRelationshipMapping() {
throw new UnsupportedOperationException("Use JavaRelationshipMapping(Attribute) instead");
}
@@ -135,7 +147,6 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
protected JavaRelationshipMapping(Attribute attribute) {
super(attribute);
this.targetEntityAdapter = this.buildAnnotationElementAdapter(this.targetEntityAdapter());
- // this.cascadeAdapter = this.buildAnnotationElementAdapter(this.cascadeAdapter());
this.fetchAdapter = this.buildAnnotationElementAdapter(this.fetchAdapter());
}
@@ -151,12 +162,30 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
/**
* return the Java adapter's 'cascade' element adapter config
*/
- // protected abstract DeclarationAnnotationElementAdapter cascadeAdapter();
+ protected abstract DeclarationAnnotationElementAdapter<String[]> cascadeAdapter();
+
/**
* return the Java adapter's 'fetch' element adapter config
*/
protected abstract DeclarationAnnotationElementAdapter<String> fetchAdapter();
+ @Override
+ protected void notifyChanged(Notification notification) {
+ super.notifyChanged(notification);
+ switch (notification.getFeatureID(IRelationshipMapping.class)) {
+ case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY :
+ this.targetEntityAdapter.setValue((String) notification.getNewValue());
+ break;
+ case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE :
+ if (notification.getNewValue() == null && notification.getOldValue() != null) {
+ ((JavaCascade) notification.getOldValue()).getCascadeAdapter().setValue(null);
+ }
+ break;
+ default :
+ break;
+ }
+ }
+
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -210,18 +239,13 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
* @see #getSpecifiedTargetEntity()
* @generated
*/
- public void setSpecifiedTargetEntityGen(String newSpecifiedTargetEntity) {
+ public void setSpecifiedTargetEntity(String newSpecifiedTargetEntity) {
String oldSpecifiedTargetEntity = specifiedTargetEntity;
specifiedTargetEntity = newSpecifiedTargetEntity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY, oldSpecifiedTargetEntity, specifiedTargetEntity));
}
- public void setSpecifiedTargetEntity(String newSpecifiedTargetEntity) {
- this.targetEntityAdapter.setValue(newSpecifiedTargetEntity);
- setSpecifiedTargetEntityGen(newSpecifiedTargetEntity);
- }
-
/**
* Returns the value of the '<em><b>Default Target Entity</b></em>' attribute.
* <!-- begin-user-doc -->
@@ -297,6 +321,79 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
}
/**
+ * Returns the value of the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Cascade</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Cascade</em>' containment reference.
+ * @see #setCascade(ICascade)
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIRelationshipMapping_Cascade()
+ * @model containment="true"
+ * @generated
+ */
+ public ICascade getCascade() {
+ return cascade;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetCascade(ICascade newCascade, NotificationChain msgs) {
+ ICascade oldCascade = cascade;
+ cascade = newCascade;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE, oldCascade, newCascade);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaRelationshipMapping#getCascade <em>Cascade</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Cascade</em>' containment reference.
+ * @see #getCascade()
+ * @generated
+ */
+ public void setCascade(ICascade newCascade) {
+ if (newCascade != cascade) {
+ NotificationChain msgs = null;
+ if (cascade != null)
+ msgs = ((InternalEObject) cascade).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE, null, msgs);
+ if (newCascade != null)
+ msgs = ((InternalEObject) newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE, null, msgs);
+ msgs = basicSetCascade(newCascade, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE, newCascade, newCascade));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE :
+ return basicSetCascade(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -314,6 +411,8 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
if (resolve)
return getResolvedTargetEntity();
return basicGetResolvedTargetEntity();
+ case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE :
+ return getCascade();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -323,6 +422,7 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
* <!-- end-user-doc -->
* @generated
*/
+ @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
@@ -332,6 +432,9 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY :
setResolvedTargetEntity((IEntity) newValue);
return;
+ case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE :
+ setCascade((ICascade) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -350,6 +453,9 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY :
setResolvedTargetEntity((IEntity) null);
return;
+ case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE :
+ setCascade((ICascade) null);
+ return;
}
super.eUnset(featureID);
}
@@ -370,6 +476,8 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
return DEFAULT_TARGET_ENTITY_EDEFAULT == null ? defaultTargetEntity != null : !DEFAULT_TARGET_ENTITY_EDEFAULT.equals(defaultTargetEntity);
case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY :
return resolvedTargetEntity != null;
+ case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE :
+ return cascade != null;
}
return super.eIsSet(featureID);
}
@@ -391,6 +499,8 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY;
case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY :
return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
+ case JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE :
+ return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__CASCADE;
default :
return -1;
}
@@ -415,6 +525,8 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
return JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY;
case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY :
return JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
+ case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__CASCADE :
+ return JpaJavaMappingsPackage.JAVA_RELATIONSHIP_MAPPING__CASCADE;
default :
return -1;
}
@@ -449,8 +561,14 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
super.updateFromJava(astRoot);
setDefaultTargetEntity(this.javaDefaultTargetEntity());
setSpecifiedTargetEntity(this.targetEntityAdapter.getValue(astRoot));
- //setCascade(CascadeType.fromJavaAnnotationValue(this.cascadeAdapter.getValue(astRoot)));
this.updateFetchFromJava(astRoot);
+ if (this.cascade != null) {
+ ((JavaCascade) this.cascade).updateFromJava(astRoot);
+ }
+ else if (cascadeAdapter().expression(getAttribute().modifiedDeclaration()) != null) {
+ setCascade(createCascade());
+ ((JavaCascade) this.cascade).updateFromJava(astRoot);
+ }
}
/**
@@ -526,6 +644,10 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
return StringTools.quote(this.candidateMappedByAttributeNames(filter));
}
+ public ICascade createCascade() {
+ return JpaJavaMappingsFactory.eINSTANCE.createJavaCascade(getAttribute(), cascadeAdapter());
+ }
+
// ********** convenience methods **********
protected AnnotationElementAdapter<String> getFetchAdapter() {
return this.fetchAdapter;
@@ -549,6 +671,10 @@ public abstract class JavaRelationshipMapping extends JavaAttributeMapping
return new EnumDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false);
}
+ protected static DeclarationAnnotationElementAdapter<String[]> buildEnumArrayAnnotationElementAdapter(DeclarationAnnotationAdapter annotationAdapter, String elementName) {
+ return new EnumArrayDeclarationAnnotationElementAdapter(annotationAdapter, elementName, false);
+ }
+
public boolean targetEntityIsValid(String targetEntity) {
return RelationshipMappingTools.targetEntityIsValid(targetEntity);
}
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 1667d96062..550203d3bd 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
@@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
import org.eclipse.jpt.core.internal.jdtutility.Attribute;
import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
+import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.jdtutility.Member;
import org.eclipse.jpt.core.internal.jdtutility.NullDeclarationAnnotationAdapter;
@@ -146,6 +147,8 @@ public class JpaJavaMappingsFactory extends EFactoryImpl
return createJavaQueryHint();
case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT :
return createJavaUniqueConstraint();
+ case JpaJavaMappingsPackage.JAVA_CASCADE :
+ return createJavaCascade();
default :
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -399,6 +402,15 @@ public class JpaJavaMappingsFactory extends EFactoryImpl
throw new UnsupportedOperationException("Use createJavaUniqueConstraint(Member, IndexedDeclarationAnnotationAdapter) instead");
}
+ public JavaCascade createJavaCascade() {
+ throw new UnsupportedOperationException("Use createJavaCascade(Attribute, DeclarationAnnotationElementAdapter) instead");
+ }
+
+ public JavaCascade createJavaCascade(Attribute attribute, DeclarationAnnotationElementAdapter<String[]> cascadeAdapter) {
+ JavaCascade javaCascade = new JavaCascade(attribute, cascadeAdapter);
+ return javaCascade;
+ }
+
public JavaUniqueConstraint createJavaUniqueConstraint(Member member, IndexedDeclarationAnnotationAdapter idaa) {
JavaUniqueConstraint javaUniqueConstraint = new JavaUniqueConstraint(member, idaa);
return javaUniqueConstraint;
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 eddbc98b84..79c4be0f42 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
@@ -804,13 +804,22 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_RELATIONSHIP_MAPPING__CASCADE = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
+
+ /**
* The number of structural features of the '<em>Java Relationship Mapping</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
+ public static final int JAVA_RELATIONSHIP_MAPPING_FEATURE_COUNT = JAVA_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSingleRelationshipMapping <em>Java Single Relationship Mapping</em>}' class.
@@ -859,6 +868,15 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_SINGLE_RELATIONSHIP_MAPPING__CASCADE = JAVA_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Fetch</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -959,6 +977,15 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_MANY_TO_ONE__RESOLVED_TARGET_ENTITY = JAVA_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_MANY_TO_ONE__CASCADE = JAVA_SINGLE_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Fetch</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1059,6 +1086,15 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_ONE_TO_ONE__RESOLVED_TARGET_ENTITY = JAVA_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_ONE_TO_ONE__CASCADE = JAVA_SINGLE_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Fetch</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1168,6 +1204,15 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = JAVA_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_MULTI_RELATIONSHIP_MAPPING__CASCADE = JAVA_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Mapped By</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1268,6 +1313,15 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_ONE_TO_MANY__RESOLVED_TARGET_ENTITY = JAVA_MULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_ONE_TO_MANY__CASCADE = JAVA_MULTI_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Mapped By</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1368,6 +1422,15 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_MANY_TO_MANY__RESOLVED_TARGET_ENTITY = JAVA_MULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_MANY_TO_MANY__CASCADE = JAVA_MULTI_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Mapped By</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -3443,6 +3506,70 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_UNIQUE_CONSTRAINT_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade <em>Java Cascade</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaCascade()
+ * @generated
+ */
+ public static final int JAVA_CASCADE = 43;
+
+ /**
+ * The feature id for the '<em><b>All</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_CASCADE__ALL = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Persist</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_CASCADE__PERSIST = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Merge</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_CASCADE__MERGE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Remove</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_CASCADE__REMOVE = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 3;
+
+ /**
+ * The feature id for the '<em><b>Refresh</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_CASCADE__REFRESH = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 4;
+
+ /**
+ * The number of structural features of the '<em>Java Cascade</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_CASCADE_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 5;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -3741,6 +3868,13 @@ public class JpaJavaMappingsPackage extends EPackageImpl
* <!-- end-user-doc -->
* @generated
*/
+ private EClass javaCascadeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass javaSecondaryTableEClass = null;
/**
@@ -4330,6 +4464,18 @@ public class JpaJavaMappingsPackage extends EPackageImpl
}
/**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade <em>Java Cascade</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Java Cascade</em>'.
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade
+ * @generated
+ */
+ public EClass getJavaCascade() {
+ return javaCascadeEClass;
+ }
+
+ /**
* Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable <em>Java Secondary Table</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -4414,6 +4560,7 @@ public class JpaJavaMappingsPackage extends EPackageImpl
javaNamedNativeQueryEClass = createEClass(JAVA_NAMED_NATIVE_QUERY);
javaQueryHintEClass = createEClass(JAVA_QUERY_HINT);
javaUniqueConstraintEClass = createEClass(JAVA_UNIQUE_CONSTRAINT);
+ javaCascadeEClass = createEClass(JAVA_CASCADE);
}
/**
@@ -4527,6 +4674,8 @@ public class JpaJavaMappingsPackage extends EPackageImpl
javaQueryHintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIQueryHint());
javaUniqueConstraintEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject());
javaUniqueConstraintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIUniqueConstraint());
+ javaCascadeEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject());
+ javaCascadeEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getICascade());
// Initialize classes and features; add operations and parameters
initEClass(javaTypeMappingEClass, JavaTypeMapping.class, "JavaTypeMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(javaEntityEClass, JavaEntity.class, "JavaEntity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -4571,6 +4720,7 @@ public class JpaJavaMappingsPackage extends EPackageImpl
initEClass(javaNamedNativeQueryEClass, JavaNamedNativeQuery.class, "JavaNamedNativeQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(javaQueryHintEClass, JavaQueryHint.class, "JavaQueryHint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(javaUniqueConstraintEClass, JavaUniqueConstraint.class, "JavaUniqueConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEClass(javaCascadeEClass, JavaCascade.class, "JavaCascade", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
}
@@ -5009,6 +5159,16 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final EClass JAVA_UNIQUE_CONSTRAINT = eINSTANCE.getJavaUniqueConstraint();
/**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade <em>Java Cascade</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaCascade()
+ * @generated
+ */
+ public static final EClass JAVA_CASCADE = eINSTANCE.getJavaCascade();
+
+ /**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable <em>Java Secondary Table</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 ac9a8def91..707bd54b73 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
@@ -28,6 +28,7 @@ import org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverri
import org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic;
+import org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable;
@@ -70,6 +71,7 @@ import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
import org.eclipse.jpt.core.internal.mappings.IAssociationOverride;
import org.eclipse.jpt.core.internal.mappings.IAttributeOverride;
import org.eclipse.jpt.core.internal.mappings.IBasic;
+import org.eclipse.jpt.core.internal.mappings.ICascade;
import org.eclipse.jpt.core.internal.mappings.IColumn;
import org.eclipse.jpt.core.internal.mappings.IColumnMapping;
import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn;
@@ -379,6 +381,11 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseJavaCascade(JavaCascade object) {
+ return createJavaCascadeAdapter();
+ }
+
+ @Override
public Adapter caseIJpaEObject(IJpaEObject object) {
return createIJpaEObjectAdapter();
}
@@ -624,6 +631,11 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseICascade(ICascade object) {
+ return createICascadeAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@@ -1189,6 +1201,20 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade <em>Java Cascade</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.JavaCascade
+ * @generated
+ */
+ public Adapter createJavaCascadeAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaSecondaryTable <em>Java Secondary Table</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
@@ -1861,6 +1887,20 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ICascade <em>ICascade</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.ICascade
+ * @generated
+ */
+ public Adapter createICascadeAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ISecondaryTable <em>ISecondary Table</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 64036c3251..bf202a455a 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
@@ -27,6 +27,7 @@ import org.eclipse.jpt.core.internal.content.java.mappings.JavaAssociationOverri
import org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeMapping;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaAttributeOverride;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaBasic;
+import org.eclipse.jpt.core.internal.content.java.mappings.JavaCascade;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaColumn;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaDiscriminatorColumn;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaEmbeddable;
@@ -69,6 +70,7 @@ import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
import org.eclipse.jpt.core.internal.mappings.IAssociationOverride;
import org.eclipse.jpt.core.internal.mappings.IAttributeOverride;
import org.eclipse.jpt.core.internal.mappings.IBasic;
+import org.eclipse.jpt.core.internal.mappings.ICascade;
import org.eclipse.jpt.core.internal.mappings.IColumn;
import org.eclipse.jpt.core.internal.mappings.IColumnMapping;
import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn;
@@ -1139,6 +1141,23 @@ public class JpaJavaMappingsSwitch<T>
result = defaultCase(theEObject);
return result;
}
+ case JpaJavaMappingsPackage.JAVA_CASCADE : {
+ JavaCascade javaCascade = (JavaCascade) theEObject;
+ T result = caseJavaCascade(javaCascade);
+ if (result == null)
+ result = caseJavaEObject(javaCascade);
+ if (result == null)
+ result = caseICascade(javaCascade);
+ if (result == null)
+ result = caseJpaEObject(javaCascade);
+ if (result == null)
+ result = caseIJpaSourceObject(javaCascade);
+ if (result == null)
+ result = caseIJpaEObject(javaCascade);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
default :
return defaultCase(theEObject);
}
@@ -1730,6 +1749,21 @@ public class JpaJavaMappingsSwitch<T>
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>Java Cascade</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 Cascade</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseJavaCascade(JavaCascade object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpretting the object as an instance of '<em>Java Secondary Table</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
@@ -2450,6 +2484,21 @@ public class JpaJavaMappingsSwitch<T>
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>ICascade</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>ICascade</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseICascade(ICascade object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpretting the object as an instance of '<em>ISecondary Table</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/AbstractXmlNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlNamedColumn.java
index 04d8d7c095..044a591a4b 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlNamedColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlNamedColumn.java
@@ -21,7 +21,6 @@ import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform;
import org.eclipse.jpt.core.internal.platform.DefaultsContext;
import org.eclipse.jpt.db.internal.Column;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
import org.eclipse.jpt.db.internal.Table;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlTable.java
index c0df5f4d27..0d0d91d531 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlTable.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlTable.java
@@ -28,7 +28,6 @@ import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint;
import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
import org.eclipse.jpt.core.internal.platform.BaseJpaPlatform;
import org.eclipse.jpt.core.internal.platform.DefaultsContext;
-import org.eclipse.jpt.db.internal.ConnectionProfile;
import org.eclipse.jpt.db.internal.Schema;
import org.eclipse.jpt.db.internal.Table;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
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 626d5aba55..2b302ece90 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
@@ -152,6 +152,8 @@ public class OrmFactory extends EFactoryImpl
return createXmlQueryHint();
case OrmPackage.XML_UNIQUE_CONSTRAINT :
return createXmlUniqueConstraint();
+ case OrmPackage.XML_CASCADE :
+ return createXmlCascade();
default :
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -630,6 +632,16 @@ public class OrmFactory extends EFactoryImpl
return xmlUniqueConstraint;
}
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public XmlCascade createXmlCascade() {
+ XmlCascade xmlCascade = new XmlCascade();
+ return xmlCascade;
+ }
+
public XmlPrimaryKeyJoinColumn createXmlPrimaryKeyJoinColumn(IAbstractJoinColumn.Owner owner) {
XmlPrimaryKeyJoinColumn xmlPrimaryKeyJoinColumn = new XmlPrimaryKeyJoinColumn(owner);
return xmlPrimaryKeyJoinColumn;
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 0529c373d9..e272a5bc9b 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
@@ -1838,13 +1838,22 @@ public class OrmPackage extends EPackageImpl
public static final int XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_RELATIONSHIP_MAPPING__CASCADE = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
+
+ /**
* The number of structural features of the '<em>Xml Relationship Mapping</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_RELATIONSHIP_MAPPING_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
+ public static final int XML_RELATIONSHIP_MAPPING_FEATURE_COUNT = XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlMultiRelationshipMappingInternal <em>Xml Multi Relationship Mapping Internal</em>}' class.
@@ -1902,6 +1911,15 @@ public class OrmPackage extends EPackageImpl
public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__RESOLVED_TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__CASCADE = XML_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Mapped By</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2057,6 +2075,15 @@ public class OrmPackage extends EPackageImpl
public static final int XML_MULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_MULTI_RELATIONSHIP_MAPPING__CASCADE = JpaCoreMappingsPackage.IMULTI_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Mapped By</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2166,6 +2193,15 @@ public class OrmPackage extends EPackageImpl
public static final int XML_ONE_TO_MANY__RESOLVED_TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ONE_TO_MANY__CASCADE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__CASCADE;
+
+ /**
* The feature id for the '<em><b>Mapped By</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2293,6 +2329,15 @@ public class OrmPackage extends EPackageImpl
public static final int XML_MANY_TO_MANY__RESOLVED_TARGET_ENTITY = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_MANY_TO_MANY__CASCADE = XML_MULTI_RELATIONSHIP_MAPPING_INTERNAL__CASCADE;
+
+ /**
* The feature id for the '<em><b>Mapped By</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -3847,6 +3892,15 @@ public class OrmPackage extends EPackageImpl
public static final int XML_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE = XML_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Fetch</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -3956,6 +4010,15 @@ public class OrmPackage extends EPackageImpl
public static final int XML_MANY_TO_ONE__RESOLVED_TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_MANY_TO_ONE__CASCADE = XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Fetch</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -4065,6 +4128,15 @@ public class OrmPackage extends EPackageImpl
public static final int XML_ONE_TO_ONE__RESOLVED_TARGET_ENTITY = XML_SINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_ONE_TO_ONE__CASCADE = XML_SINGLE_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Fetch</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5585,6 +5657,70 @@ public class OrmPackage extends EPackageImpl
public static final int XML_UNIQUE_CONSTRAINT_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade <em>Xml Cascade</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlCascade
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlCascade()
+ * @generated
+ */
+ public static final int XML_CASCADE = 59;
+
+ /**
+ * The feature id for the '<em><b>All</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_CASCADE__ALL = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Persist</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_CASCADE__PERSIST = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Merge</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_CASCADE__MERGE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Remove</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_CASCADE__REMOVE = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 3;
+
+ /**
+ * The feature id for the '<em><b>Refresh</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_CASCADE__REFRESH = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 4;
+
+ /**
+ * The number of structural features of the '<em>Xml Cascade</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_CASCADE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 5;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -5998,6 +6134,13 @@ public class OrmPackage extends EPackageImpl
private EClass xmlUniqueConstraintEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass xmlCascadeEClass = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -7841,6 +7984,18 @@ public class OrmPackage extends EPackageImpl
}
/**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade <em>Xml Cascade</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Xml Cascade</em>'.
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlCascade
+ * @generated
+ */
+ public EClass getXmlCascade() {
+ return xmlCascadeEClass;
+ }
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -8010,6 +8165,7 @@ public class OrmPackage extends EPackageImpl
xmlNamedNativeQueryEClass = createEClass(XML_NAMED_NATIVE_QUERY);
xmlQueryHintEClass = createEClass(XML_QUERY_HINT);
xmlUniqueConstraintEClass = createEClass(XML_UNIQUE_CONSTRAINT);
+ xmlCascadeEClass = createEClass(XML_CASCADE);
}
/**
@@ -8154,6 +8310,8 @@ public class OrmPackage extends EPackageImpl
xmlQueryHintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIQueryHint());
xmlUniqueConstraintEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject());
xmlUniqueConstraintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIUniqueConstraint());
+ xmlCascadeEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject());
+ xmlCascadeEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getICascade());
// Initialize classes and features; add operations and parameters
initEClass(xmlRootContentNodeEClass, XmlRootContentNode.class, "XmlRootContentNode", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getXmlRootContentNode_EntityMappings(), this.getEntityMappingsInternal(), this.getEntityMappingsInternal_Root(), "entityMappings", null, 1, 1, XmlRootContentNode.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
@@ -8297,6 +8455,7 @@ public class OrmPackage extends EPackageImpl
initEClass(xmlNamedNativeQueryEClass, XmlNamedNativeQuery.class, "XmlNamedNativeQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(xmlQueryHintEClass, XmlQueryHint.class, "XmlQueryHint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(xmlUniqueConstraintEClass, XmlUniqueConstraint.class, "XmlUniqueConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEClass(xmlCascadeEClass, XmlCascade.class, "XmlCascade", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
// Create resource
createResource(eNS_URI);
}
@@ -9553,5 +9712,15 @@ public class OrmPackage extends EPackageImpl
* @generated
*/
public static final EClass XML_UNIQUE_CONSTRAINT = eINSTANCE.getXmlUniqueConstraint();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade <em>Xml Cascade</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlCascade
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlCascade()
+ * @generated
+ */
+ public static final EClass XML_CASCADE = eINSTANCE.getXmlCascade();
}
} //OrmPackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlCascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlCascade.java
new file mode 100644
index 0000000000..aac4d933ab
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlCascade.java
@@ -0,0 +1,488 @@
+/*******************************************************************************
+ * 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.ICascade;
+import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Xml Cascade</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlCascade()
+ * @model kind="class"
+ * @generated
+ */
+public class XmlCascade extends XmlEObject implements ICascade
+{
+ /**
+ * The default value of the '{@link #isAll() <em>All</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isAll()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean ALL_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isAll() <em>All</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isAll()
+ * @generated
+ * @ordered
+ */
+ protected boolean all = ALL_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isPersist() <em>Persist</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isPersist()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean PERSIST_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isPersist() <em>Persist</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isPersist()
+ * @generated
+ * @ordered
+ */
+ protected boolean persist = PERSIST_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isMerge() <em>Merge</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isMerge()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean MERGE_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isMerge() <em>Merge</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isMerge()
+ * @generated
+ * @ordered
+ */
+ protected boolean merge = MERGE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isRemove() <em>Remove</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isRemove()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean REMOVE_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isRemove() <em>Remove</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isRemove()
+ * @generated
+ * @ordered
+ */
+ protected boolean remove = REMOVE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isRefresh() <em>Refresh</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isRefresh()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean REFRESH_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isRefresh() <em>Refresh</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isRefresh()
+ * @generated
+ * @ordered
+ */
+ protected boolean refresh = REFRESH_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected XmlCascade() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return OrmPackage.Literals.XML_CASCADE;
+ }
+
+ /**
+ * Returns the value of the '<em><b>All</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>All</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>All</em>' attribute.
+ * @see #setAll(boolean)
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getICascade_All()
+ * @model
+ * @generated
+ */
+ public boolean isAll() {
+ return all;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade#isAll <em>All</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>All</em>' attribute.
+ * @see #isAll()
+ * @generated
+ */
+ public void setAll(boolean newAll) {
+ boolean oldAll = all;
+ all = newAll;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_CASCADE__ALL, oldAll, all));
+ }
+
+ /**
+ * Returns the value of the '<em><b>Persist</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Persist</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Persist</em>' attribute.
+ * @see #setPersist(boolean)
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getICascade_Persist()
+ * @model
+ * @generated
+ */
+ public boolean isPersist() {
+ return persist;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade#isPersist <em>Persist</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Persist</em>' attribute.
+ * @see #isPersist()
+ * @generated
+ */
+ public void setPersist(boolean newPersist) {
+ boolean oldPersist = persist;
+ persist = newPersist;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_CASCADE__PERSIST, oldPersist, persist));
+ }
+
+ /**
+ * Returns the value of the '<em><b>Merge</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Merge</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Merge</em>' attribute.
+ * @see #setMerge(boolean)
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getICascade_Merge()
+ * @model
+ * @generated
+ */
+ public boolean isMerge() {
+ return merge;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade#isMerge <em>Merge</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Merge</em>' attribute.
+ * @see #isMerge()
+ * @generated
+ */
+ public void setMerge(boolean newMerge) {
+ boolean oldMerge = merge;
+ merge = newMerge;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_CASCADE__MERGE, oldMerge, merge));
+ }
+
+ /**
+ * Returns the value of the '<em><b>Remove</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Remove</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Remove</em>' attribute.
+ * @see #setRemove(boolean)
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getICascade_Remove()
+ * @model
+ * @generated
+ */
+ public boolean isRemove() {
+ return remove;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade#isRemove <em>Remove</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Remove</em>' attribute.
+ * @see #isRemove()
+ * @generated
+ */
+ public void setRemove(boolean newRemove) {
+ boolean oldRemove = remove;
+ remove = newRemove;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_CASCADE__REMOVE, oldRemove, remove));
+ }
+
+ /**
+ * Returns the value of the '<em><b>Refresh</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Refresh</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Refresh</em>' attribute.
+ * @see #setRefresh(boolean)
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getICascade_Refresh()
+ * @model
+ * @generated
+ */
+ public boolean isRefresh() {
+ return refresh;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade#isRefresh <em>Refresh</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Refresh</em>' attribute.
+ * @see #isRefresh()
+ * @generated
+ */
+ public void setRefresh(boolean newRefresh) {
+ boolean oldRefresh = refresh;
+ refresh = newRefresh;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_CASCADE__REFRESH, oldRefresh, refresh));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case OrmPackage.XML_CASCADE__ALL :
+ return isAll() ? Boolean.TRUE : Boolean.FALSE;
+ case OrmPackage.XML_CASCADE__PERSIST :
+ return isPersist() ? Boolean.TRUE : Boolean.FALSE;
+ case OrmPackage.XML_CASCADE__MERGE :
+ return isMerge() ? Boolean.TRUE : Boolean.FALSE;
+ case OrmPackage.XML_CASCADE__REMOVE :
+ return isRemove() ? Boolean.TRUE : Boolean.FALSE;
+ case OrmPackage.XML_CASCADE__REFRESH :
+ return isRefresh() ? Boolean.TRUE : Boolean.FALSE;
+ }
+ 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_CASCADE__ALL :
+ setAll(((Boolean) newValue).booleanValue());
+ return;
+ case OrmPackage.XML_CASCADE__PERSIST :
+ setPersist(((Boolean) newValue).booleanValue());
+ return;
+ case OrmPackage.XML_CASCADE__MERGE :
+ setMerge(((Boolean) newValue).booleanValue());
+ return;
+ case OrmPackage.XML_CASCADE__REMOVE :
+ setRemove(((Boolean) newValue).booleanValue());
+ return;
+ case OrmPackage.XML_CASCADE__REFRESH :
+ setRefresh(((Boolean) newValue).booleanValue());
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case OrmPackage.XML_CASCADE__ALL :
+ setAll(ALL_EDEFAULT);
+ return;
+ case OrmPackage.XML_CASCADE__PERSIST :
+ setPersist(PERSIST_EDEFAULT);
+ return;
+ case OrmPackage.XML_CASCADE__MERGE :
+ setMerge(MERGE_EDEFAULT);
+ return;
+ case OrmPackage.XML_CASCADE__REMOVE :
+ setRemove(REMOVE_EDEFAULT);
+ return;
+ case OrmPackage.XML_CASCADE__REFRESH :
+ setRefresh(REFRESH_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case OrmPackage.XML_CASCADE__ALL :
+ return all != ALL_EDEFAULT;
+ case OrmPackage.XML_CASCADE__PERSIST :
+ return persist != PERSIST_EDEFAULT;
+ case OrmPackage.XML_CASCADE__MERGE :
+ return merge != MERGE_EDEFAULT;
+ case OrmPackage.XML_CASCADE__REMOVE :
+ return remove != REMOVE_EDEFAULT;
+ case OrmPackage.XML_CASCADE__REFRESH :
+ return refresh != REFRESH_EDEFAULT;
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
+ if (baseClass == ICascade.class) {
+ switch (derivedFeatureID) {
+ case OrmPackage.XML_CASCADE__ALL :
+ return JpaCoreMappingsPackage.ICASCADE__ALL;
+ case OrmPackage.XML_CASCADE__PERSIST :
+ return JpaCoreMappingsPackage.ICASCADE__PERSIST;
+ case OrmPackage.XML_CASCADE__MERGE :
+ return JpaCoreMappingsPackage.ICASCADE__MERGE;
+ case OrmPackage.XML_CASCADE__REMOVE :
+ return JpaCoreMappingsPackage.ICASCADE__REMOVE;
+ case OrmPackage.XML_CASCADE__REFRESH :
+ return JpaCoreMappingsPackage.ICASCADE__REFRESH;
+ 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 == ICascade.class) {
+ switch (baseFeatureID) {
+ case JpaCoreMappingsPackage.ICASCADE__ALL :
+ return OrmPackage.XML_CASCADE__ALL;
+ case JpaCoreMappingsPackage.ICASCADE__PERSIST :
+ return OrmPackage.XML_CASCADE__PERSIST;
+ case JpaCoreMappingsPackage.ICASCADE__MERGE :
+ return OrmPackage.XML_CASCADE__MERGE;
+ case JpaCoreMappingsPackage.ICASCADE__REMOVE :
+ return OrmPackage.XML_CASCADE__REMOVE;
+ case JpaCoreMappingsPackage.ICASCADE__REFRESH :
+ return OrmPackage.XML_CASCADE__REFRESH;
+ 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(" (all: ");
+ result.append(all);
+ result.append(", persist: ");
+ result.append(persist);
+ result.append(", merge: ");
+ result.append(merge);
+ result.append(", remove: ");
+ result.append(remove);
+ result.append(", refresh: ");
+ result.append(refresh);
+ result.append(')');
+ return result.toString();
+ }
+} // XmlCascade
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinTable.java
index 97a3f7fdc0..bc63a52579 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinTable.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlJoinTable.java
@@ -500,9 +500,9 @@ public class XmlJoinTable extends AbstractXmlTable implements IJoinTable
super.refreshDefaults(defaultsContext);
setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_JOIN_TABLE_NAME_KEY));
}
-
+
public boolean isSpecified() {
- return node != null;
+ return node != null;
}
public IRelationshipMapping relationshipMapping() {
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 aa74f208a6..9f341360d0 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
@@ -261,7 +261,7 @@ public abstract class XmlMultiRelationshipMappingInternal
}
return msgs;
}
-
+
public boolean isJoinTableSpecified() {
XmlJoinTable joinTable = getJoinTableForXml();
return joinTable != null && joinTable.isSpecified();
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java
index 88220f88b6..15d1a09c16 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlRelationshipMapping.java
@@ -10,11 +10,13 @@ package org.eclipse.jpt.core.internal.content.orm;
import java.util.Iterator;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.IPersistentAttribute;
import org.eclipse.jpt.core.internal.IPersistentType;
+import org.eclipse.jpt.core.internal.mappings.ICascade;
import org.eclipse.jpt.core.internal.mappings.IEntity;
import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping;
import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
@@ -98,6 +100,16 @@ public abstract class XmlRelationshipMapping extends XmlAttributeMapping
protected IEntity resolvedTargetEntity;
/**
+ * The cached value of the '{@link #getCascade() <em>Cascade</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCascade()
+ * @generated
+ * @ordered
+ */
+ protected ICascade cascade;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -233,6 +245,83 @@ public abstract class XmlRelationshipMapping extends XmlAttributeMapping
eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY, oldResolvedTargetEntity, resolvedTargetEntity));
}
+ /**
+ * Returns the value of the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Cascade</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Cascade</em>' containment reference.
+ * @see #setCascade(ICascade)
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIRelationshipMapping_Cascade()
+ * @model containment="true"
+ * @generated
+ */
+ public ICascade getCascade() {
+ return cascade;
+ }
+
+ public ICascade createCascade() {
+ return OrmFactory.eINSTANCE.createXmlCascade();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain basicSetCascade(ICascade newCascade, NotificationChain msgs) {
+ ICascade oldCascade = cascade;
+ cascade = newCascade;
+ if (eNotificationRequired()) {
+ ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE, oldCascade, newCascade);
+ if (msgs == null)
+ msgs = notification;
+ else
+ msgs.add(notification);
+ }
+ return msgs;
+ }
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.content.orm.XmlRelationshipMapping#getCascade <em>Cascade</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Cascade</em>' containment reference.
+ * @see #getCascade()
+ * @generated
+ */
+ public void setCascade(ICascade newCascade) {
+ if (newCascade != cascade) {
+ NotificationChain msgs = null;
+ if (cascade != null)
+ msgs = ((InternalEObject) cascade).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE, null, msgs);
+ if (newCascade != null)
+ msgs = ((InternalEObject) newCascade).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE, null, msgs);
+ msgs = basicSetCascade(newCascade, msgs);
+ if (msgs != null)
+ msgs.dispatch();
+ }
+ else if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE, newCascade, newCascade));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE :
+ return basicSetCascade(null, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
//TODO should we allow setting through the ecore, that would make this method
//public and part of the ITable api. only the model needs to be setting the default,
//but the ui needs to be listening for changes to the default.
@@ -261,6 +350,8 @@ public abstract class XmlRelationshipMapping extends XmlAttributeMapping
if (resolve)
return getResolvedTargetEntity();
return basicGetResolvedTargetEntity();
+ case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE :
+ return getCascade();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -270,6 +361,7 @@ public abstract class XmlRelationshipMapping extends XmlAttributeMapping
* <!-- end-user-doc -->
* @generated
*/
+ @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
@@ -279,6 +371,9 @@ public abstract class XmlRelationshipMapping extends XmlAttributeMapping
case OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY :
setResolvedTargetEntity((IEntity) newValue);
return;
+ case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE :
+ setCascade((ICascade) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -297,6 +392,9 @@ public abstract class XmlRelationshipMapping extends XmlAttributeMapping
case OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY :
setResolvedTargetEntity((IEntity) null);
return;
+ case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE :
+ setCascade((ICascade) null);
+ return;
}
super.eUnset(featureID);
}
@@ -317,6 +415,8 @@ public abstract class XmlRelationshipMapping extends XmlAttributeMapping
return DEFAULT_TARGET_ENTITY_EDEFAULT == null ? defaultTargetEntity != null : !DEFAULT_TARGET_ENTITY_EDEFAULT.equals(defaultTargetEntity);
case OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY :
return resolvedTargetEntity != null;
+ case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE :
+ return cascade != null;
}
return super.eIsSet(featureID);
}
@@ -338,6 +438,8 @@ public abstract class XmlRelationshipMapping extends XmlAttributeMapping
return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY;
case OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY :
return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
+ case OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE :
+ return JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__CASCADE;
default :
return -1;
}
@@ -362,6 +464,8 @@ public abstract class XmlRelationshipMapping extends XmlAttributeMapping
return OrmPackage.XML_RELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY;
case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY :
return OrmPackage.XML_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
+ case JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__CASCADE :
+ return OrmPackage.XML_RELATIONSHIP_MAPPING__CASCADE;
default :
return -1;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/CascadeTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/CascadeTranslator.java
new file mode 100644
index 0000000000..3312b47e51
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/CascadeTranslator.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * 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.emf.ecore.EStructuralFeature;
+import org.eclipse.jpt.core.internal.content.orm.OrmFactory;
+import org.eclipse.jpt.core.internal.content.orm.OrmPackage;
+import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
+import org.eclipse.wst.common.internal.emf.resource.IDTranslator;
+import org.eclipse.wst.common.internal.emf.resource.Translator;
+
+public class CascadeTranslator extends Translator implements OrmXmlMapper
+{
+ protected static final JpaCoreMappingsPackage MAPPINGS_PKG =
+ JpaCoreMappingsPackage.eINSTANCE;
+ protected static final OrmPackage JPA_CORE_XML_PKG =
+ OrmPackage.eINSTANCE;
+
+
+ private Translator[] children;
+
+ public CascadeTranslator(String domNameAndPath, EStructuralFeature aFeature) {
+ super(domNameAndPath, aFeature);
+ }
+
+ public Translator[] getChildren(Object target, int versionID) {
+ if (children == null) {
+ children = createChildren();
+ }
+ return children;
+ }
+
+ protected Translator[] createChildren() {
+ return new Translator[] {
+ IDTranslator.INSTANCE,
+ createCascadeAllTranslator(),
+ createCascadePersistTranslator(),
+ createCascadeMergeTranslator(),
+ createCascadeRemoveTranslator(),
+ createCascadeRefreshTranslator(),
+ };
+ }
+
+ protected Translator createCascadeAllTranslator() {
+ return new EmptyTagBooleanTranslator(CASCADE__CASCADE_ALL, MAPPINGS_PKG.getICascade_All());
+ }
+
+ protected Translator createCascadePersistTranslator() {
+ return new EmptyTagBooleanTranslator(CASCADE__CASCADE_PERSIST, MAPPINGS_PKG.getICascade_Persist());
+ }
+
+ protected Translator createCascadeMergeTranslator() {
+ return new EmptyTagBooleanTranslator(CASCADE__CASCADE_MERGE, MAPPINGS_PKG.getICascade_Merge());
+ }
+
+ protected Translator createCascadeRemoveTranslator() {
+ return new EmptyTagBooleanTranslator(CASCADE__CASCADE_REMOVE, MAPPINGS_PKG.getICascade_Remove());
+ }
+
+ protected Translator createCascadeRefreshTranslator() {
+ return new EmptyTagBooleanTranslator(CASCADE__CASCADE_REFRESH, MAPPINGS_PKG.getICascade_Refresh());
+ }
+
+ @Override
+ public EObject createEMFObject(String nodeName, String readAheadName) {
+ return OrmFactory.eINSTANCE.createXmlCascade();
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlMapper.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlMapper.java
index 194319dd41..c46f03842e 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlMapper.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlMapper.java
@@ -30,7 +30,14 @@ public interface OrmXmlMapper
String BASIC__ENUMERATED = "enumerated"; //$NON-NLS-1$
String CASCADE = "cascade"; //$NON-NLS-1$
+ String CASCADE__CASCADE_ALL = "cascade-all"; //$NON-NLS-1$
+ String CASCADE__CASCADE_PERSIST = "cascade-persist"; //$NON-NLS-1$
+ String CASCADE__CASCADE_MERGE = "cascade-merge"; //$NON-NLS-1$
+ String CASCADE__CASCADE_REMOVE = "cascade-remove"; //$NON-NLS-1$
+ String CASCADE__CASCADE_REFRESH = "cascade-refresh"; //$NON-NLS-1$
+
String CASCADE_PERSIST = "cascade-persist"; //$NON-NLS-1$
+
String CATALOG = "catalog"; //$NON-NLS-1$
String CLASS = "class"; //$NON-NLS-1$
String COLUMN = "column"; //$NON-NLS-1$
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/RelationshipTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/RelationshipTranslator.java
index 6246073976..cee4d5218d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/RelationshipTranslator.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/RelationshipTranslator.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.JpaCoreMappingsPackage;
import org.eclipse.wst.common.internal.emf.resource.Translator;
@@ -25,7 +24,7 @@ public abstract class RelationshipTranslator extends AttributeMappingTranslator
//placeholder until we support in our model, this allow us
//to keep the elements in the proper order
protected Translator createCascadeTranslator() {
- return new Translator(CASCADE , (EStructuralFeature) null);
+ return new CascadeTranslator(CASCADE , JpaCoreMappingsPackage.eINSTANCE.getIRelationshipMapping_Cascade());
}
protected Translator createMappedByTranslator() {
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 753fa0fbe2..cb2b2a92cc 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
@@ -43,6 +43,7 @@ import org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride;
import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping;
import org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride;
import org.eclipse.jpt.core.internal.content.orm.XmlBasic;
+import org.eclipse.jpt.core.internal.content.orm.XmlCascade;
import org.eclipse.jpt.core.internal.content.orm.XmlColumn;
import org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn;
import org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable;
@@ -89,6 +90,7 @@ import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
import org.eclipse.jpt.core.internal.mappings.IAssociationOverride;
import org.eclipse.jpt.core.internal.mappings.IAttributeOverride;
import org.eclipse.jpt.core.internal.mappings.IBasic;
+import org.eclipse.jpt.core.internal.mappings.ICascade;
import org.eclipse.jpt.core.internal.mappings.IColumn;
import org.eclipse.jpt.core.internal.mappings.IColumnMapping;
import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn;
@@ -478,6 +480,11 @@ public class OrmAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseXmlCascade(XmlCascade object) {
+ return createXmlCascadeAdapter();
+ }
+
+ @Override
public Adapter caseIJpaEObject(IJpaEObject object) {
return createIJpaEObjectAdapter();
}
@@ -738,6 +745,11 @@ public class OrmAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseICascade(ICascade object) {
+ return createICascadeAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@@ -1555,6 +1567,20 @@ public class OrmAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlCascade <em>Xml Cascade</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.XmlCascade
+ * @generated
+ */
+ public Adapter createXmlCascadeAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaEObject <em>IJpa EObject</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
@@ -2087,6 +2113,20 @@ public class OrmAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ICascade <em>ICascade</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.ICascade
+ * @generated
+ */
+ public Adapter createICascadeAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IBasic <em>IBasic</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 096ef9d99d..3b2f6aaf47 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
@@ -42,6 +42,7 @@ import org.eclipse.jpt.core.internal.content.orm.XmlAssociationOverride;
import org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping;
import org.eclipse.jpt.core.internal.content.orm.XmlAttributeOverride;
import org.eclipse.jpt.core.internal.content.orm.XmlBasic;
+import org.eclipse.jpt.core.internal.content.orm.XmlCascade;
import org.eclipse.jpt.core.internal.content.orm.XmlColumn;
import org.eclipse.jpt.core.internal.content.orm.XmlDiscriminatorColumn;
import org.eclipse.jpt.core.internal.content.orm.XmlEmbeddable;
@@ -88,6 +89,7 @@ import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
import org.eclipse.jpt.core.internal.mappings.IAssociationOverride;
import org.eclipse.jpt.core.internal.mappings.IAttributeOverride;
import org.eclipse.jpt.core.internal.mappings.IBasic;
+import org.eclipse.jpt.core.internal.mappings.ICascade;
import org.eclipse.jpt.core.internal.mappings.IColumn;
import org.eclipse.jpt.core.internal.mappings.IColumnMapping;
import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn;
@@ -1458,6 +1460,25 @@ public class OrmSwitch<T>
result = defaultCase(theEObject);
return result;
}
+ case OrmPackage.XML_CASCADE : {
+ XmlCascade xmlCascade = (XmlCascade) theEObject;
+ T result = caseXmlCascade(xmlCascade);
+ if (result == null)
+ result = caseXmlEObject(xmlCascade);
+ if (result == null)
+ result = caseICascade(xmlCascade);
+ if (result == null)
+ result = caseJpaEObject(xmlCascade);
+ if (result == null)
+ result = caseIXmlEObject(xmlCascade);
+ if (result == null)
+ result = caseIJpaSourceObject(xmlCascade);
+ if (result == null)
+ result = caseIJpaEObject(xmlCascade);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
default :
return defaultCase(theEObject);
}
@@ -2304,6 +2325,21 @@ public class OrmSwitch<T>
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>Xml Cascade</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 Cascade</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseXmlCascade(XmlCascade object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpretting the object as an instance of '<em>IJpa EObject</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
@@ -2889,6 +2925,21 @@ public class OrmSwitch<T>
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>ICascade</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>ICascade</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseICascade(ICascade object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpretting the object as an instance of '<em>IBasic</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/CascadeType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/CascadeType.java
new file mode 100644
index 0000000000..5514bda74e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/CascadeType.java
@@ -0,0 +1,343 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jpt.core.internal.mappings;
+
+import static org.eclipse.jpt.core.internal.mappings.CascadeType.ALL_VALUE;
+import static org.eclipse.jpt.core.internal.mappings.CascadeType.MERGE_VALUE;
+import static org.eclipse.jpt.core.internal.mappings.CascadeType.PERSIST_VALUE;
+import static org.eclipse.jpt.core.internal.mappings.CascadeType.REFRESH_VALUE;
+import static org.eclipse.jpt.core.internal.mappings.CascadeType.REMOVE_VALUE;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import org.eclipse.emf.common.util.Enumerator;
+import org.eclipse.jpt.core.internal.content.java.mappings.JPA;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the literals of the enumeration '<em><b>Cascade Type</b></em>',
+ * and utility methods for working with them.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getCascadeType()
+ * @model
+ * @generated
+ */
+public enum CascadeType implements Enumerator {
+ /**
+ * The '<em><b>ALL</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #ALL_VALUE
+ * @generated
+ * @ordered
+ */
+ ALL(0, "ALL", "All"),
+ /**
+ * The '<em><b>PERSIST</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #PERSIST_VALUE
+ * @generated
+ * @ordered
+ */
+ PERSIST(1, "PERSIST", "Persist"),
+ /**
+ * The '<em><b>MERGE</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #MERGE_VALUE
+ * @generated
+ * @ordered
+ */
+ MERGE(2, "MERGE", "Merge"),
+ /**
+ * The '<em><b>REMOVE</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #REMOVE_VALUE
+ * @generated
+ * @ordered
+ */
+ REMOVE(3, "REMOVE", "Remove"),
+ /**
+ * The '<em><b>REFRESH</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #REFRESH_VALUE
+ * @generated
+ * @ordered
+ */
+ REFRESH(4, "REFRESH", "Refresh");
+ /**
+ * The '<em><b>ALL</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>ALL</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #ALL
+ * @model literal="All"
+ * @generated
+ * @ordered
+ */
+ public static final int ALL_VALUE = 0;
+
+ /**
+ * The '<em><b>PERSIST</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>PERSIST</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #PERSIST
+ * @model literal="Persist"
+ * @generated
+ * @ordered
+ */
+ public static final int PERSIST_VALUE = 1;
+
+ /**
+ * The '<em><b>MERGE</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>MERGE</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #MERGE
+ * @model literal="Merge"
+ * @generated
+ * @ordered
+ */
+ public static final int MERGE_VALUE = 2;
+
+ /**
+ * The '<em><b>REMOVE</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>REMOVE</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #REMOVE
+ * @model literal="Remove"
+ * @generated
+ * @ordered
+ */
+ public static final int REMOVE_VALUE = 3;
+
+ /**
+ * The '<em><b>REFRESH</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>REFRESH</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #REFRESH
+ * @model literal="Refresh"
+ * @generated
+ * @ordered
+ */
+ public static final int REFRESH_VALUE = 4;
+
+ /**
+ * An array of all the '<em><b>Cascade Type</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final CascadeType[] VALUES_ARRAY = new CascadeType[] {
+ ALL, PERSIST, MERGE, REMOVE, REFRESH,
+ };
+
+ /**
+ * A public read-only list of all the '<em><b>Cascade Type</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List<CascadeType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
+
+ /**
+ * Returns the '<em><b>Cascade Type</b></em>' literal with the specified literal value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static CascadeType get(String literal) {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+ CascadeType result = VALUES_ARRAY[i];
+ if (result.toString().equals(literal)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Cascade Type</b></em>' literal with the specified name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static CascadeType getByName(String name) {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+ CascadeType result = VALUES_ARRAY[i];
+ if (result.getName().equals(name)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Cascade Type</b></em>' literal with the specified integer value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static CascadeType get(int value) {
+ switch (value) {
+ case ALL_VALUE :
+ return ALL;
+ case PERSIST_VALUE :
+ return PERSIST;
+ case MERGE_VALUE :
+ return MERGE;
+ case REMOVE_VALUE :
+ return REMOVE;
+ case REFRESH_VALUE :
+ return REFRESH;
+ }
+ return null;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final int value;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String name;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private final String literal;
+
+ /**
+ * Only this class can construct instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private CascadeType(int value, String name, String literal) {
+ this.value = value;
+ this.name = name;
+ this.literal = literal;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getLiteral() {
+ return literal;
+ }
+
+ /**
+ * Returns the literal value of the enumerator, which is its string representation.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public String toString() {
+ return literal;
+ }
+
+ public static CascadeType[] fromJavaAnnotationValue(String[] javaAnnotationValues) {
+ if (javaAnnotationValues == null) {
+ return new CascadeType[0];
+ }
+ CascadeType[] cascadeTypes = new CascadeType[javaAnnotationValues.length];
+ for (int i = 0; i < javaAnnotationValues.length; i++) {
+ String javaAnnotationValue = javaAnnotationValues[i];
+ if (javaAnnotationValue != null) {
+ if (javaAnnotationValue.equals(JPA.CASCADE_TYPE__ALL)) {
+ cascadeTypes[i] = ALL;
+ }
+ else if (javaAnnotationValue.equals(JPA.CASCADE_TYPE__PERSIST)) {
+ cascadeTypes[i] = PERSIST;
+ }
+ else if (javaAnnotationValue.equals(JPA.CASCADE_TYPE__MERGE)) {
+ cascadeTypes[i] = MERGE;
+ }
+ else if (javaAnnotationValue.equals(JPA.CASCADE_TYPE__REMOVE)) {
+ cascadeTypes[i] = REMOVE;
+ }
+ else if (javaAnnotationValue.equals(JPA.CASCADE_TYPE__REFRESH)) {
+ cascadeTypes[i] = REFRESH;
+ }
+ }
+ }
+ return cascadeTypes;
+ }
+
+ public static String[] toJavaAnnotationValue(CascadeType[] cascadeTypes) {
+ String[] javaAnnotationValues = new String[cascadeTypes.length];
+ for (int i = 0; i < cascadeTypes.length; i++) {
+ CascadeType cascadeType = cascadeTypes[i];
+ if (cascadeType == ALL) {
+ javaAnnotationValues[i] = JPA.CASCADE_TYPE__ALL;
+ }
+ else if (cascadeType == PERSIST) {
+ javaAnnotationValues[i] = JPA.CASCADE_TYPE__PERSIST;
+ }
+ else if (cascadeType == MERGE) {
+ javaAnnotationValues[i] = JPA.CASCADE_TYPE__MERGE;
+ }
+ else if (cascadeType == REMOVE) {
+ javaAnnotationValues[i] = JPA.CASCADE_TYPE__REMOVE;
+ }
+ else if (cascadeType == REFRESH) {
+ javaAnnotationValues[i] = JPA.CASCADE_TYPE__REFRESH;
+ }
+ }
+ return javaAnnotationValues;
+ }
+} //CascadeType
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ICascade.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ICascade.java
new file mode 100644
index 0000000000..a4437823dc
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ICascade.java
@@ -0,0 +1,162 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
+package org.eclipse.jpt.core.internal.mappings;
+
+import org.eclipse.jpt.core.internal.IJpaSourceObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>ICascade</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jpt.core.internal.mappings.ICascade#isAll <em>All</em>}</li>
+ * <li>{@link org.eclipse.jpt.core.internal.mappings.ICascade#isPersist <em>Persist</em>}</li>
+ * <li>{@link org.eclipse.jpt.core.internal.mappings.ICascade#isMerge <em>Merge</em>}</li>
+ * <li>{@link org.eclipse.jpt.core.internal.mappings.ICascade#isRemove <em>Remove</em>}</li>
+ * <li>{@link org.eclipse.jpt.core.internal.mappings.ICascade#isRefresh <em>Refresh</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade()
+ * @model kind="class" interface="true" abstract="true"
+ * @generated
+ */
+public interface ICascade extends IJpaSourceObject
+{
+ /**
+ * Returns the value of the '<em><b>All</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>All</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>All</em>' attribute.
+ * @see #setAll(boolean)
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade_All()
+ * @model
+ * @generated
+ */
+ boolean isAll();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isAll <em>All</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>All</em>' attribute.
+ * @see #isAll()
+ * @generated
+ */
+ void setAll(boolean value);
+
+ /**
+ * Returns the value of the '<em><b>Persist</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Persist</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Persist</em>' attribute.
+ * @see #setPersist(boolean)
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade_Persist()
+ * @model
+ * @generated
+ */
+ boolean isPersist();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isPersist <em>Persist</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Persist</em>' attribute.
+ * @see #isPersist()
+ * @generated
+ */
+ void setPersist(boolean value);
+
+ /**
+ * Returns the value of the '<em><b>Merge</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Merge</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Merge</em>' attribute.
+ * @see #setMerge(boolean)
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade_Merge()
+ * @model
+ * @generated
+ */
+ boolean isMerge();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isMerge <em>Merge</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Merge</em>' attribute.
+ * @see #isMerge()
+ * @generated
+ */
+ void setMerge(boolean value);
+
+ /**
+ * Returns the value of the '<em><b>Remove</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Remove</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Remove</em>' attribute.
+ * @see #setRemove(boolean)
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade_Remove()
+ * @model
+ * @generated
+ */
+ boolean isRemove();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isRemove <em>Remove</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Remove</em>' attribute.
+ * @see #isRemove()
+ * @generated
+ */
+ void setRemove(boolean value);
+
+ /**
+ * Returns the value of the '<em><b>Refresh</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Refresh</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Refresh</em>' attribute.
+ * @see #setRefresh(boolean)
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade_Refresh()
+ * @model
+ * @generated
+ */
+ boolean isRefresh();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isRefresh <em>Refresh</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Refresh</em>' attribute.
+ * @see #isRefresh()
+ * @generated
+ */
+ void setRefresh(boolean value);
+} // ICascade
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 62e8531cd2..dcfa7dda6c 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
@@ -73,7 +73,7 @@ public interface IMultiRelationshipMapping extends INonOwningMapping
* @generated
*/
IJoinTable getJoinTable();
-
+
/**
* All multi-relationship mappings have a join table, even if it has to be
* calculated from default settings. However, it is important to note
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INonOwningMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INonOwningMapping.java
index 11df39b4fc..3f15be3430 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INonOwningMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/INonOwningMapping.java
@@ -56,7 +56,7 @@ public interface INonOwningMapping extends IRelationshipMapping
* @generated
*/
void setMappedBy(String value);
-
+
Iterator<String> candidateMappedByAttributeNames();
boolean mappedByIsValid(IAttributeMapping mappedByMapping);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IRelationshipMapping.java
index 65244a504b..3b757972f7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IRelationshipMapping.java
@@ -23,6 +23,7 @@ import org.eclipse.jpt.core.internal.IAttributeMapping;
* <li>{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getSpecifiedTargetEntity <em>Specified Target Entity</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getDefaultTargetEntity <em>Default Target Entity</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getResolvedTargetEntity <em>Resolved Target Entity</em>}</li>
+ * <li>{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getCascade <em>Cascade</em>}</li>
* </ul>
* </p>
*
@@ -115,6 +116,32 @@ public interface IRelationshipMapping extends IAttributeMapping
void setResolvedTargetEntity(IEntity value);
/**
+ * Returns the value of the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Cascade</em>' containment reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Cascade</em>' containment reference.
+ * @see #setCascade(ICascade)
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIRelationshipMapping_Cascade()
+ * @model containment="true"
+ * @generated
+ */
+ ICascade getCascade();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getCascade <em>Cascade</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Cascade</em>' containment reference.
+ * @see #getCascade()
+ * @generated
+ */
+ void setCascade(ICascade value);
+
+ /**
* Return whether the specified 'targetEntity' is valid.
*/
boolean targetEntityIsValid(String targetEntity);
@@ -131,4 +158,6 @@ public interface IRelationshipMapping extends IAttributeMapping
* @return
*/
IEntity getEntity();
+
+ ICascade createCascade();
} \ No newline at end of file
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 021dd7f0b6..f8bf52bf92 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
@@ -103,6 +103,8 @@ public class JpaCoreMappingsFactory extends EFactoryImpl
return createEnumTypeFromString(eDataType, initialValue);
case JpaCoreMappingsPackage.ORDERING_TYPE :
return createOrderingTypeFromString(eDataType, initialValue);
+ case JpaCoreMappingsPackage.CASCADE_TYPE :
+ return createCascadeTypeFromString(eDataType, initialValue);
default :
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
@@ -136,6 +138,8 @@ public class JpaCoreMappingsFactory extends EFactoryImpl
return convertEnumTypeToString(eDataType, instanceValue);
case JpaCoreMappingsPackage.ORDERING_TYPE :
return convertOrderingTypeToString(eDataType, instanceValue);
+ case JpaCoreMappingsPackage.CASCADE_TYPE :
+ return convertCascadeTypeToString(eDataType, instanceValue);
default :
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
@@ -356,6 +360,27 @@ public class JpaCoreMappingsFactory extends EFactoryImpl
* <!-- end-user-doc -->
* @generated
*/
+ public CascadeType createCascadeTypeFromString(EDataType eDataType, String initialValue) {
+ CascadeType result = CascadeType.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 convertCascadeTypeToString(EDataType eDataType, Object instanceValue) {
+ return instanceValue == null ? null : instanceValue.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public JpaCoreMappingsPackage getJpaCoreMappingsPackage() {
return (JpaCoreMappingsPackage) getEPackage();
}
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 d81a5ab7ef..bd7b202270 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
@@ -1178,13 +1178,22 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int IRELATIONSHIP_MAPPING__CASCADE = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
+
+ /**
* The number of structural features of the '<em>IRelationship Mapping</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int IRELATIONSHIP_MAPPING_FEATURE_COUNT = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
+ public static final int IRELATIONSHIP_MAPPING_FEATURE_COUNT = JpaCorePackage.IATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping <em>INon Owning Mapping</em>}' class.
@@ -1233,6 +1242,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int INON_OWNING_MAPPING__RESOLVED_TARGET_ENTITY = IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int INON_OWNING_MAPPING__CASCADE = IRELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Mapped By</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1297,6 +1315,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int IMULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = INON_OWNING_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int IMULTI_RELATIONSHIP_MAPPING__CASCADE = INON_OWNING_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Mapped By</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1397,6 +1424,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int IONE_TO_MANY__RESOLVED_TARGET_ENTITY = IMULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int IONE_TO_MANY__CASCADE = IMULTI_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Mapped By</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1497,6 +1533,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int IMANY_TO_MANY__RESOLVED_TARGET_ENTITY = IMULTI_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int IMANY_TO_MANY__CASCADE = IMULTI_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Mapped By</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1597,6 +1642,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int ISINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ISINGLE_RELATIONSHIP_MAPPING__CASCADE = IRELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Fetch</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1697,6 +1751,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int IMANY_TO_ONE__RESOLVED_TARGET_ENTITY = ISINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int IMANY_TO_ONE__CASCADE = ISINGLE_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Fetch</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1797,6 +1860,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int IONE_TO_ONE__RESOLVED_TARGET_ENTITY = ISINGLE_RELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY;
/**
+ * The feature id for the '<em><b>Cascade</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int IONE_TO_ONE__CASCADE = ISINGLE_RELATIONSHIP_MAPPING__CASCADE;
+
+ /**
* The feature id for the '<em><b>Fetch</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -3390,6 +3462,70 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int IQUERY_HINT_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.ICascade <em>ICascade</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.mappings.ICascade
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade()
+ * @generated
+ */
+ public static final int ICASCADE = 41;
+
+ /**
+ * The feature id for the '<em><b>All</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ICASCADE__ALL = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The feature id for the '<em><b>Persist</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ICASCADE__PERSIST = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1;
+
+ /**
+ * The feature id for the '<em><b>Merge</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ICASCADE__MERGE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 2;
+
+ /**
+ * The feature id for the '<em><b>Remove</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ICASCADE__REMOVE = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 3;
+
+ /**
+ * The feature id for the '<em><b>Refresh</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ICASCADE__REFRESH = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 4;
+
+ /**
+ * The number of structural features of the '<em>ICascade</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ICASCADE_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 5;
+
+ /**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType <em>Default Eager Fetch Type</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -3397,7 +3533,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultEagerFetchType()
* @generated
*/
- public static final int DEFAULT_EAGER_FETCH_TYPE = 41;
+ public static final int DEFAULT_EAGER_FETCH_TYPE = 42;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType <em>Default Lazy Fetch Type</em>}' enum.
@@ -3407,7 +3543,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultLazyFetchType()
* @generated
*/
- public static final int DEFAULT_LAZY_FETCH_TYPE = 42;
+ public static final int DEFAULT_LAZY_FETCH_TYPE = 43;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean <em>Default False Boolean</em>}' enum.
@@ -3417,7 +3553,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultFalseBoolean()
* @generated
*/
- public static final int DEFAULT_FALSE_BOOLEAN = 43;
+ public static final int DEFAULT_FALSE_BOOLEAN = 44;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean <em>Default True Boolean</em>}' enum.
@@ -3427,7 +3563,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultTrueBoolean()
* @generated
*/
- public static final int DEFAULT_TRUE_BOOLEAN = 44;
+ public static final int DEFAULT_TRUE_BOOLEAN = 45;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.TemporalType <em>Temporal Type</em>}' enum.
@@ -3437,7 +3573,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getTemporalType()
* @generated
*/
- public static final int TEMPORAL_TYPE = 45;
+ public static final int TEMPORAL_TYPE = 46;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.InheritanceType <em>Inheritance Type</em>}' enum.
@@ -3447,7 +3583,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getInheritanceType()
* @generated
*/
- public static final int INHERITANCE_TYPE = 46;
+ public static final int INHERITANCE_TYPE = 47;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DiscriminatorType <em>Discriminator Type</em>}' enum.
@@ -3457,7 +3593,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDiscriminatorType()
* @generated
*/
- public static final int DISCRIMINATOR_TYPE = 47;
+ public static final int DISCRIMINATOR_TYPE = 48;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.GenerationType <em>Generation Type</em>}' enum.
@@ -3467,7 +3603,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getGenerationType()
* @generated
*/
- public static final int GENERATION_TYPE = 48;
+ public static final int GENERATION_TYPE = 49;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.EnumType <em>Enum Type</em>}' enum.
@@ -3477,7 +3613,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getEnumType()
* @generated
*/
- public static final int ENUM_TYPE = 49;
+ 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.
@@ -3487,7 +3623,17 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getOrderingType()
* @generated
*/
- public static final int ORDERING_TYPE = 50;
+ public static final int ORDERING_TYPE = 51;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.CascadeType <em>Cascade Type</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.mappings.CascadeType
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getCascadeType()
+ * @generated
+ */
+ public static final int CASCADE_TYPE = 52;
/**
* <!-- begin-user-doc -->
@@ -3781,6 +3927,13 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* <!-- end-user-doc -->
* @generated
*/
+ private EClass iCascadeEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EEnum defaultEagerFetchTypeEEnum = null;
/**
@@ -3847,6 +4000,13 @@ public class JpaCoreMappingsPackage extends EPackageImpl
private EEnum orderingTypeEEnum = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EEnum cascadeTypeEEnum = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -5018,6 +5178,19 @@ public class JpaCoreMappingsPackage extends EPackageImpl
}
/**
+ * Returns the meta object for the containment reference '{@link org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getCascade <em>Cascade</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference '<em>Cascade</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.IRelationshipMapping#getCascade()
+ * @see #getIRelationshipMapping()
+ * @generated
+ */
+ public EReference getIRelationshipMapping_Cascade() {
+ return (EReference) iRelationshipMappingEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
* Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping <em>INon Owning Mapping</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6241,6 +6414,83 @@ public class JpaCoreMappingsPackage extends EPackageImpl
}
/**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.ICascade <em>ICascade</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>ICascade</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.ICascade
+ * @generated
+ */
+ public EClass getICascade() {
+ return iCascadeEClass;
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isAll <em>All</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>All</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.ICascade#isAll()
+ * @see #getICascade()
+ * @generated
+ */
+ public EAttribute getICascade_All() {
+ return (EAttribute) iCascadeEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isPersist <em>Persist</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Persist</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.ICascade#isPersist()
+ * @see #getICascade()
+ * @generated
+ */
+ public EAttribute getICascade_Persist() {
+ return (EAttribute) iCascadeEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isMerge <em>Merge</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Merge</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.ICascade#isMerge()
+ * @see #getICascade()
+ * @generated
+ */
+ public EAttribute getICascade_Merge() {
+ return (EAttribute) iCascadeEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isRemove <em>Remove</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Remove</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.ICascade#isRemove()
+ * @see #getICascade()
+ * @generated
+ */
+ public EAttribute getICascade_Remove() {
+ return (EAttribute) iCascadeEClass.getEStructuralFeatures().get(3);
+ }
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.jpt.core.internal.mappings.ICascade#isRefresh <em>Refresh</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Refresh</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.ICascade#isRefresh()
+ * @see #getICascade()
+ * @generated
+ */
+ public EAttribute getICascade_Refresh() {
+ return (EAttribute) iCascadeEClass.getEStructuralFeatures().get(4);
+ }
+
+ /**
* Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType <em>Default Eager Fetch Type</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6361,6 +6611,18 @@ public class JpaCoreMappingsPackage extends EPackageImpl
}
/**
+ * Returns the meta object for enum '{@link org.eclipse.jpt.core.internal.mappings.CascadeType <em>Cascade Type</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for enum '<em>Cascade Type</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.CascadeType
+ * @generated
+ */
+ public EEnum getCascadeType() {
+ return cascadeTypeEEnum;
+ }
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6475,6 +6737,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
createEAttribute(iRelationshipMappingEClass, IRELATIONSHIP_MAPPING__SPECIFIED_TARGET_ENTITY);
createEAttribute(iRelationshipMappingEClass, IRELATIONSHIP_MAPPING__DEFAULT_TARGET_ENTITY);
createEReference(iRelationshipMappingEClass, IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY);
+ createEReference(iRelationshipMappingEClass, IRELATIONSHIP_MAPPING__CASCADE);
iNonOwningMappingEClass = createEClass(INON_OWNING_MAPPING);
createEAttribute(iNonOwningMappingEClass, INON_OWNING_MAPPING__MAPPED_BY);
iMultiRelationshipMappingEClass = createEClass(IMULTI_RELATIONSHIP_MAPPING);
@@ -6571,6 +6834,12 @@ public class JpaCoreMappingsPackage extends EPackageImpl
iQueryHintEClass = createEClass(IQUERY_HINT);
createEAttribute(iQueryHintEClass, IQUERY_HINT__NAME);
createEAttribute(iQueryHintEClass, IQUERY_HINT__VALUE);
+ iCascadeEClass = createEClass(ICASCADE);
+ createEAttribute(iCascadeEClass, ICASCADE__ALL);
+ createEAttribute(iCascadeEClass, ICASCADE__PERSIST);
+ createEAttribute(iCascadeEClass, ICASCADE__MERGE);
+ createEAttribute(iCascadeEClass, ICASCADE__REMOVE);
+ createEAttribute(iCascadeEClass, ICASCADE__REFRESH);
// Create enums
defaultEagerFetchTypeEEnum = createEEnum(DEFAULT_EAGER_FETCH_TYPE);
defaultLazyFetchTypeEEnum = createEEnum(DEFAULT_LAZY_FETCH_TYPE);
@@ -6582,6 +6851,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
generationTypeEEnum = createEEnum(GENERATION_TYPE);
enumTypeEEnum = createEEnum(ENUM_TYPE);
orderingTypeEEnum = createEEnum(ORDERING_TYPE);
+ cascadeTypeEEnum = createEEnum(CASCADE_TYPE);
}
/**
@@ -6660,6 +6930,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
iNamedNativeQueryEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject());
iNamedNativeQueryEClass.getESuperTypes().add(this.getIQuery());
iQueryHintEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject());
+ iCascadeEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject());
// Initialize classes and features; add operations and parameters
initEClass(iMappedSuperclassEClass, IMappedSuperclass.class, "IMappedSuperclass", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getIMappedSuperclass_IdClass(), theEcorePackage.getEString(), "idClass", null, 0, 1, IMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -6752,6 +7023,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
initEAttribute(getIRelationshipMapping_SpecifiedTargetEntity(), ecorePackage.getEString(), "specifiedTargetEntity", null, 0, 1, IRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getIRelationshipMapping_DefaultTargetEntity(), ecorePackage.getEString(), "defaultTargetEntity", null, 0, 1, IRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getIRelationshipMapping_ResolvedTargetEntity(), this.getIEntity(), null, "resolvedTargetEntity", null, 0, 1, IRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getIRelationshipMapping_Cascade(), this.getICascade(), null, "cascade", null, 0, 1, IRelationshipMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
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);
@@ -6849,6 +7121,12 @@ public class JpaCoreMappingsPackage extends EPackageImpl
initEClass(iQueryHintEClass, IQueryHint.class, "IQueryHint", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getIQueryHint_Name(), theEcorePackage.getEString(), "name", null, 0, 1, IQueryHint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getIQueryHint_Value(), theEcorePackage.getEString(), "value", null, 0, 1, IQueryHint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(iCascadeEClass, ICascade.class, "ICascade", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getICascade_All(), theEcorePackage.getEBoolean(), "all", null, 0, 1, ICascade.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getICascade_Persist(), theEcorePackage.getEBoolean(), "persist", null, 0, 1, ICascade.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getICascade_Merge(), theEcorePackage.getEBoolean(), "merge", null, 0, 1, ICascade.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getICascade_Remove(), theEcorePackage.getEBoolean(), "remove", null, 0, 1, ICascade.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getICascade_Refresh(), theEcorePackage.getEBoolean(), "refresh", null, 0, 1, ICascade.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
// Initialize enums and add enum literals
initEEnum(defaultEagerFetchTypeEEnum, DefaultEagerFetchType.class, "DefaultEagerFetchType");
addEEnumLiteral(defaultEagerFetchTypeEEnum, DefaultEagerFetchType.DEFAULT);
@@ -6895,6 +7173,12 @@ public class JpaCoreMappingsPackage extends EPackageImpl
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);
+ addEEnumLiteral(cascadeTypeEEnum, CascadeType.MERGE);
+ addEEnumLiteral(cascadeTypeEEnum, CascadeType.REMOVE);
+ addEEnumLiteral(cascadeTypeEEnum, CascadeType.REFRESH);
}
@@ -7625,6 +7909,14 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final EReference IRELATIONSHIP_MAPPING__RESOLVED_TARGET_ENTITY = eINSTANCE.getIRelationshipMapping_ResolvedTargetEntity();
/**
+ * The meta object literal for the '<em><b>Cascade</b></em>' containment reference feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EReference IRELATIONSHIP_MAPPING__CASCADE = eINSTANCE.getIRelationshipMapping_Cascade();
+
+ /**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.INonOwningMapping <em>INon Owning Mapping</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -8443,6 +8735,56 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final EAttribute IQUERY_HINT__VALUE = eINSTANCE.getIQueryHint_Value();
/**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.ICascade <em>ICascade</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.mappings.ICascade
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getICascade()
+ * @generated
+ */
+ public static final EClass ICASCADE = eINSTANCE.getICascade();
+
+ /**
+ * The meta object literal for the '<em><b>All</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute ICASCADE__ALL = eINSTANCE.getICascade_All();
+
+ /**
+ * The meta object literal for the '<em><b>Persist</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute ICASCADE__PERSIST = eINSTANCE.getICascade_Persist();
+
+ /**
+ * The meta object literal for the '<em><b>Merge</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute ICASCADE__MERGE = eINSTANCE.getICascade_Merge();
+
+ /**
+ * The meta object literal for the '<em><b>Remove</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute ICASCADE__REMOVE = eINSTANCE.getICascade_Remove();
+
+ /**
+ * The meta object literal for the '<em><b>Refresh</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute ICASCADE__REFRESH = eINSTANCE.getICascade_Refresh();
+
+ /**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultEagerFetchType <em>Default Eager Fetch Type</em>}' enum.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -8541,5 +8883,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @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 -->
+ * @see org.eclipse.jpt.core.internal.mappings.CascadeType
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getCascadeType()
+ * @generated
+ */
+ public static final EEnum CASCADE_TYPE = eINSTANCE.getCascadeType();
}
} //JpaCoreMappingsPackage
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 f70799fa64..fa2fc4e816 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
@@ -22,6 +22,7 @@ import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
import org.eclipse.jpt.core.internal.mappings.IAssociationOverride;
import org.eclipse.jpt.core.internal.mappings.IAttributeOverride;
import org.eclipse.jpt.core.internal.mappings.IBasic;
+import org.eclipse.jpt.core.internal.mappings.ICascade;
import org.eclipse.jpt.core.internal.mappings.IColumn;
import org.eclipse.jpt.core.internal.mappings.IColumnMapping;
import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn;
@@ -322,6 +323,11 @@ public class JpaCoreMappingsAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseICascade(ICascade object) {
+ return createICascadeAdapter();
+ }
+
+ @Override
public Adapter caseIJpaEObject(IJpaEObject object) {
return createIJpaEObjectAdapter();
}
@@ -935,6 +941,20 @@ public class JpaCoreMappingsAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.ICascade <em>ICascade</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.ICascade
+ * @generated
+ */
+ public Adapter createICascadeAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.IJpaEObject <em>IJpa EObject</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 c40346d716..99bc98d55a 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
@@ -21,6 +21,7 @@ import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
import org.eclipse.jpt.core.internal.mappings.IAssociationOverride;
import org.eclipse.jpt.core.internal.mappings.IAttributeOverride;
import org.eclipse.jpt.core.internal.mappings.IBasic;
+import org.eclipse.jpt.core.internal.mappings.ICascade;
import org.eclipse.jpt.core.internal.mappings.IColumn;
import org.eclipse.jpt.core.internal.mappings.IColumnMapping;
import org.eclipse.jpt.core.internal.mappings.IDiscriminatorColumn;
@@ -686,6 +687,17 @@ public class JpaCoreMappingsSwitch<T>
result = defaultCase(theEObject);
return result;
}
+ case JpaCoreMappingsPackage.ICASCADE : {
+ ICascade iCascade = (ICascade) theEObject;
+ T result = caseICascade(iCascade);
+ if (result == null)
+ result = caseIJpaSourceObject(iCascade);
+ if (result == null)
+ result = caseIJpaEObject(iCascade);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
default :
return defaultCase(theEObject);
}
@@ -1307,6 +1319,21 @@ public class JpaCoreMappingsSwitch<T>
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>ICascade</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>ICascade</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseICascade(ICascade object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpretting the object as an instance of '<em>IJpa EObject</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java
new file mode 100644
index 0000000000..a2eb0eb160
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/CascadeComposite.java
@@ -0,0 +1,378 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0, which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.ui.internal.mappings.details;
+
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jpt.core.internal.mappings.ICascade;
+import org.eclipse.jpt.core.internal.mappings.IRelationshipMapping;
+import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
+import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
+
+public class CascadeComposite extends BaseJpaComposite
+{
+ private IRelationshipMapping relationshipMapping;
+ private ICascade cascade;
+
+ private Adapter relationshipMappingListener;
+ private Adapter cascadeListener;
+
+
+ private Button allCheckBox;
+ private Button persistCheckBox;
+ private Button mergeCheckBox;
+ private Button removeCheckBox;
+ private Button refreshCheckBox;
+
+ public CascadeComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
+ super(parent, SWT.NULL, commandStack, widgetFactory);
+ this.relationshipMappingListener = buildRelationshipMappingListener();
+ this.cascadeListener = buildCascadeListener();
+ }
+
+ private Adapter buildRelationshipMappingListener() {
+ return new AdapterImpl() {
+ public void notifyChanged(Notification notification) {
+ relationshipMappingChanged(notification);
+ }
+ };
+ }
+
+ private Adapter buildCascadeListener() {
+ return new AdapterImpl() {
+ public void notifyChanged(Notification notification) {
+ cascadeChanged(notification);
+ }
+ };
+ }
+
+ @Override
+ protected void initializeLayout(Composite composite) {
+ composite.setLayout(new FillLayout());
+
+ Group cascadeGroup = getWidgetFactory().createGroup(composite, "Cascade");
+ GridLayout layout = new GridLayout(5, false);
+ cascadeGroup.setLayout(layout);
+
+ GridData gridData;
+
+ this.allCheckBox = createAllCheckBox(cascadeGroup);
+ gridData = new GridData();
+ this.allCheckBox.setLayoutData(gridData);
+
+ this.persistCheckBox = createPersistCheckBox(cascadeGroup);
+ gridData = new GridData();
+ this.persistCheckBox.setLayoutData(gridData);
+
+ this.mergeCheckBox = createMergeCheckBox(cascadeGroup);
+ gridData = new GridData();
+ this.mergeCheckBox.setLayoutData(gridData);
+
+ this.removeCheckBox = createRemoveCheckBox(cascadeGroup);
+ gridData = new GridData();
+ this.removeCheckBox.setLayoutData(gridData);
+
+ this.refreshCheckBox = createRefreshCheckBox(cascadeGroup);
+ gridData = new GridData();
+ this.refreshCheckBox.setLayoutData(gridData);
+ }
+
+ private Button createAllCheckBox(Composite composite) {
+ Button button = getWidgetFactory().createButton(composite, "All", SWT.CHECK);
+ button.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ CascadeComposite.this.allSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ CascadeComposite.this.allSelected(e);
+ }
+ });
+ return button;
+ }
+
+ protected void allSelected(SelectionEvent e) {
+ boolean setSelection = initializeCascade();
+ if (setSelection) {
+ this.cascade.setAll(this.allCheckBox.getSelection());
+ }
+ }
+
+ private boolean initializeCascade() {
+ if (allCheckBoxesFalse() && this.cascade != null) {
+ disengageCascadeListener();
+ this.relationshipMapping.setCascade(null);
+ return false;
+ }
+ if (this.cascade == null) {
+ this.cascade = this.relationshipMapping.createCascade();
+ this.relationshipMapping.setCascade(this.cascade);
+ engageCascadeListener();
+ }
+ return true;
+ }
+
+ private Button createPersistCheckBox(Composite composite) {
+ Button button = getWidgetFactory().createButton(composite, "Persist", SWT.CHECK);
+ button.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ CascadeComposite.this.persistSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ CascadeComposite.this.persistSelected(e);
+ }
+ });
+ return button;
+ }
+
+ protected void persistSelected(SelectionEvent e) {
+ boolean setSelection = initializeCascade();
+ if (setSelection) {
+ this.cascade.setPersist(this.persistCheckBox.getSelection());
+ }
+ }
+
+ private Button createMergeCheckBox(Composite composite) {
+ Button button = getWidgetFactory().createButton(composite, "Merge", SWT.CHECK);
+ button.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ CascadeComposite.this.mergeSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ CascadeComposite.this.mergeSelected(e);
+ }
+ });
+ return button;
+ }
+
+ protected void mergeSelected(SelectionEvent e) {
+ boolean setSelection = initializeCascade();
+ if (setSelection) {
+ this.cascade.setMerge(this.mergeCheckBox.getSelection());
+ }
+ }
+
+ private Button createRemoveCheckBox(Composite composite) {
+ Button button = getWidgetFactory().createButton(composite, "Remove", SWT.CHECK);
+ button.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ CascadeComposite.this.removeSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ CascadeComposite.this.removeSelected(e);
+ }
+ });
+ return button;
+ }
+
+ protected void removeSelected(SelectionEvent e) {
+ boolean setSelection = initializeCascade();
+ if (setSelection) {
+ this.cascade.setRemove(this.removeCheckBox.getSelection());
+ }
+ }
+
+ private Button createRefreshCheckBox(Composite composite) {
+ Button button = getWidgetFactory().createButton(composite, "Refresh", SWT.CHECK);
+ button.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ CascadeComposite.this.refreshSelected(e);
+ }
+ public void widgetSelected(SelectionEvent e) {
+ CascadeComposite.this.refreshSelected(e);
+ }
+ });
+ return button;
+ }
+
+ protected void refreshSelected(SelectionEvent e) {
+ boolean setSelection = initializeCascade();
+ if (setSelection) {
+ this.cascade.setRefresh(this.refreshCheckBox.getSelection());
+ }
+ }
+
+ private boolean allCheckBoxesFalse() {
+ return !(this.allCheckBox.getSelection()
+ || this.persistCheckBox.getSelection()
+ || this.mergeCheckBox.getSelection()
+ || this.removeCheckBox.getSelection()
+ || this.refreshCheckBox.getSelection());
+
+
+ }
+
+ private void relationshipMappingChanged(Notification notification) {
+ if (notification.getFeatureID(IRelationshipMapping.class) ==
+ JpaCoreMappingsPackage.IRELATIONSHIP_MAPPING__CASCADE) {
+ Display.getDefault().asyncExec(
+ new Runnable() {
+ public void run() {
+ if (getControl().isDisposed()) {
+ return;
+ }
+ if (CascadeComposite.this.cascade != null) {
+ disengageCascadeListener();
+ }
+ CascadeComposite.this.cascade = CascadeComposite.this.relationshipMapping.getCascade();
+ populateCascade();
+
+ if (CascadeComposite.this.cascade != null) {
+ engageCascadeListener();
+ }
+ }
+ });
+ }
+ }
+
+ private void cascadeChanged(final Notification notification) {
+ switch (notification.getFeatureID(ICascade.class)) {
+ case JpaCoreMappingsPackage.ICASCADE__ALL :
+ Display.getDefault().asyncExec(
+ new Runnable() {
+ public void run() {
+ if (getControl().isDisposed()) {
+ return;
+ }
+ CascadeComposite.this.allCheckBox.setSelection(notification.getNewBooleanValue());
+ }
+ });
+ break;
+ case JpaCoreMappingsPackage.ICASCADE__PERSIST :
+ Display.getDefault().asyncExec(
+ new Runnable() {
+ public void run() {
+ if (getControl().isDisposed()) {
+ return;
+ }
+ CascadeComposite.this.persistCheckBox.setSelection(notification.getNewBooleanValue());
+ }
+ });
+ break;
+ case JpaCoreMappingsPackage.ICASCADE__MERGE :
+ Display.getDefault().asyncExec(
+ new Runnable() {
+ public void run() {
+ if (getControl().isDisposed()) {
+ return;
+ }
+ CascadeComposite.this.mergeCheckBox.setSelection(notification.getNewBooleanValue());
+ }
+ });
+ break;
+ case JpaCoreMappingsPackage.ICASCADE__REMOVE :
+ Display.getDefault().asyncExec(
+ new Runnable() {
+ public void run() {
+ if (getControl().isDisposed()) {
+ return;
+ }
+ CascadeComposite.this.removeCheckBox.setSelection(notification.getNewBooleanValue());
+ }
+ });
+ break;
+ case JpaCoreMappingsPackage.ICASCADE__REFRESH :
+ Display.getDefault().asyncExec(
+ new Runnable() {
+ public void run() {
+ if (getControl().isDisposed()) {
+ return;
+ }
+ CascadeComposite.this.refreshCheckBox.setSelection(notification.getNewBooleanValue());
+ }
+ });
+ break;
+ default :
+ break;
+ }
+ if (notification.getFeatureID(ICascade.class) ==
+ JpaCoreMappingsPackage.ICASCADE__ALL) {
+ Display.getDefault().asyncExec(
+ new Runnable() {
+ public void run() {
+ if (getControl().isDisposed()) {
+ return;
+ }
+ CascadeComposite.this.allCheckBox.setSelection(notification.getNewBooleanValue());
+ }
+ });
+ }
+
+ }
+
+
+ public void doPopulate(EObject obj) {
+ this.relationshipMapping = (IRelationshipMapping) obj;
+
+ if (this.relationshipMapping != null) {
+ this.cascade = this.relationshipMapping.getCascade();
+ populateCascade();
+ }
+ }
+
+ private void populateCascade() {
+ if (this.cascade != null) {
+ this.allCheckBox.setSelection(this.cascade.isAll());
+ this.persistCheckBox.setSelection(this.cascade.isPersist());
+ this.mergeCheckBox.setSelection(this.cascade.isMerge());
+ this.removeCheckBox.setSelection(this.cascade.isRemove());
+ this.refreshCheckBox.setSelection(this.cascade.isRefresh());
+ }
+ else {
+ this.allCheckBox.setSelection(false);
+ this.persistCheckBox.setSelection(false);
+ this.mergeCheckBox.setSelection(false);
+ this.removeCheckBox.setSelection(false);
+ this.refreshCheckBox.setSelection(false);
+ }
+ }
+
+ public void doPopulate() {
+ }
+
+ protected void engageListeners() {
+ if (this.relationshipMapping != null) {
+ this.relationshipMapping.eAdapters().add(this.relationshipMappingListener);
+ if (this.cascade != null) {
+ engageCascadeListener();
+ }
+ }
+ }
+
+ protected void engageCascadeListener() {
+ this.cascade.eAdapters().add(this.cascadeListener);
+ }
+
+ protected void disengageCascadeListener() {
+ this.cascade.eAdapters().remove(this.cascadeListener);
+ }
+
+ protected void disengageListeners() {
+ if (this.relationshipMapping != null) {
+ this.relationshipMapping.eAdapters().remove(this.relationshipMappingListener);
+ if (this.cascade != null) {
+ disengageCascadeListener();
+ }
+ }
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java
index a24af8050b..93f860f2f6 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToManyComposite.java
@@ -33,9 +33,12 @@ public class ManyToManyComposite extends BaseJpaComposite
private MappedByCombo mappedByCombo;
+ private CascadeComposite cascadeComposite;
+
+ private OrderByComposite orderByComposite;
+
private JoinTableComposite joinTableComposite;
- private OrderByComposite orderByComposite;
public ManyToManyComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
super(parent, SWT.NULL, commandStack, widgetFactory);
@@ -96,6 +99,14 @@ public class ManyToManyComposite extends BaseJpaComposite
gridData.grabExcessHorizontalSpace = true;
this.mappedByCombo.getControl().setLayoutData(gridData);
+ this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory());
+ gridData = new GridData();
+ gridData.horizontalSpan = 3;
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ this.cascadeComposite.getControl().setLayoutData(gridData);
+
+
this.orderByComposite = new OrderByComposite(composite, this.commandStack, getWidgetFactory());
gridData = new GridData();
gridData.horizontalSpan = 3;
@@ -133,6 +144,7 @@ public class ManyToManyComposite extends BaseJpaComposite
this.targetEntityChooser.populate(this.manyToMany);
this.fetchTypeComboViewer.populate(CommonWidgets.buildMultiRelationshipMappingFetchEnumHolder(this.manyToMany));
this.mappedByCombo.populate(this.manyToMany);
+ this.cascadeComposite.populate(this.manyToMany);
if (this.manyToMany != null) {
this.joinTableComposite.populate(this.manyToMany.getJoinTable());
this.orderByComposite.populate(this.manyToMany.getOrderBy());
@@ -147,6 +159,7 @@ public class ManyToManyComposite extends BaseJpaComposite
this.targetEntityChooser.populate();
this.fetchTypeComboViewer.populate();
this.mappedByCombo.populate();
+ this.cascadeComposite.populate();
this.joinTableComposite.populate();
this.orderByComposite.populate();
}
@@ -162,6 +175,7 @@ public class ManyToManyComposite extends BaseJpaComposite
this.targetEntityChooser.dispose();
this.fetchTypeComboViewer.dispose();
this.mappedByCombo.dispose();
+ this.cascadeComposite.dispose();
this.joinTableComposite.dispose();
this.orderByComposite.dispose();
super.dispose();
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java
index cf883ea06a..b283595f89 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/ManyToOneComposite.java
@@ -37,6 +37,10 @@ public class ManyToOneComposite extends BaseJpaComposite
private EnumComboViewer optionalComboViewer;
+ private OrderByComposite orderByComposite;
+
+ private CascadeComposite cascadeComposite;
+
private JoinColumnComposite joinColumnComposite;
public ManyToOneComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
@@ -93,6 +97,13 @@ public class ManyToOneComposite extends BaseJpaComposite
gridData.grabExcessHorizontalSpace = true;
this.optionalComboViewer.getControl().setLayoutData(gridData);
+ this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory());
+ gridData = new GridData();
+ gridData.horizontalSpan = 3;
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ this.cascadeComposite.getControl().setLayoutData(gridData);
+
this.joinColumnComposite = new JoinColumnComposite(generalComposite, this.commandStack, getWidgetFactory());
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
@@ -110,6 +121,7 @@ public class ManyToOneComposite extends BaseJpaComposite
this.targetEntityChooser.populate(this.manyToOne);
this.fetchTypeComboViewer.populate(CommonWidgets.buildSingleRelationshipMappingFetchEnumHolder(this.manyToOne));
this.optionalComboViewer.populate(new OptionalHolder(this.manyToOne));
+ this.cascadeComposite.populate(this.manyToOne);
this.joinColumnComposite.populate(this.manyToOne);
}
@@ -117,6 +129,7 @@ public class ManyToOneComposite extends BaseJpaComposite
this.targetEntityChooser.populate();
this.fetchTypeComboViewer.populate();
this.optionalComboViewer.populate();
+ this.cascadeComposite.populate();
this.joinColumnComposite.populate();
}
@@ -131,6 +144,7 @@ public class ManyToOneComposite extends BaseJpaComposite
this.targetEntityChooser.dispose();
this.fetchTypeComboViewer.dispose();
this.optionalComboViewer.dispose();
+ this.cascadeComposite.dispose();
this.joinColumnComposite.dispose();
super.dispose();
}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java
index 2211a1c42a..df400bbd5f 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToManyComposite.java
@@ -36,6 +36,8 @@ public class OneToManyComposite extends BaseJpaComposite
private MappedByCombo mappedByCombo;
+ private CascadeComposite cascadeComposite;
+
private OrderByComposite orderByComposite;
private JoinTableComposite joinTableComposite;
@@ -90,7 +92,7 @@ public class OneToManyComposite extends BaseJpaComposite
gridData.verticalAlignment = SWT.BEGINNING;
gridData.grabExcessHorizontalSpace = true;
this.fetchTypeComboViewer.getControl().setLayoutData(gridData);
- helpSystem.setHelp(fetchTypeComboViewer.getControl(), IJpaHelpContextIds.MAPPING_FETCH_TYPE);
+ helpSystem.setHelp(this.fetchTypeComboViewer.getControl(), IJpaHelpContextIds.MAPPING_FETCH_TYPE);
CommonWidgets.buildMappedByLabel(generalComposite, getWidgetFactory());
this.mappedByCombo = new MappedByCombo(generalComposite, this.commandStack, getWidgetFactory());
@@ -99,10 +101,16 @@ public class OneToManyComposite extends BaseJpaComposite
gridData.verticalAlignment = SWT.BEGINNING;
gridData.grabExcessHorizontalSpace = true;
this.mappedByCombo.getControl().setLayoutData(gridData);
- helpSystem.setHelp(mappedByCombo.getControl(), IJpaHelpContextIds.MAPPING_MAPPED_BY);
+ helpSystem.setHelp(this.mappedByCombo.getControl(), IJpaHelpContextIds.MAPPING_MAPPED_BY);
-
- this.orderByComposite = new OrderByComposite(composite, this.commandStack, getWidgetFactory());
+ this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory());
+ gridData = new GridData();
+ gridData.horizontalSpan = 3;
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ this.cascadeComposite.getControl().setLayoutData(gridData);
+
+ this.orderByComposite = new OrderByComposite(generalComposite, this.commandStack, getWidgetFactory());
gridData = new GridData();
gridData.horizontalSpan = 3;
gridData.horizontalAlignment = GridData.FILL;
@@ -140,6 +148,7 @@ public class OneToManyComposite extends BaseJpaComposite
this.fetchTypeComboViewer.populate(CommonWidgets.buildMultiRelationshipMappingFetchEnumHolder(this.oneToMany));
this.targetEntityChooser.populate(this.oneToMany);
this.mappedByCombo.populate(this.oneToMany);
+ this.cascadeComposite.populate(this.oneToMany);
if (this.oneToMany != null) {
this.joinTableComposite.populate(this.oneToMany.getJoinTable());
this.orderByComposite.populate(this.oneToMany.getOrderBy());
@@ -154,6 +163,7 @@ public class OneToManyComposite extends BaseJpaComposite
this.fetchTypeComboViewer.populate();
this.targetEntityChooser.populate();
this.mappedByCombo.populate();
+ this.cascadeComposite.populate();
this.joinTableComposite.populate();
this.orderByComposite.populate();
}
@@ -169,6 +179,7 @@ public class OneToManyComposite extends BaseJpaComposite
this.fetchTypeComboViewer.dispose();
this.targetEntityChooser.dispose();
this.mappedByCombo.dispose();
+ this.cascadeComposite.dispose();
this.joinTableComposite.dispose();
this.orderByComposite.dispose();
super.dispose();
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java
index 90a43ac24f..b9f7550485 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/mappings/details/OneToOneComposite.java
@@ -13,10 +13,8 @@ import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean;
-import org.eclipse.jpt.core.internal.mappings.IBasic;
import org.eclipse.jpt.core.internal.mappings.IOneToOne;
import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
-import org.eclipse.jpt.ui.internal.IJpaHelpContextIds;
import org.eclipse.jpt.ui.internal.details.BaseJpaComposite;
import org.eclipse.jpt.ui.internal.mappings.details.EnumComboViewer.EnumHolder;
import org.eclipse.swt.SWT;
@@ -38,6 +36,8 @@ public class OneToOneComposite extends BaseJpaComposite
private EnumComboViewer optionalComboViewer;
+ private CascadeComposite cascadeComposite;
+
private JoinColumnComposite joinColumnComposite;
public OneToOneComposite(Composite parent, CommandStack commandStack, TabbedPropertySheetWidgetFactory widgetFactory) {
@@ -104,6 +104,13 @@ public class OneToOneComposite extends BaseJpaComposite
gridData.grabExcessHorizontalSpace = true;
this.optionalComboViewer.getControl().setLayoutData(gridData);
+ this.cascadeComposite = new CascadeComposite(generalComposite, this.commandStack, getWidgetFactory());
+ gridData = new GridData();
+ gridData.horizontalSpan = 3;
+ gridData.horizontalAlignment = GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ this.cascadeComposite.getControl().setLayoutData(gridData);
+
this.joinColumnComposite = new JoinColumnComposite(generalComposite, this.commandStack, getWidgetFactory());
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
@@ -122,6 +129,7 @@ public class OneToOneComposite extends BaseJpaComposite
this.fetchTypeComboViewer.populate(CommonWidgets.buildSingleRelationshipMappingFetchEnumHolder(this.oneToOne));
this.mappedByCombo.populate(this.oneToOne);
this.optionalComboViewer.populate(new OptionalHolder(this.oneToOne));
+ this.cascadeComposite.populate(this.oneToOne);
this.joinColumnComposite.populate(this.oneToOne);
}
@@ -130,6 +138,7 @@ public class OneToOneComposite extends BaseJpaComposite
this.fetchTypeComboViewer.populate();
this.mappedByCombo.populate();
this.optionalComboViewer.populate();
+ this.cascadeComposite.populate();
this.joinColumnComposite.populate();
}
@@ -145,6 +154,7 @@ public class OneToOneComposite extends BaseJpaComposite
this.fetchTypeComboViewer.dispose();
this.mappedByCombo.dispose();
this.optionalComboViewer.dispose();
+ this.cascadeComposite.dispose();
this.joinColumnComposite.dispose();
super.dispose();
}

Back to the top