Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2007-05-08 11:33:47 -0400
committerkmoore2007-05-08 11:33:47 -0400
commit1782ba18b19579e6d2601214ddd1e213ded1dfb8 (patch)
tree0e1d665ba389ed01d70a692d9cd24b2e97ffb3f1
parenta87e210b9027210423b2f3a388705faa44154862 (diff)
downloadwebtools.dali-1782ba18b19579e6d2601214ddd1e213ded1dfb8.tar.gz
webtools.dali-1782ba18b19579e6d2601214ddd1e213ded1dfb8.tar.xz
webtools.dali-1782ba18b19579e6d2601214ddd1e213ded1dfb8.zip
model support for UniqueConstraints in Tables (2 remaining issues)
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/core.ecore9
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel7
-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/mappings/AbstractJavaTable.java202
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaJoinTable.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSecondaryTable.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTable.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTableGenerator.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java260
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsFactory.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JpaJavaMappingsPackage.java110
-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/AbstractXmlTable.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmPackage.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlDiscriminatorColumn.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTableGenerator.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlUniqueConstraint.java193
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractTableTranslator.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DiscriminatorColumnTranslator.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/OrmXmlMapper.java1
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/UniqueConstraintTranslator.java55
-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/ITable.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITableGenerator.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IUniqueConstraint.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/JpaCoreMappingsPackage.java261
-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
32 files changed, 1729 insertions, 66 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/core.ecore b/jpa/plugins/org.eclipse.jpt.core/model/core.ecore
index 0b1c222325..3add083978 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/core.ecore
+++ b/jpa/plugins/org.eclipse.jpt.core/model/core.ecore
@@ -197,6 +197,13 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="specifiedSchema" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultSchema" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
changeable="false"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="uniqueConstraints" upperBound="-1"
+ eType="#//mappings/IUniqueConstraint" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="IUniqueConstraint" abstract="true"
+ interface="true" eSuperTypes="#//IJpaSourceObject">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="columnNames" upperBound="-1"
+ eType="ecore:EDataType platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="INamedColumn" abstract="true" interface="true"
eSuperTypes="#//IJpaSourceObject">
@@ -487,6 +494,8 @@
<eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultPkColumnValue"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
changeable="false"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="uniqueConstraints" upperBound="-1"
+ eType="#//mappings/IUniqueConstraint" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ISequenceGenerator" abstract="true"
interface="true" eSuperTypes="#//mappings/IGenerator">
diff --git a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel b/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
index 98e96f02b6..ce8d67756d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
+++ b/jpa/plugins/org.eclipse.jpt.core/model/coreModels.genmodel
@@ -198,6 +198,10 @@
<genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ITable/schema"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ITable/specifiedSchema"/>
<genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ITable/defaultSchema"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference core.ecore#//mappings/ITable/uniqueConstraints"/>
+ </genClasses>
+ <genClasses ecoreClass="core.ecore#//mappings/IUniqueConstraint">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/IUniqueConstraint/columnNames"/>
</genClasses>
<genClasses image="false" ecoreClass="core.ecore#//mappings/INamedColumn">
<genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/INamedColumn/name"/>
@@ -344,6 +348,7 @@
<genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ITableGenerator/pkColumnValue"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ITableGenerator/specifiedPkColumnValue"/>
<genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ITableGenerator/defaultPkColumnValue"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference core.ecore#//mappings/ITableGenerator/uniqueConstraints"/>
</genClasses>
<genClasses image="false" ecoreClass="core.ecore#//mappings/ISequenceGenerator">
<genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute core.ecore#//mappings/ISequenceGenerator/sequenceName"/>
@@ -442,6 +447,7 @@
<genClasses ecoreClass="java.ecore#//mappings/JavaNamedQuery"/>
<genClasses ecoreClass="java.ecore#//mappings/JavaNamedNativeQuery"/>
<genClasses ecoreClass="java.ecore#//mappings/JavaQueryHint"/>
+ <genClasses ecoreClass="java.ecore#//mappings/JavaUniqueConstraint"/>
</nestedGenPackages>
</genPackages>
<genPackages prefix="Orm" basePackage="org.eclipse.jpt.core.internal.content" disposableProviderFactory="true"
@@ -612,6 +618,7 @@
<genClasses ecoreClass="orm.ecore#//XmlNamedQuery"/>
<genClasses ecoreClass="orm.ecore#//XmlNamedNativeQuery"/>
<genClasses ecoreClass="orm.ecore#//XmlQueryHint"/>
+ <genClasses ecoreClass="orm.ecore#//XmlUniqueConstraint"/>
</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 fdfe164b2c..440a88ba4d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/java.ecore
+++ b/jpa/plugins/org.eclipse.jpt.core/model/java.ecore
@@ -83,5 +83,6 @@
<eClassifiers xsi:type="ecore:EClass" name="JavaNamedQuery" eSuperTypes="#//mappings/JavaAbstractQuery core.ecore#//mappings/INamedQuery"/>
<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"/>
</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 7993507183..7f8568d5e9 100644
--- a/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
+++ b/jpa/plugins/org.eclipse.jpt.core/model/orm.ecore
@@ -260,4 +260,5 @@
<eClassifiers xsi:type="ecore:EClass" name="XmlNamedQuery" eSuperTypes="#//AbstractXmlQuery core.ecore#//mappings/INamedQuery"/>
<eClassifiers xsi:type="ecore:EClass" name="XmlNamedNativeQuery" eSuperTypes="#//AbstractXmlQuery core.ecore#//mappings/INamedNativeQuery"/>
<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"/>
</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaTable.java
index 546ded806a..84751eb8d9 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaTable.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/AbstractJavaTable.java
@@ -9,10 +9,17 @@
******************************************************************************/
package org.eclipse.jpt.core.internal.content.java.mappings;
+import java.util.Collection;
import java.util.Iterator;
+import java.util.List;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.internal.ITextRange;
import org.eclipse.jpt.core.internal.content.java.JavaEObject;
@@ -21,8 +28,8 @@ import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdapter;
import org.eclipse.jpt.core.internal.jdtutility.Member;
import org.eclipse.jpt.core.internal.jdtutility.ShortCircuitAnnotationElementAdapter;
-import org.eclipse.jpt.core.internal.mappings.INamedColumn;
import org.eclipse.jpt.core.internal.mappings.ITable;
+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;
@@ -196,6 +203,16 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
*/
protected String defaultSchema = DEFAULT_SCHEMA_EDEFAULT;
+ /**
+ * The cached value of the '{@link #getUniqueConstraints() <em>Unique Constraints</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUniqueConstraints()
+ * @generated
+ * @ordered
+ */
+ protected EList<IUniqueConstraint> uniqueConstraints;
+
private final Owner owner;
private final Member member;
@@ -254,7 +271,7 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
@Override
protected void notifyChanged(Notification notification) {
super.notifyChanged(notification);
- switch (notification.getFeatureID(INamedColumn.class)) {
+ switch (notification.getFeatureID(ITable.class)) {
case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_NAME :
this.nameAdapter.setValue(notification.getNewValue());
break;
@@ -264,6 +281,45 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_CATALOG :
this.catalogAdapter.setValue(notification.getNewValue());
break;
+ case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS :
+ uniqueConstraintsChanged(notification);
+ break;
+ default :
+ break;
+ }
+ }
+
+ void uniqueConstraintsChanged(Notification notification) {
+ switch (notification.getEventType()) {
+ case Notification.ADD :
+ uniqueConstraintAdded(notification.getPosition(), (IUniqueConstraint) notification.getNewValue());
+ break;
+ case Notification.ADD_MANY :
+ uniqueConstraintsAdded(notification.getPosition(), (List<IUniqueConstraint>) notification.getNewValue());
+ break;
+ case Notification.REMOVE :
+ uniqueConstraintRemoved(notification.getPosition(), (IUniqueConstraint) notification.getOldValue());
+ break;
+ case Notification.REMOVE_MANY :
+ if (notification.getPosition() == Notification.NO_INDEX) {
+ uniqueConstraintsCleared((List<IUniqueConstraint>) notification.getOldValue());
+ }
+ else {
+ // Notification.getNewValue() returns an array of the positions of objects that were removed
+ uniqueConstraintsRemoved((int[]) notification.getNewValue(), (List<IUniqueConstraint>) notification.getOldValue());
+ }
+ break;
+ case Notification.SET :
+ if (!notification.isTouch()) {
+ uniqueConstraintSet(notification.getPosition(), (IUniqueConstraint) notification.getOldValue(), (IUniqueConstraint) notification.getNewValue());
+ }
+ break;
+ case Notification.MOVE :
+ // Notification.getOldValue() returns the source index
+ // Notification.getPositon() returns the target index
+ // Notification.getNewValue() returns the moved object
+ uniqueConstraintMoved(notification.getOldIntValue(), notification.getPosition(), (IUniqueConstraint) notification.getNewValue());
+ break;
default :
break;
}
@@ -481,6 +537,41 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
}
/**
+ * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Unique Constraints</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Unique Constraints</em>' containment reference list.
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITable_UniqueConstraints()
+ * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true"
+ * @generated
+ */
+ public EList<IUniqueConstraint> getUniqueConstraints() {
+ if (uniqueConstraints == null) {
+ uniqueConstraints = new EObjectContainmentEList<IUniqueConstraint>(IUniqueConstraint.class, this, JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS);
+ }
+ return uniqueConstraints;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS :
+ return ((InternalEList<?>) getUniqueConstraints()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -506,6 +597,8 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
return getSpecifiedSchema();
case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA :
return getDefaultSchema();
+ case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS :
+ return getUniqueConstraints();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -515,6 +608,7 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
* <!-- end-user-doc -->
* @generated
*/
+ @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
@@ -527,6 +621,10 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA :
setSpecifiedSchema((String) newValue);
return;
+ case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS :
+ getUniqueConstraints().clear();
+ getUniqueConstraints().addAll((Collection<? extends IUniqueConstraint>) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -548,6 +646,9 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA :
setSpecifiedSchema(SPECIFIED_SCHEMA_EDEFAULT);
return;
+ case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS :
+ getUniqueConstraints().clear();
+ return;
}
super.eUnset(featureID);
}
@@ -578,6 +679,8 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
return SPECIFIED_SCHEMA_EDEFAULT == null ? specifiedSchema != null : !SPECIFIED_SCHEMA_EDEFAULT.equals(specifiedSchema);
case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA :
return DEFAULT_SCHEMA_EDEFAULT == null ? defaultSchema != null : !DEFAULT_SCHEMA_EDEFAULT.equals(defaultSchema);
+ case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS :
+ return uniqueConstraints != null && !uniqueConstraints.isEmpty();
}
return super.eIsSet(featureID);
}
@@ -609,6 +712,8 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
return JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA;
case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA :
return JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA;
+ case JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS :
+ return JpaCoreMappingsPackage.ITABLE__UNIQUE_CONSTRAINTS;
default :
return -1;
}
@@ -643,6 +748,8 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__SPECIFIED_SCHEMA;
case JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA :
return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA;
+ case JpaCoreMappingsPackage.ITABLE__UNIQUE_CONSTRAINTS :
+ return JpaJavaMappingsPackage.ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS;
default :
return -1;
}
@@ -737,6 +844,13 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
return this.daa;
}
+ public IUniqueConstraint createUniqueConstraint(int index) {
+ return createJavaUniqueConstraint(index);
+ }
+
+ protected abstract JavaUniqueConstraint createJavaUniqueConstraint(int index);
+
+
//set these defaults here or call setDefaultCatalog from JavaTableContext instead
public void refreshDefaults(DefaultsContext defaultsContext) {
this.setDefaultCatalog((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_CATALOG_KEY));
@@ -845,4 +959,88 @@ public abstract class AbstractJavaTable extends JavaEObject implements ITable
private Iterator<String> quotedCandidateCatalogs(Filter<String> filter) {
return StringTools.quote(this.candidateCatalogs(filter));
}
+
+ // ********** jpa model -> java annotations **********
+ ////////////////////////////////////////////////////////
+ /**
+ * slide over all the annotations that follow the new join column
+ */
+ public void uniqueConstraintAdded(int index, IUniqueConstraint uniqueConstraint) {
+ // JoinColumn was added to jpa model when updating from java, do not need
+ // to edit the java in this case. TODO is there a better way to handle this??
+ if (((JavaUniqueConstraint) uniqueConstraint).annotation(getMember().astRoot()) == null) {
+ this.synchUniqueConstraintAnnotationsAfterAdd(index + 1);
+ ((JavaUniqueConstraint) uniqueConstraint).newAnnotation();
+ }
+ }
+
+ // bjv look at this
+ public void uniqueConstraintsAdded(int index, List<IUniqueConstraint> uniqueConstraints) {
+ // JoinColumn was added to jpa model when updating from java, do not need
+ // to edit the java in this case. TODO is there a better way to handle this??
+ if (!uniqueConstraints.isEmpty() && ((JavaUniqueConstraint) uniqueConstraints.get(0)).annotation(getMember().astRoot()) == null) {
+ this.synchUniqueConstraintAnnotationsAfterAdd(index + uniqueConstraints.size());
+ for (IUniqueConstraint uniqueConstraint : uniqueConstraints) {
+ ((JavaUniqueConstraint) uniqueConstraint).newAnnotation();
+ }
+ }
+ }
+
+ public void uniqueConstraintRemoved(int index, IUniqueConstraint uniqueConstraint) {
+ ((JavaUniqueConstraint) uniqueConstraint).removeAnnotation();
+ this.synchUniqueConstraintAnnotationsAfterRemove(index);
+ }
+
+ public void uniqueConstraintsRemoved(int[] indexes, List<IUniqueConstraint> uniqueConstraints) {
+ for (IUniqueConstraint uniqueConstraint : uniqueConstraints) {
+ ((JavaUniqueConstraint) uniqueConstraint).removeAnnotation();
+ }
+ this.synchUniqueConstraintAnnotationsAfterRemove(indexes[0]);
+ }
+
+ public void uniqueConstraintsCleared(List<IUniqueConstraint> uniqueConstraints) {
+ for (IUniqueConstraint uniqueConstraint : uniqueConstraints) {
+ ((JavaUniqueConstraint) uniqueConstraint).removeAnnotation();
+ }
+ }
+
+ public void uniqueConstraintSet(int index, IUniqueConstraint oldUniqueConstraint, IUniqueConstraint newUniqueConstraint) {
+ ((JavaUniqueConstraint) newUniqueConstraint).newAnnotation();
+ }
+
+ public void uniqueConstraintMoved(int sourceIndex, int targetIndex, IUniqueConstraint uniqueConstraint) {
+ List<IUniqueConstraint> uniqueConstraints = this.getUniqueConstraints();
+ int begin = Math.min(sourceIndex, targetIndex);
+ int end = Math.max(sourceIndex, targetIndex);
+ for (int i = begin; i-- > end;) {
+ this.synch(uniqueConstraints.get(i), i);
+ }
+ }
+
+ /**
+ * synchronize the annotations with the model join columns,
+ * starting at the end of the list to prevent overlap
+ */
+ private void synchUniqueConstraintAnnotationsAfterAdd(int index) {
+ List<IUniqueConstraint> uniqueConstraints = this.getUniqueConstraints();
+ for (int i = uniqueConstraints.size(); i-- > index;) {
+ this.synch(uniqueConstraints.get(i), i);
+ }
+ }
+
+ /**
+ * synchronize the annotations with the model join columns,
+ * starting at the specified index to prevent overlap
+ */
+ private void synchUniqueConstraintAnnotationsAfterRemove(int index) {
+ List<IUniqueConstraint> joinColumns = this.getUniqueConstraints();
+ for (int i = index; i < joinColumns.size(); i++) {
+ this.synch(joinColumns.get(i), i);
+ }
+ }
+
+ private void synch(IUniqueConstraint uniqueConstraint, int index) {
+ ((JavaUniqueConstraint) uniqueConstraint).moveAnnotation(index);
+ }
+
}
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 4e99d26d8c..2b14ba0434 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
@@ -785,4 +785,9 @@ public class JavaJoinTable extends AbstractJavaTable implements IJoinTable
public boolean containsSpecifiedInverseJoinColumns() {
return !this.getSpecifiedInverseJoinColumns().isEmpty();
}
+
+ @Override
+ protected JavaUniqueConstraint createJavaUniqueConstraint(int index) {
+ return JavaUniqueConstraint.createJoinTableUniqueConstraint(getMember(), index);
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSecondaryTable.java
index 9be89b299e..a208d38b9e 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSecondaryTable.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaSecondaryTable.java
@@ -32,6 +32,7 @@ import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter;
import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
import org.eclipse.jpt.core.internal.mappings.IPrimaryKeyJoinColumn;
import org.eclipse.jpt.core.internal.mappings.ISecondaryTable;
+import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint;
import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
/**
@@ -370,7 +371,12 @@ public class JavaSecondaryTable extends AbstractJavaTable
protected IAbstractJoinColumn.Owner buildPkJoinColumnOwner() {
return new ISecondaryTable.PrimaryKeyJoinColumnOwner(this);
}
-
+
+ @Override
+ protected JavaUniqueConstraint createJavaUniqueConstraint(int index) {
+ return JavaUniqueConstraint.createSecondaryTableUniqueConstraint(this, getMember(), index);
+ }
+
// ********** persistence model -> java annotations **********
void moveAnnotation(int newIndex) {
this.annotationAdapter.moveAnnotation(newIndex);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTable.java
index defe1929b2..d5bcce8e7b 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTable.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTable.java
@@ -30,7 +30,7 @@ import org.eclipse.jpt.core.internal.platform.DefaultsContext;
*/
public class JavaTable extends AbstractJavaTable
{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.TABLE);
+ public static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(JPA.TABLE);
private static final DeclarationAnnotationElementAdapter NAME_ADAPTER = new ConversionDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__NAME);
@@ -80,4 +80,9 @@ public class JavaTable extends AbstractJavaTable
super.refreshDefaults(defaultsContext);
this.setDefaultName((String) defaultsContext.getDefault(BaseJpaPlatform.DEFAULT_TABLE_NAME_KEY));
}
+
+ @Override
+ protected JavaUniqueConstraint createJavaUniqueConstraint(int index) {
+ return JavaUniqueConstraint.createTableUniqueConstraint(getMember(), index);
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTableGenerator.java
index 543b2376fb..3b5f56175c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTableGenerator.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaTableGenerator.java
@@ -9,9 +9,15 @@
******************************************************************************/
package org.eclipse.jpt.core.internal.content.java.mappings;
+import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.internal.jdtutility.AnnotationElementAdapter;
import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationAdapter;
@@ -19,6 +25,7 @@ import org.eclipse.jpt.core.internal.jdtutility.DeclarationAnnotationElementAdap
import org.eclipse.jpt.core.internal.jdtutility.Member;
import org.eclipse.jpt.core.internal.jdtutility.SimpleDeclarationAnnotationAdapter;
import org.eclipse.jpt.core.internal.mappings.ITableGenerator;
+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;
@@ -368,6 +375,16 @@ public class JavaTableGenerator extends JavaGenerator
*/
protected String defaultPkColumnValue = DEFAULT_PK_COLUMN_VALUE_EDEFAULT;
+ /**
+ * The cached value of the '{@link #getUniqueConstraints() <em>Unique Constraints</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUniqueConstraints()
+ * @generated
+ * @ordered
+ */
+ protected EList<IUniqueConstraint> uniqueConstraints;
+
protected JavaTableGenerator() {
throw new UnsupportedOperationException("Use JavaTableGenerator(Member) instead");
}
@@ -795,6 +812,41 @@ public class JavaTableGenerator extends JavaGenerator
}
/**
+ * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Unique Constraints</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Unique Constraints</em>' containment reference list.
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getITableGenerator_UniqueConstraints()
+ * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true"
+ * @generated
+ */
+ public EList<IUniqueConstraint> getUniqueConstraints() {
+ if (uniqueConstraints == null) {
+ uniqueConstraints = new EObjectContainmentEList<IUniqueConstraint>(IUniqueConstraint.class, this, JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS);
+ }
+ return uniqueConstraints;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ return ((InternalEList<?>) getUniqueConstraints()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -838,6 +890,8 @@ public class JavaTableGenerator extends JavaGenerator
return getSpecifiedPkColumnValue();
case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE :
return getDefaultPkColumnValue();
+ case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ return getUniqueConstraints();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -847,6 +901,7 @@ public class JavaTableGenerator extends JavaGenerator
* <!-- end-user-doc -->
* @generated
*/
+ @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
@@ -868,6 +923,10 @@ public class JavaTableGenerator extends JavaGenerator
case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE :
setSpecifiedPkColumnValue((String) newValue);
return;
+ case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ getUniqueConstraints().clear();
+ getUniqueConstraints().addAll((Collection<? extends IUniqueConstraint>) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -898,6 +957,9 @@ public class JavaTableGenerator extends JavaGenerator
case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE :
setSpecifiedPkColumnValue(SPECIFIED_PK_COLUMN_VALUE_EDEFAULT);
return;
+ case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ getUniqueConstraints().clear();
+ return;
}
super.eUnset(featureID);
}
@@ -946,6 +1008,8 @@ public class JavaTableGenerator extends JavaGenerator
return SPECIFIED_PK_COLUMN_VALUE_EDEFAULT == null ? specifiedPkColumnValue != null : !SPECIFIED_PK_COLUMN_VALUE_EDEFAULT.equals(specifiedPkColumnValue);
case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE :
return DEFAULT_PK_COLUMN_VALUE_EDEFAULT == null ? defaultPkColumnValue != null : !DEFAULT_PK_COLUMN_VALUE_EDEFAULT.equals(defaultPkColumnValue);
+ case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ return uniqueConstraints != null && !uniqueConstraints.isEmpty();
}
return super.eIsSet(featureID);
}
@@ -995,6 +1059,8 @@ public class JavaTableGenerator extends JavaGenerator
return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE;
case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE :
return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE;
+ case JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ return JpaCoreMappingsPackage.ITABLE_GENERATOR__UNIQUE_CONSTRAINTS;
default :
return -1;
}
@@ -1047,6 +1113,8 @@ public class JavaTableGenerator extends JavaGenerator
return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE;
case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE :
return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE;
+ case JpaCoreMappingsPackage.ITABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ return JpaJavaMappingsPackage.JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS;
default :
return -1;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java
new file mode 100644
index 0000000000..91929ccd6e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/mappings/JavaUniqueConstraint.java
@@ -0,0 +1,260 @@
+/*******************************************************************************
+ * 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.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
+import org.eclipse.jdt.core.dom.Annotation;
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.internal.ITextRange;
+import org.eclipse.jpt.core.internal.content.java.JavaEObject;
+import org.eclipse.jpt.core.internal.jdtutility.IndexedAnnotationAdapter;
+import org.eclipse.jpt.core.internal.jdtutility.IndexedDeclarationAnnotationAdapter;
+import org.eclipse.jpt.core.internal.jdtutility.Member;
+import org.eclipse.jpt.core.internal.jdtutility.MemberIndexedAnnotationAdapter;
+import org.eclipse.jpt.core.internal.jdtutility.NestedIndexedDeclarationAnnotationAdapter;
+import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint;
+import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Java Unique Constraint</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaUniqueConstraint()
+ * @model kind="class"
+ * @generated
+ */
+public class JavaUniqueConstraint extends JavaEObject
+ implements IUniqueConstraint
+{
+ /**
+ * The cached value of the '{@link #getColumnNames() <em>Column Names</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getColumnNames()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> columnNames;
+
+ private final Member member;
+
+ private final IndexedDeclarationAnnotationAdapter idaa;
+
+ private final IndexedAnnotationAdapter annotationAdapter;
+
+ protected JavaUniqueConstraint() {
+ super();
+ throw new UnsupportedOperationException("Use JavaUniqueConstraint(Member) instead");
+ }
+
+ protected JavaUniqueConstraint(Member member, IndexedDeclarationAnnotationAdapter idaa) {
+ super();
+ this.member = member;
+ this.idaa = idaa;
+ this.annotationAdapter = new MemberIndexedAnnotationAdapter(member, idaa);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return JpaJavaMappingsPackage.Literals.JAVA_UNIQUE_CONSTRAINT;
+ }
+
+ /**
+ * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Column Names</em>' attribute list.
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getIUniqueConstraint_ColumnNames()
+ * @model type="java.lang.String"
+ * @generated
+ */
+ public EList<String> getColumnNames() {
+ if (columnNames == null) {
+ columnNames = new EDataTypeUniqueEList<String>(String.class, this, JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES);
+ }
+ return columnNames;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES :
+ return getColumnNames();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES :
+ getColumnNames().clear();
+ getColumnNames().addAll((Collection<? extends String>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES :
+ getColumnNames().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES :
+ return columnNames != null && !columnNames.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
+ if (baseClass == IUniqueConstraint.class) {
+ switch (derivedFeatureID) {
+ case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES :
+ return JpaCoreMappingsPackage.IUNIQUE_CONSTRAINT__COLUMN_NAMES;
+ 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 == IUniqueConstraint.class) {
+ switch (baseFeatureID) {
+ case JpaCoreMappingsPackage.IUNIQUE_CONSTRAINT__COLUMN_NAMES :
+ return JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES;
+ 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(" (columnNames: ");
+ result.append(columnNames);
+ result.append(')');
+ return result.toString();
+ }
+
+ public ITextRange getTextRange() {
+ return this.member.annotationTextRange(this.idaa);
+ }
+
+ /**
+ * allow owners to verify the annotation
+ */
+ public Annotation annotation(CompilationUnit astRoot) {
+ return this.annotationAdapter.getAnnotation(astRoot);
+ }
+
+ // ********** persistence model -> java annotations **********
+ void moveAnnotation(int newIndex) {
+ this.annotationAdapter.moveAnnotation(newIndex);
+ }
+
+ void newAnnotation() {
+ this.annotationAdapter.newMarkerAnnotation();
+ }
+
+ void removeAnnotation() {
+ this.annotationAdapter.removeAnnotation();
+ }
+
+ // ********** static methods **********
+ static JavaUniqueConstraint createSecondaryTableUniqueConstraint(JavaSecondaryTable secondaryTable, Member member, int index) {
+ return JpaJavaMappingsFactory.eINSTANCE.createJavaUniqueConstraint(member, buildSecondaryTableUniqueConstraintAnnotationAdapter(secondaryTable, index));
+ }
+
+ private static IndexedDeclarationAnnotationAdapter buildSecondaryTableUniqueConstraintAnnotationAdapter(JavaSecondaryTable secondaryTable, int index) {
+ return new NestedIndexedDeclarationAnnotationAdapter(secondaryTable.getDeclarationAnnotationAdapter(), JPA.SECONDARY_TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
+ }
+
+ static JavaUniqueConstraint createJoinTableUniqueConstraint(Member member, int index) {
+ return JpaJavaMappingsFactory.eINSTANCE.createJavaUniqueConstraint(member, buildJoinTableUniqueConstraintAnnotationAdapter(index));
+ }
+
+ private static IndexedDeclarationAnnotationAdapter buildJoinTableUniqueConstraintAnnotationAdapter(int index) {
+ return new NestedIndexedDeclarationAnnotationAdapter(JavaJoinTable.DECLARATION_ANNOTATION_ADAPTER, JPA.JOIN_TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
+ }
+
+ static JavaUniqueConstraint createTableUniqueConstraint(Member member, int index) {
+ return JpaJavaMappingsFactory.eINSTANCE.createJavaUniqueConstraint(member, buildTableUniqueConstraintAnnotationAdapter(index));
+ }
+
+ private static IndexedDeclarationAnnotationAdapter buildTableUniqueConstraintAnnotationAdapter(int index) {
+ return new NestedIndexedDeclarationAnnotationAdapter(JavaTable.DECLARATION_ANNOTATION_ADAPTER, JPA.TABLE__UNIQUE_CONSTRAINTS, index, JPA.UNIQUE_CONSTRAINT);
+ }
+} // JavaUniqueConstraint
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 e57f25d8d6..fba00a4e32 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
@@ -144,6 +144,8 @@ public class JpaJavaMappingsFactory extends EFactoryImpl
return createJavaNamedNativeQuery();
case JpaJavaMappingsPackage.JAVA_QUERY_HINT :
return createJavaQueryHint();
+ case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT :
+ return createJavaUniqueConstraint();
default :
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -393,6 +395,15 @@ public class JpaJavaMappingsFactory extends EFactoryImpl
throw new UnsupportedOperationException("Use createJavaQueryHint(Member, IndexedDeclarationAnnotationAdapter) instead");
}
+ public JavaUniqueConstraint createJavaUniqueConstraint() {
+ throw new UnsupportedOperationException("Use createJavaUniqueConstraint(Member, IndexedDeclarationAnnotationAdapter) instead");
+ }
+
+ public JavaUniqueConstraint createJavaUniqueConstraint(Member member, IndexedDeclarationAnnotationAdapter idaa) {
+ JavaUniqueConstraint javaUniqueConstraint = new JavaUniqueConstraint(member, idaa);
+ return javaUniqueConstraint;
+ }
+
public JavaQueryHint createJavaQueryHint(Member member, IndexedDeclarationAnnotationAdapter idaa) {
JavaQueryHint javaQueryHint = new JavaQueryHint(member, idaa);
return javaQueryHint;
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 5e4c90be76..1ef81ecd58 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
@@ -1450,13 +1450,22 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 8;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 9;
+
+ /**
* The number of structural features of the '<em>Abstract Java Table</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int ABSTRACT_JAVA_TABLE_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 9;
+ public static final int ABSTRACT_JAVA_TABLE_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 10;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaTable <em>Java Table</em>}' class.
@@ -1550,6 +1559,15 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_TABLE__DEFAULT_SCHEMA = ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS;
+
+ /**
* The number of structural features of the '<em>Java Table</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1760,6 +1778,15 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_SECONDARY_TABLE__DEFAULT_SCHEMA = ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_SECONDARY_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS;
+
+ /**
* The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1877,6 +1904,15 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_JOIN_TABLE__DEFAULT_SCHEMA = ABSTRACT_JAVA_TABLE__DEFAULT_SCHEMA;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_JOIN_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_JAVA_TABLE__UNIQUE_CONSTRAINTS;
+
+ /**
* The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2960,13 +2996,22 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE = JAVA_GENERATOR_FEATURE_COUNT + 17;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_TABLE_GENERATOR__UNIQUE_CONSTRAINTS = JAVA_GENERATOR_FEATURE_COUNT + 18;
+
+ /**
* The number of structural features of the '<em>Java Table Generator</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int JAVA_TABLE_GENERATOR_FEATURE_COUNT = JAVA_GENERATOR_FEATURE_COUNT + 18;
+ public static final int JAVA_TABLE_GENERATOR_FEATURE_COUNT = JAVA_GENERATOR_FEATURE_COUNT + 19;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -3298,6 +3343,34 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final int JAVA_QUERY_HINT_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 2;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint <em>Java Unique Constraint</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaUniqueConstraint()
+ * @generated
+ */
+ public static final int JAVA_UNIQUE_CONSTRAINT = 42;
+
+ /**
+ * The feature id for the '<em><b>Column Names</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_UNIQUE_CONSTRAINT__COLUMN_NAMES = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Java Unique Constraint</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA_UNIQUE_CONSTRAINT_FEATURE_COUNT = JpaJavaPackage.JAVA_EOBJECT_FEATURE_COUNT + 1;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -3589,6 +3662,13 @@ public class JpaJavaMappingsPackage extends EPackageImpl
* <!-- end-user-doc -->
* @generated
*/
+ private EClass javaUniqueConstraintEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass javaSecondaryTableEClass = null;
/**
@@ -4166,6 +4246,18 @@ public class JpaJavaMappingsPackage extends EPackageImpl
}
/**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint <em>Java Unique Constraint</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Java Unique Constraint</em>'.
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint
+ * @generated
+ */
+ public EClass getJavaUniqueConstraint() {
+ return javaUniqueConstraintEClass;
+ }
+
+ /**
* 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 -->
@@ -4249,6 +4341,7 @@ public class JpaJavaMappingsPackage extends EPackageImpl
javaNamedQueryEClass = createEClass(JAVA_NAMED_QUERY);
javaNamedNativeQueryEClass = createEClass(JAVA_NAMED_NATIVE_QUERY);
javaQueryHintEClass = createEClass(JAVA_QUERY_HINT);
+ javaUniqueConstraintEClass = createEClass(JAVA_UNIQUE_CONSTRAINT);
}
/**
@@ -4360,6 +4453,8 @@ public class JpaJavaMappingsPackage extends EPackageImpl
javaNamedNativeQueryEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getINamedNativeQuery());
javaQueryHintEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject());
javaQueryHintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIQueryHint());
+ javaUniqueConstraintEClass.getESuperTypes().add(theJpaJavaPackage.getJavaEObject());
+ javaUniqueConstraintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIUniqueConstraint());
// 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);
@@ -4403,6 +4498,7 @@ public class JpaJavaMappingsPackage extends EPackageImpl
initEClass(javaNamedQueryEClass, JavaNamedQuery.class, "JavaNamedQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(javaNamedNativeQueryEClass, JavaNamedNativeQuery.class, "JavaNamedNativeQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
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);
}
/**
* <!-- begin-user-doc -->
@@ -4829,6 +4925,16 @@ public class JpaJavaMappingsPackage extends EPackageImpl
public static final EClass JAVA_QUERY_HINT = eINSTANCE.getJavaQueryHint();
/**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint <em>Java Unique Constraint</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint
+ * @see org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage#getJavaUniqueConstraint()
+ * @generated
+ */
+ public static final EClass JAVA_UNIQUE_CONSTRAINT = eINSTANCE.getJavaUniqueConstraint();
+
+ /**
* 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 d287b98161..ac9a8def91 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
@@ -62,6 +62,7 @@ import org.eclipse.jpt.core.internal.content.java.mappings.JavaTable;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping;
+import org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion;
import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage;
import org.eclipse.jpt.core.internal.mappings.IAbstractColumn;
@@ -103,6 +104,7 @@ import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping;
import org.eclipse.jpt.core.internal.mappings.ITable;
import org.eclipse.jpt.core.internal.mappings.ITableGenerator;
import org.eclipse.jpt.core.internal.mappings.ITransient;
+import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint;
import org.eclipse.jpt.core.internal.mappings.IVersion;
/**
@@ -372,6 +374,11 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseJavaUniqueConstraint(JavaUniqueConstraint object) {
+ return createJavaUniqueConstraintAdapter();
+ }
+
+ @Override
public Adapter caseIJpaEObject(IJpaEObject object) {
return createIJpaEObjectAdapter();
}
@@ -612,6 +619,11 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseIUniqueConstraint(IUniqueConstraint object) {
+ return createIUniqueConstraintAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@@ -1163,6 +1175,20 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint <em>Java Unique Constraint</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.JavaUniqueConstraint
+ * @generated
+ */
+ public Adapter createJavaUniqueConstraintAdapter() {
+ 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;
@@ -1821,6 +1847,20 @@ public class JpaJavaMappingsAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint <em>IUnique Constraint</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.IUniqueConstraint
+ * @generated
+ */
+ public Adapter createIUniqueConstraintAdapter() {
+ 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 0fa731f99f..64036c3251 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
@@ -61,6 +61,7 @@ import org.eclipse.jpt.core.internal.content.java.mappings.JavaTable;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaTableGenerator;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaTransient;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaTypeMapping;
+import org.eclipse.jpt.core.internal.content.java.mappings.JavaUniqueConstraint;
import org.eclipse.jpt.core.internal.content.java.mappings.JavaVersion;
import org.eclipse.jpt.core.internal.content.java.mappings.JpaJavaMappingsPackage;
import org.eclipse.jpt.core.internal.mappings.IAbstractColumn;
@@ -102,6 +103,7 @@ import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping;
import org.eclipse.jpt.core.internal.mappings.ITable;
import org.eclipse.jpt.core.internal.mappings.ITableGenerator;
import org.eclipse.jpt.core.internal.mappings.ITransient;
+import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint;
import org.eclipse.jpt.core.internal.mappings.IVersion;
/**
@@ -1120,6 +1122,23 @@ public class JpaJavaMappingsSwitch<T>
result = defaultCase(theEObject);
return result;
}
+ case JpaJavaMappingsPackage.JAVA_UNIQUE_CONSTRAINT : {
+ JavaUniqueConstraint javaUniqueConstraint = (JavaUniqueConstraint) theEObject;
+ T result = caseJavaUniqueConstraint(javaUniqueConstraint);
+ if (result == null)
+ result = caseJavaEObject(javaUniqueConstraint);
+ if (result == null)
+ result = caseIUniqueConstraint(javaUniqueConstraint);
+ if (result == null)
+ result = caseJpaEObject(javaUniqueConstraint);
+ if (result == null)
+ result = caseIJpaSourceObject(javaUniqueConstraint);
+ if (result == null)
+ result = caseIJpaEObject(javaUniqueConstraint);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
default :
return defaultCase(theEObject);
}
@@ -1696,6 +1715,21 @@ public class JpaJavaMappingsSwitch<T>
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>Java Unique Constraint</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 Unique Constraint</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseJavaUniqueConstraint(JavaUniqueConstraint 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;
@@ -2401,6 +2435,21 @@ public class JpaJavaMappingsSwitch<T>
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>IUnique Constraint</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>IUnique Constraint</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseIUniqueConstraint(IUniqueConstraint 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/AbstractXmlTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/AbstractXmlTable.java
index 7d2c7fbc06..9045234288 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
@@ -9,15 +9,22 @@
******************************************************************************/
package org.eclipse.jpt.core.internal.content.orm;
+import java.util.Collection;
import java.util.Set;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jpt.core.internal.ITextRange;
import org.eclipse.jpt.core.internal.XmlEObject;
import org.eclipse.jpt.core.internal.content.orm.resource.OrmXmlMapper;
import org.eclipse.jpt.core.internal.emfutility.DOMUtilities;
import org.eclipse.jpt.core.internal.mappings.ITable;
+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;
@@ -199,6 +206,16 @@ public abstract class AbstractXmlTable extends XmlEObject implements ITable
protected String defaultSchema = DEFAULT_SCHEMA_EDEFAULT;
/**
+ * The cached value of the '{@link #getUniqueConstraints() <em>Unique Constraints</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUniqueConstraints()
+ * @generated
+ * @ordered
+ */
+ protected EList<IUniqueConstraint> uniqueConstraints;
+
+ /**
* The default value of the '{@link #getSpecifiedNameForXml() <em>Specified Name For Xml</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -502,6 +519,27 @@ public abstract class AbstractXmlTable extends XmlEObject implements ITable
}
/**
+ * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Unique Constraints</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Unique Constraints</em>' containment reference list.
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITable_UniqueConstraints()
+ * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true"
+ * @generated
+ */
+ public EList<IUniqueConstraint> getUniqueConstraints() {
+ if (uniqueConstraints == null) {
+ uniqueConstraints = new EObjectContainmentEList<IUniqueConstraint>(IUniqueConstraint.class, this, OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS);
+ }
+ return uniqueConstraints;
+ }
+
+ /**
* Returns the value of the '<em><b>Specified Name For Xml</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
@@ -600,6 +638,20 @@ public abstract class AbstractXmlTable extends XmlEObject implements ITable
eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML, newSpecifiedSchemaForXml + " ", newSpecifiedSchemaForXml));
}
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS :
+ return ((InternalEList<?>) getUniqueConstraints()).basicRemove(otherEnd, 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.
@@ -650,6 +702,8 @@ public abstract class AbstractXmlTable extends XmlEObject implements ITable
return getSpecifiedSchema();
case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_SCHEMA :
return getDefaultSchema();
+ case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS :
+ return getUniqueConstraints();
case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML :
return getSpecifiedNameForXml();
case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML :
@@ -665,6 +719,7 @@ public abstract class AbstractXmlTable extends XmlEObject implements ITable
* <!-- end-user-doc -->
* @generated
*/
+ @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
@@ -677,6 +732,10 @@ public abstract class AbstractXmlTable extends XmlEObject implements ITable
case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA :
setSpecifiedSchema((String) newValue);
return;
+ case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS :
+ getUniqueConstraints().clear();
+ getUniqueConstraints().addAll((Collection<? extends IUniqueConstraint>) newValue);
+ return;
case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML :
setSpecifiedNameForXml((String) newValue);
return;
@@ -707,6 +766,9 @@ public abstract class AbstractXmlTable extends XmlEObject implements ITable
case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA :
setSpecifiedSchema(SPECIFIED_SCHEMA_EDEFAULT);
return;
+ case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS :
+ getUniqueConstraints().clear();
+ return;
case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML :
setSpecifiedNameForXml(SPECIFIED_NAME_FOR_XML_EDEFAULT);
return;
@@ -746,6 +808,8 @@ public abstract class AbstractXmlTable extends XmlEObject implements ITable
return SPECIFIED_SCHEMA_EDEFAULT == null ? specifiedSchema != null : !SPECIFIED_SCHEMA_EDEFAULT.equals(specifiedSchema);
case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_SCHEMA :
return DEFAULT_SCHEMA_EDEFAULT == null ? defaultSchema != null : !DEFAULT_SCHEMA_EDEFAULT.equals(defaultSchema);
+ case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS :
+ return uniqueConstraints != null && !uniqueConstraints.isEmpty();
case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML :
return SPECIFIED_NAME_FOR_XML_EDEFAULT == null ? getSpecifiedNameForXml() != null : !SPECIFIED_NAME_FOR_XML_EDEFAULT.equals(getSpecifiedNameForXml());
case OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML :
@@ -783,6 +847,8 @@ public abstract class AbstractXmlTable extends XmlEObject implements ITable
return JpaCoreMappingsPackage.ITABLE__SPECIFIED_SCHEMA;
case OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_SCHEMA :
return JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA;
+ case OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS :
+ return JpaCoreMappingsPackage.ITABLE__UNIQUE_CONSTRAINTS;
default :
return -1;
}
@@ -817,6 +883,8 @@ public abstract class AbstractXmlTable extends XmlEObject implements ITable
return OrmPackage.ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA;
case JpaCoreMappingsPackage.ITABLE__DEFAULT_SCHEMA :
return OrmPackage.ABSTRACT_XML_TABLE__DEFAULT_SCHEMA;
+ case JpaCoreMappingsPackage.ITABLE__UNIQUE_CONSTRAINTS :
+ return OrmPackage.ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS;
default :
return -1;
}
@@ -911,4 +979,12 @@ public abstract class AbstractXmlTable extends XmlEObject implements ITable
public boolean isResolved() {
return dbTable() != null;
}
+
+ public IUniqueConstraint createUniqueConstraint(int index) {
+ return createXmlJavaUniqueConstraint(index);
+ }
+
+ protected XmlUniqueConstraint createXmlJavaUniqueConstraint(int index) {
+ return OrmFactory.eINSTANCE.createXmlUniqueConstraint();
+ }
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/OrmFactory.java
index c56abbbfc6..626d5aba55 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
@@ -150,6 +150,8 @@ public class OrmFactory extends EFactoryImpl
return createXmlNamedNativeQuery();
case OrmPackage.XML_QUERY_HINT :
return createXmlQueryHint();
+ case OrmPackage.XML_UNIQUE_CONSTRAINT :
+ return createXmlUniqueConstraint();
default :
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -534,7 +536,7 @@ public class OrmFactory extends EFactoryImpl
public XmlDiscriminatorColumn createXmlDiscriminatorColumn() {
throw new UnsupportedOperationException("Use createXmlDiscriminatorColumn(INamedColumn.Owner) instead");
}
-
+
public XmlDiscriminatorColumn createXmlDiscriminatorColumn(INamedColumn.Owner owner) {
XmlDiscriminatorColumn xmlDiscriminatorColumn = new XmlDiscriminatorColumn(owner);
return xmlDiscriminatorColumn;
@@ -618,6 +620,16 @@ public class OrmFactory extends EFactoryImpl
return xmlQueryHint;
}
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public XmlUniqueConstraint createXmlUniqueConstraint() {
+ XmlUniqueConstraint xmlUniqueConstraint = new XmlUniqueConstraint();
+ return xmlUniqueConstraint;
+ }
+
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 70f8d4c847..f304ce09a6 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
@@ -2814,13 +2814,22 @@ public class OrmPackage extends EPackageImpl
public static final int ABSTRACT_XML_TABLE__DEFAULT_SCHEMA = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 8;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 9;
+
+ /**
* The feature id for the '<em><b>Specified Name For Xml</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 9;
+ public static final int ABSTRACT_XML_TABLE__SPECIFIED_NAME_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 10;
/**
* The feature id for the '<em><b>Specified Catalog For Xml</b></em>' attribute.
@@ -2829,7 +2838,7 @@ public class OrmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 10;
+ public static final int ABSTRACT_XML_TABLE__SPECIFIED_CATALOG_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 11;
/**
* The feature id for the '<em><b>Specified Schema For Xml</b></em>' attribute.
@@ -2838,7 +2847,7 @@ public class OrmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 11;
+ public static final int ABSTRACT_XML_TABLE__SPECIFIED_SCHEMA_FOR_XML = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 12;
/**
* The number of structural features of the '<em>Abstract Xml Table</em>' class.
@@ -2847,7 +2856,7 @@ public class OrmPackage extends EPackageImpl
* @generated
* @ordered
*/
- public static final int ABSTRACT_XML_TABLE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 12;
+ public static final int ABSTRACT_XML_TABLE_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 13;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlTable <em>Xml Table</em>}' class.
@@ -2941,6 +2950,15 @@ public class OrmPackage extends EPackageImpl
public static final int XML_TABLE__DEFAULT_SCHEMA = ABSTRACT_XML_TABLE__DEFAULT_SCHEMA;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS;
+
+ /**
* The feature id for the '<em><b>Specified Name For Xml</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -4111,6 +4129,15 @@ public class OrmPackage extends EPackageImpl
public static final int XML_JOIN_TABLE__DEFAULT_SCHEMA = ABSTRACT_XML_TABLE__DEFAULT_SCHEMA;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_JOIN_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS;
+
+ /**
* The feature id for the '<em><b>Specified Name For Xml</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -4548,6 +4575,15 @@ public class OrmPackage extends EPackageImpl
public static final int XML_SECONDARY_TABLE__DEFAULT_SCHEMA = ABSTRACT_XML_TABLE__DEFAULT_SCHEMA;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_SECONDARY_TABLE__UNIQUE_CONSTRAINTS = ABSTRACT_XML_TABLE__UNIQUE_CONSTRAINTS;
+
+ /**
* The feature id for the '<em><b>Specified Name For Xml</b></em>' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5183,13 +5219,22 @@ public class OrmPackage extends EPackageImpl
public static final int XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE = XML_GENERATOR_FEATURE_COUNT + 17;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS = XML_GENERATOR_FEATURE_COUNT + 18;
+
+ /**
* The number of structural features of the '<em>Xml Table Generator</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int XML_TABLE_GENERATOR_FEATURE_COUNT = XML_GENERATOR_FEATURE_COUNT + 18;
+ public static final int XML_TABLE_GENERATOR_FEATURE_COUNT = XML_GENERATOR_FEATURE_COUNT + 19;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlOrderBy <em>Xml Order By</em>}' class.
@@ -5422,6 +5467,34 @@ public class OrmPackage extends EPackageImpl
public static final int XML_QUERY_HINT_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 2;
/**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint <em>Xml Unique Constraint</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlUniqueConstraint()
+ * @generated
+ */
+ public static final int XML_UNIQUE_CONSTRAINT = 58;
+
+ /**
+ * The feature id for the '<em><b>Column Names</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_UNIQUE_CONSTRAINT__COLUMN_NAMES = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>Xml Unique Constraint</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int XML_UNIQUE_CONSTRAINT_FEATURE_COUNT = JpaCorePackage.XML_EOBJECT_FEATURE_COUNT + 1;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -5828,6 +5901,13 @@ public class OrmPackage extends EPackageImpl
private EClass xmlQueryHintEClass = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EClass xmlUniqueConstraintEClass = 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.
@@ -7659,6 +7739,18 @@ public class OrmPackage extends EPackageImpl
}
/**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint <em>Xml Unique Constraint</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>Xml Unique Constraint</em>'.
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint
+ * @generated
+ */
+ public EClass getXmlUniqueConstraint() {
+ return xmlUniqueConstraintEClass;
+ }
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7827,6 +7919,7 @@ public class OrmPackage extends EPackageImpl
xmlNamedQueryEClass = createEClass(XML_NAMED_QUERY);
xmlNamedNativeQueryEClass = createEClass(XML_NAMED_NATIVE_QUERY);
xmlQueryHintEClass = createEClass(XML_QUERY_HINT);
+ xmlUniqueConstraintEClass = createEClass(XML_UNIQUE_CONSTRAINT);
}
/**
@@ -7969,6 +8062,8 @@ public class OrmPackage extends EPackageImpl
xmlNamedNativeQueryEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getINamedNativeQuery());
xmlQueryHintEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject());
xmlQueryHintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIQueryHint());
+ xmlUniqueConstraintEClass.getESuperTypes().add(theJpaCorePackage.getXmlEObject());
+ xmlUniqueConstraintEClass.getESuperTypes().add(theJpaCoreMappingsPackage.getIUniqueConstraint());
// 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);
@@ -8111,6 +8206,7 @@ public class OrmPackage extends EPackageImpl
initEClass(xmlNamedQueryEClass, XmlNamedQuery.class, "XmlNamedQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(xmlNamedNativeQueryEClass, XmlNamedNativeQuery.class, "XmlNamedNativeQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
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);
// Create resource
createResource(eNS_URI);
}
@@ -9355,5 +9451,15 @@ public class OrmPackage extends EPackageImpl
* @generated
*/
public static final EClass XML_QUERY_HINT = eINSTANCE.getXmlQueryHint();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint <em>Xml Unique Constraint</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlUniqueConstraint()
+ * @generated
+ */
+ public static final EClass XML_UNIQUE_CONSTRAINT = eINSTANCE.getXmlUniqueConstraint();
}
} //OrmPackage
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlDiscriminatorColumn.java
index 64e0b3473b..bc0effec99 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlDiscriminatorColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlDiscriminatorColumn.java
@@ -130,11 +130,11 @@ public class XmlDiscriminatorColumn extends AbstractXmlNamedColumn
protected XmlDiscriminatorColumn() {
throw new UnsupportedOperationException();
}
-
+
protected XmlDiscriminatorColumn(INamedColumn.Owner owner) {
super(owner);
}
-
+
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTableGenerator.java
index c6309dd6f3..e1d48a9e79 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTableGenerator.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlTableGenerator.java
@@ -9,10 +9,17 @@
******************************************************************************/
package org.eclipse.jpt.core.internal.content.orm;
+import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.NotificationChain;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
+import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jpt.core.internal.mappings.ITableGenerator;
+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;
@@ -330,6 +337,16 @@ public class XmlTableGenerator extends XmlGenerator implements ITableGenerator
protected String defaultPkColumnValue = DEFAULT_PK_COLUMN_VALUE_EDEFAULT;
/**
+ * The cached value of the '{@link #getUniqueConstraints() <em>Unique Constraints</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUniqueConstraints()
+ * @generated
+ * @ordered
+ */
+ protected EList<IUniqueConstraint> uniqueConstraints;
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -680,6 +697,41 @@ public class XmlTableGenerator extends XmlGenerator implements ITableGenerator
}
/**
+ * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Unique Constraints</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Unique Constraints</em>' containment reference list.
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getITableGenerator_UniqueConstraints()
+ * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true"
+ * @generated
+ */
+ public EList<IUniqueConstraint> getUniqueConstraints() {
+ if (uniqueConstraints == null) {
+ uniqueConstraints = new EObjectContainmentEList<IUniqueConstraint>(IUniqueConstraint.class, this, OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS);
+ }
+ return uniqueConstraints;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
+ switch (featureID) {
+ case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ return ((InternalEList<?>) getUniqueConstraints()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -723,6 +775,8 @@ public class XmlTableGenerator extends XmlGenerator implements ITableGenerator
return getSpecifiedPkColumnValue();
case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE :
return getDefaultPkColumnValue();
+ case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ return getUniqueConstraints();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -732,6 +786,7 @@ public class XmlTableGenerator extends XmlGenerator implements ITableGenerator
* <!-- end-user-doc -->
* @generated
*/
+ @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
@@ -753,6 +808,10 @@ public class XmlTableGenerator extends XmlGenerator implements ITableGenerator
case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE :
setSpecifiedPkColumnValue((String) newValue);
return;
+ case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ getUniqueConstraints().clear();
+ getUniqueConstraints().addAll((Collection<? extends IUniqueConstraint>) newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -783,6 +842,9 @@ public class XmlTableGenerator extends XmlGenerator implements ITableGenerator
case OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE :
setSpecifiedPkColumnValue(SPECIFIED_PK_COLUMN_VALUE_EDEFAULT);
return;
+ case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ getUniqueConstraints().clear();
+ return;
}
super.eUnset(featureID);
}
@@ -831,6 +893,8 @@ public class XmlTableGenerator extends XmlGenerator implements ITableGenerator
return SPECIFIED_PK_COLUMN_VALUE_EDEFAULT == null ? specifiedPkColumnValue != null : !SPECIFIED_PK_COLUMN_VALUE_EDEFAULT.equals(specifiedPkColumnValue);
case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE :
return DEFAULT_PK_COLUMN_VALUE_EDEFAULT == null ? defaultPkColumnValue != null : !DEFAULT_PK_COLUMN_VALUE_EDEFAULT.equals(defaultPkColumnValue);
+ case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ return uniqueConstraints != null && !uniqueConstraints.isEmpty();
}
return super.eIsSet(featureID);
}
@@ -880,6 +944,8 @@ public class XmlTableGenerator extends XmlGenerator implements ITableGenerator
return JpaCoreMappingsPackage.ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE;
case OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE :
return JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE;
+ case OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ return JpaCoreMappingsPackage.ITABLE_GENERATOR__UNIQUE_CONSTRAINTS;
default :
return -1;
}
@@ -932,6 +998,8 @@ public class XmlTableGenerator extends XmlGenerator implements ITableGenerator
return OrmPackage.XML_TABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE;
case JpaCoreMappingsPackage.ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE :
return OrmPackage.XML_TABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE;
+ case JpaCoreMappingsPackage.ITABLE_GENERATOR__UNIQUE_CONSTRAINTS :
+ return OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS;
default :
return -1;
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlUniqueConstraint.java
new file mode 100644
index 0000000000..e590a8aa51
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlUniqueConstraint.java
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * 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 java.util.Collection;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
+import org.eclipse.jpt.core.internal.XmlEObject;
+import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint;
+import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Xml Unique Constraint</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ *
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getXmlUniqueConstraint()
+ * @model kind="class"
+ * @generated
+ */
+public class XmlUniqueConstraint extends XmlEObject
+ implements IUniqueConstraint
+{
+ /**
+ * The cached value of the '{@link #getColumnNames() <em>Column Names</em>}' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getColumnNames()
+ * @generated
+ * @ordered
+ */
+ protected EList<String> columnNames;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected XmlUniqueConstraint() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return OrmPackage.Literals.XML_UNIQUE_CONSTRAINT;
+ }
+
+ /**
+ * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Column Names</em>' attribute list.
+ * @see org.eclipse.jpt.core.internal.content.orm.OrmPackage#getIUniqueConstraint_ColumnNames()
+ * @model type="java.lang.String"
+ * @generated
+ */
+ public EList<String> getColumnNames() {
+ if (columnNames == null) {
+ columnNames = new EDataTypeUniqueEList<String>(String.class, this, OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES);
+ }
+ return columnNames;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES :
+ return getColumnNames();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES :
+ getColumnNames().clear();
+ getColumnNames().addAll((Collection<? extends String>) newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES :
+ getColumnNames().clear();
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES :
+ return columnNames != null && !columnNames.isEmpty();
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
+ if (baseClass == IUniqueConstraint.class) {
+ switch (derivedFeatureID) {
+ case OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES :
+ return JpaCoreMappingsPackage.IUNIQUE_CONSTRAINT__COLUMN_NAMES;
+ 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 == IUniqueConstraint.class) {
+ switch (baseFeatureID) {
+ case JpaCoreMappingsPackage.IUNIQUE_CONSTRAINT__COLUMN_NAMES :
+ return OrmPackage.XML_UNIQUE_CONSTRAINT__COLUMN_NAMES;
+ 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(" (columnNames: ");
+ result.append(columnNames);
+ result.append(')');
+ return result.toString();
+ }
+} // XmlUniqueConstraint
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractTableTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractTableTranslator.java
index 4a21640d86..fb809d2ca4 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractTableTranslator.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/AbstractTableTranslator.java
@@ -52,8 +52,8 @@ public abstract class AbstractTableTranslator extends Translator
return new Translator(SCHEMA, JPA_CORE_XML_PKG.getAbstractXmlTable_SpecifiedSchemaForXml(), DOM_ATTRIBUTE);
}
- //placeholder until we support unique-constraint
protected Translator createUniqueConstraintTranslator() {
return new Translator(UNIQUE_CONSTRAINT, (EStructuralFeature) null);
+ //TODO return new UniqueConstraintTranslator(UNIQUE_CONSTRAINT, MAPPINGS_PKG.getITable_UniqueConstraints());
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DiscriminatorColumnTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DiscriminatorColumnTranslator.java
index b71ef5541f..8f493eeb13 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DiscriminatorColumnTranslator.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/DiscriminatorColumnTranslator.java
@@ -9,10 +9,7 @@
package org.eclipse.jpt.core.internal.content.orm.resource;
import org.eclipse.emf.ecore.EObject;
-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.IEntity;
-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;
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 c962941cb8..d53a981fa0 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
@@ -163,6 +163,7 @@ public interface OrmXmlMapper
String TEMPORAL = "temporal"; //$NON-NLS-1$
String TRANSIENT = "transient"; //$NON-NLS-1$
String UNIQUE_CONSTRAINT = "unique-constraint"; //$NON-NLS-1$
+ String UNIQUE_CONSTRAINT__COLUMN_NAME = "column-name"; //$NON-NLS-1$
String VERSION = "version"; //$NON-NLS-1$
String XML_MAPPING_METADATA_COMPLETE = "xml-mapping-metadata-complete"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/UniqueConstraintTranslator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/UniqueConstraintTranslator.java
new file mode 100644
index 0000000000..258a2732b3
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/resource/UniqueConstraintTranslator.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * 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 UniqueConstraintTranslator 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 UniqueConstraintTranslator(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,
+ creatColumnNamesTranslator(),
+ };
+ }
+
+ protected Translator creatColumnNamesTranslator() {
+ return new Translator(UNIQUE_CONSTRAINT__COLUMN_NAME, MAPPINGS_PKG.getITable_UniqueConstraints());
+ }
+
+ @Override
+ public EObject createEMFObject(String nodeName, String readAheadName) {
+ return OrmFactory.eINSTANCE.createXmlUniqueConstraint();
+ }
+}
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 d21bb8c777..753fa0fbe2 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
@@ -82,6 +82,7 @@ import org.eclipse.jpt.core.internal.content.orm.XmlTable;
import org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator;
import org.eclipse.jpt.core.internal.content.orm.XmlTransient;
import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping;
+import org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint;
import org.eclipse.jpt.core.internal.content.orm.XmlVersion;
import org.eclipse.jpt.core.internal.mappings.IAbstractColumn;
import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
@@ -122,6 +123,7 @@ import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping;
import org.eclipse.jpt.core.internal.mappings.ITable;
import org.eclipse.jpt.core.internal.mappings.ITableGenerator;
import org.eclipse.jpt.core.internal.mappings.ITransient;
+import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint;
import org.eclipse.jpt.core.internal.mappings.IVersion;
/**
@@ -471,6 +473,11 @@ public class OrmAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseXmlUniqueConstraint(XmlUniqueConstraint object) {
+ return createXmlUniqueConstraintAdapter();
+ }
+
+ @Override
public Adapter caseIJpaEObject(IJpaEObject object) {
return createIJpaEObjectAdapter();
}
@@ -726,6 +733,11 @@ public class OrmAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseIUniqueConstraint(IUniqueConstraint object) {
+ return createIUniqueConstraintAdapter();
+ }
+
+ @Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@@ -1529,6 +1541,20 @@ public class OrmAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint <em>Xml Unique Constraint</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.XmlUniqueConstraint
+ * @generated
+ */
+ public Adapter createXmlUniqueConstraintAdapter() {
+ 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;
@@ -2047,6 +2073,20 @@ public class OrmAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint <em>IUnique Constraint</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.IUniqueConstraint
+ * @generated
+ */
+ public Adapter createIUniqueConstraintAdapter() {
+ 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 7775b9b796..096ef9d99d 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
@@ -81,6 +81,7 @@ import org.eclipse.jpt.core.internal.content.orm.XmlTable;
import org.eclipse.jpt.core.internal.content.orm.XmlTableGenerator;
import org.eclipse.jpt.core.internal.content.orm.XmlTransient;
import org.eclipse.jpt.core.internal.content.orm.XmlTypeMapping;
+import org.eclipse.jpt.core.internal.content.orm.XmlUniqueConstraint;
import org.eclipse.jpt.core.internal.content.orm.XmlVersion;
import org.eclipse.jpt.core.internal.mappings.IAbstractColumn;
import org.eclipse.jpt.core.internal.mappings.IAbstractJoinColumn;
@@ -121,6 +122,7 @@ import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping;
import org.eclipse.jpt.core.internal.mappings.ITable;
import org.eclipse.jpt.core.internal.mappings.ITableGenerator;
import org.eclipse.jpt.core.internal.mappings.ITransient;
+import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint;
import org.eclipse.jpt.core.internal.mappings.IVersion;
/**
@@ -1437,6 +1439,25 @@ public class OrmSwitch<T>
result = defaultCase(theEObject);
return result;
}
+ case OrmPackage.XML_UNIQUE_CONSTRAINT : {
+ XmlUniqueConstraint xmlUniqueConstraint = (XmlUniqueConstraint) theEObject;
+ T result = caseXmlUniqueConstraint(xmlUniqueConstraint);
+ if (result == null)
+ result = caseXmlEObject(xmlUniqueConstraint);
+ if (result == null)
+ result = caseIUniqueConstraint(xmlUniqueConstraint);
+ if (result == null)
+ result = caseJpaEObject(xmlUniqueConstraint);
+ if (result == null)
+ result = caseIXmlEObject(xmlUniqueConstraint);
+ if (result == null)
+ result = caseIJpaSourceObject(xmlUniqueConstraint);
+ if (result == null)
+ result = caseIJpaEObject(xmlUniqueConstraint);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
default :
return defaultCase(theEObject);
}
@@ -2268,6 +2289,21 @@ public class OrmSwitch<T>
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>Xml Unique Constraint</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 Unique Constraint</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseXmlUniqueConstraint(XmlUniqueConstraint 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;
@@ -2838,6 +2874,21 @@ public class OrmSwitch<T>
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>IUnique Constraint</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>IUnique Constraint</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseIUniqueConstraint(IUniqueConstraint 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/ITable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITable.java
index afcaa9c0db..c09617fb5c 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITable.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITable.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.core.internal.mappings;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.jpt.core.internal.IJpaSourceObject;
import org.eclipse.jpt.core.internal.ITextRange;
import org.eclipse.jpt.core.internal.ITypeMapping;
@@ -32,6 +33,7 @@ import org.eclipse.jpt.db.internal.Table;
* <li>{@link org.eclipse.jpt.core.internal.mappings.ITable#getSchema <em>Schema</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.mappings.ITable#getSpecifiedSchema <em>Specified Schema</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.mappings.ITable#getDefaultSchema <em>Default Schema</em>}</li>
+ * <li>{@link org.eclipse.jpt.core.internal.mappings.ITable#getUniqueConstraints <em>Unique Constraints</em>}</li>
* </ul>
* </p>
*
@@ -184,6 +186,22 @@ public interface ITable extends IJpaSourceObject
String getDefaultSchema();
/**
+ * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Unique Constraints</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Unique Constraints</em>' containment reference list.
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITable_UniqueConstraints()
+ * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true"
+ * @generated
+ */
+ EList<IUniqueConstraint> getUniqueConstraints();
+
+ /**
* Returns the value of the '<em><b>Specified Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
@@ -233,6 +251,9 @@ public interface ITable extends IJpaSourceObject
ITextRange getSchemaTextRange();
Owner getOwner();
+
+ IUniqueConstraint createUniqueConstraint(int index);
+
/**
* interface allowing tables to be owned by various objects
*/
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITableGenerator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITableGenerator.java
index b9e0012a52..6f4297fb0b 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITableGenerator.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/ITableGenerator.java
@@ -9,6 +9,7 @@
******************************************************************************/
package org.eclipse.jpt.core.internal.mappings;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.jpt.core.internal.platform.DefaultsContext;
/**
@@ -37,6 +38,7 @@ import org.eclipse.jpt.core.internal.platform.DefaultsContext;
* <li>{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getPkColumnValue <em>Pk Column Value</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getSpecifiedPkColumnValue <em>Specified Pk Column Value</em>}</li>
* <li>{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getDefaultPkColumnValue <em>Default Pk Column Value</em>}</li>
+ * <li>{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getUniqueConstraints <em>Unique Constraints</em>}</li>
* </ul>
* </p>
*
@@ -382,5 +384,21 @@ public interface ITableGenerator extends IGenerator
*/
String getDefaultPkColumnValue();
+ /**
+ * Returns the value of the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * The list contents are of type {@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Unique Constraints</em>' containment reference list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Unique Constraints</em>' containment reference list.
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator_UniqueConstraints()
+ * @model type="org.eclipse.jpt.core.internal.mappings.IUniqueConstraint" containment="true"
+ * @generated
+ */
+ EList<IUniqueConstraint> getUniqueConstraints();
+
void refreshDefaults(DefaultsContext defaultsContext);
} // ITableGenerator
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IUniqueConstraint.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IUniqueConstraint.java
new file mode 100644
index 0000000000..c3455b846e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/IUniqueConstraint.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Oracle. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Oracle. - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.mappings;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.jpt.core.internal.IJpaSourceObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>IUnique Constraint</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint#getColumnNames <em>Column Names</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIUniqueConstraint()
+ * @model kind="class" interface="true" abstract="true"
+ * @generated
+ */
+public interface IUniqueConstraint extends IJpaSourceObject
+{
+ /**
+ * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Column Names</em>' attribute list.
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIUniqueConstraint_ColumnNames()
+ * @model type="java.lang.String"
+ * @generated
+ */
+ EList<String> getColumnNames();
+} // IUniqueConstraint
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 423d112dcd..3683c089ef 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
@@ -473,13 +473,50 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int ITABLE__DEFAULT_SCHEMA = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 8;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ITABLE__UNIQUE_CONSTRAINTS = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 9;
+
+ /**
* The number of structural features of the '<em>ITable</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int ITABLE_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 9;
+ public static final int ITABLE_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 10;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint <em>IUnique Constraint</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.mappings.IUniqueConstraint
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIUniqueConstraint()
+ * @generated
+ */
+ public static final int IUNIQUE_CONSTRAINT = 4;
+
+ /**
+ * The feature id for the '<em><b>Column Names</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int IUNIQUE_CONSTRAINT__COLUMN_NAMES = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 0;
+
+ /**
+ * The number of structural features of the '<em>IUnique Constraint</em>' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int IUNIQUE_CONSTRAINT_FEATURE_COUNT = JpaCorePackage.IJPA_SOURCE_OBJECT_FEATURE_COUNT + 1;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn <em>INamed Column</em>}' class.
@@ -489,7 +526,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedColumn()
* @generated
*/
- public static final int INAMED_COLUMN = 4;
+ public static final int INAMED_COLUMN = 5;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -544,7 +581,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractColumn()
* @generated
*/
- public static final int IABSTRACT_COLUMN = 5;
+ public static final int IABSTRACT_COLUMN = 6;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -662,7 +699,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumn()
* @generated
*/
- public static final int ICOLUMN = 6;
+ public static final int ICOLUMN = 7;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -807,7 +844,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIColumnMapping()
* @generated
*/
- public static final int ICOLUMN_MAPPING = 7;
+ public static final int ICOLUMN_MAPPING = 8;
/**
* The number of structural features of the '<em>IColumn Mapping</em>' class.
@@ -826,7 +863,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIBasic()
* @generated
*/
- public static final int IBASIC = 8;
+ public static final int IBASIC = 9;
/**
* The feature id for the '<em><b>Fetch</b></em>' attribute.
@@ -899,7 +936,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIId()
* @generated
*/
- public static final int IID = 9;
+ public static final int IID = 10;
/**
* The feature id for the '<em><b>Column</b></em>' containment reference.
@@ -963,7 +1000,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITransient()
* @generated
*/
- public static final int ITRANSIENT = 10;
+ public static final int ITRANSIENT = 11;
/**
* The number of structural features of the '<em>ITransient</em>' class.
@@ -982,7 +1019,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIVersion()
* @generated
*/
- public static final int IVERSION = 11;
+ public static final int IVERSION = 12;
/**
* The feature id for the '<em><b>Column</b></em>' containment reference.
@@ -1019,7 +1056,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbeddedId()
* @generated
*/
- public static final int IEMBEDDED_ID = 12;
+ public static final int IEMBEDDED_ID = 13;
/**
* The number of structural features of the '<em>IEmbedded Id</em>' class.
@@ -1038,7 +1075,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIEmbedded()
* @generated
*/
- public static final int IEMBEDDED = 13;
+ public static final int IEMBEDDED = 14;
/**
* The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
@@ -1084,7 +1121,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIRelationshipMapping()
* @generated
*/
- public static final int IRELATIONSHIP_MAPPING = 14;
+ public static final int IRELATIONSHIP_MAPPING = 15;
/**
* The feature id for the '<em><b>Target Entity</b></em>' attribute.
@@ -1139,7 +1176,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINonOwningMapping()
* @generated
*/
- public static final int INON_OWNING_MAPPING = 15;
+ public static final int INON_OWNING_MAPPING = 16;
/**
* The feature id for the '<em><b>Target Entity</b></em>' attribute.
@@ -1203,7 +1240,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIMultiRelationshipMapping()
* @generated
*/
- public static final int IMULTI_RELATIONSHIP_MAPPING = 16;
+ public static final int IMULTI_RELATIONSHIP_MAPPING = 17;
/**
* The feature id for the '<em><b>Target Entity</b></em>' attribute.
@@ -1294,7 +1331,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOneToMany()
* @generated
*/
- public static final int IONE_TO_MANY = 17;
+ public static final int IONE_TO_MANY = 18;
/**
* The feature id for the '<em><b>Target Entity</b></em>' attribute.
@@ -1385,7 +1422,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIManyToMany()
* @generated
*/
- public static final int IMANY_TO_MANY = 18;
+ public static final int IMANY_TO_MANY = 19;
/**
* The feature id for the '<em><b>Target Entity</b></em>' attribute.
@@ -1476,7 +1513,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISingleRelationshipMapping()
* @generated
*/
- public static final int ISINGLE_RELATIONSHIP_MAPPING = 19;
+ public static final int ISINGLE_RELATIONSHIP_MAPPING = 20;
/**
* The feature id for the '<em><b>Target Entity</b></em>' attribute.
@@ -1567,7 +1604,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIManyToOne()
* @generated
*/
- public static final int IMANY_TO_ONE = 20;
+ public static final int IMANY_TO_ONE = 21;
/**
* The feature id for the '<em><b>Target Entity</b></em>' attribute.
@@ -1658,7 +1695,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOneToOne()
* @generated
*/
- public static final int IONE_TO_ONE = 21;
+ public static final int IONE_TO_ONE = 22;
/**
* The feature id for the '<em><b>Target Entity</b></em>' attribute.
@@ -1758,7 +1795,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinTable()
* @generated
*/
- public static final int IJOIN_TABLE = 22;
+ public static final int IJOIN_TABLE = 23;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -1842,6 +1879,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int IJOIN_TABLE__DEFAULT_SCHEMA = ITABLE__DEFAULT_SCHEMA;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int IJOIN_TABLE__UNIQUE_CONSTRAINTS = ITABLE__UNIQUE_CONSTRAINTS;
+
+ /**
* The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -1912,7 +1958,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAbstractJoinColumn()
* @generated
*/
- public static final int IABSTRACT_JOIN_COLUMN = 23;
+ public static final int IABSTRACT_JOIN_COLUMN = 24;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -1994,7 +2040,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIJoinColumn()
* @generated
*/
- public static final int IJOIN_COLUMN = 24;
+ public static final int IJOIN_COLUMN = 25;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2139,7 +2185,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOverride()
* @generated
*/
- public static final int IOVERRIDE = 25;
+ public static final int IOVERRIDE = 26;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2167,7 +2213,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAttributeOverride()
* @generated
*/
- public static final int IATTRIBUTE_OVERRIDE = 26;
+ public static final int IATTRIBUTE_OVERRIDE = 27;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2204,7 +2250,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIAssociationOverride()
* @generated
*/
- public static final int IASSOCIATION_OVERRIDE = 27;
+ public static final int IASSOCIATION_OVERRIDE = 28;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2259,7 +2305,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIDiscriminatorColumn()
* @generated
*/
- public static final int IDISCRIMINATOR_COLUMN = 28;
+ public static final int IDISCRIMINATOR_COLUMN = 29;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2350,7 +2396,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISecondaryTable()
* @generated
*/
- public static final int ISECONDARY_TABLE = 29;
+ public static final int ISECONDARY_TABLE = 30;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2434,6 +2480,15 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int ISECONDARY_TABLE__DEFAULT_SCHEMA = ITABLE__DEFAULT_SCHEMA;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ISECONDARY_TABLE__UNIQUE_CONSTRAINTS = ITABLE__UNIQUE_CONSTRAINTS;
+
+ /**
* The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -2477,7 +2532,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIPrimaryKeyJoinColumn()
* @generated
*/
- public static final int IPRIMARY_KEY_JOIN_COLUMN = 30;
+ public static final int IPRIMARY_KEY_JOIN_COLUMN = 31;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2559,7 +2614,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGenerator()
* @generated
*/
- public static final int IGENERATOR = 31;
+ public static final int IGENERATOR = 32;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2641,7 +2696,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getITableGenerator()
* @generated
*/
- public static final int ITABLE_GENERATOR = 32;
+ public static final int ITABLE_GENERATOR = 33;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2869,13 +2924,22 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final int ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE = IGENERATOR_FEATURE_COUNT + 17;
/**
+ * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public static final int ITABLE_GENERATOR__UNIQUE_CONSTRAINTS = IGENERATOR_FEATURE_COUNT + 18;
+
+ /**
* The number of structural features of the '<em>ITable Generator</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- public static final int ITABLE_GENERATOR_FEATURE_COUNT = IGENERATOR_FEATURE_COUNT + 18;
+ public static final int ITABLE_GENERATOR_FEATURE_COUNT = IGENERATOR_FEATURE_COUNT + 19;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator <em>ISequence Generator</em>}' class.
@@ -2885,7 +2949,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getISequenceGenerator()
* @generated
*/
- public static final int ISEQUENCE_GENERATOR = 33;
+ public static final int ISEQUENCE_GENERATOR = 34;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -2994,7 +3058,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIGeneratedValue()
* @generated
*/
- public static final int IGENERATED_VALUE = 34;
+ public static final int IGENERATED_VALUE = 35;
/**
* The feature id for the '<em><b>Strategy</b></em>' attribute.
@@ -3031,7 +3095,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIOrderBy()
* @generated
*/
- public static final int IORDER_BY = 35;
+ public static final int IORDER_BY = 36;
/**
* The feature id for the '<em><b>Value</b></em>' attribute.
@@ -3068,7 +3132,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQuery()
* @generated
*/
- public static final int IQUERY = 36;
+ public static final int IQUERY = 37;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -3114,7 +3178,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedQuery()
* @generated
*/
- public static final int INAMED_QUERY = 37;
+ public static final int INAMED_QUERY = 38;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -3160,7 +3224,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getINamedNativeQuery()
* @generated
*/
- public static final int INAMED_NATIVE_QUERY = 38;
+ public static final int INAMED_NATIVE_QUERY = 39;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -3224,7 +3288,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIQueryHint()
* @generated
*/
- public static final int IQUERY_HINT = 39;
+ public static final int IQUERY_HINT = 40;
/**
* The feature id for the '<em><b>Name</b></em>' attribute.
@@ -3261,7 +3325,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultEagerFetchType()
* @generated
*/
- public static final int DEFAULT_EAGER_FETCH_TYPE = 40;
+ public static final int DEFAULT_EAGER_FETCH_TYPE = 41;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultLazyFetchType <em>Default Lazy Fetch Type</em>}' enum.
@@ -3271,7 +3335,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultLazyFetchType()
* @generated
*/
- public static final int DEFAULT_LAZY_FETCH_TYPE = 41;
+ public static final int DEFAULT_LAZY_FETCH_TYPE = 42;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultFalseBoolean <em>Default False Boolean</em>}' enum.
@@ -3281,7 +3345,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultFalseBoolean()
* @generated
*/
- public static final int DEFAULT_FALSE_BOOLEAN = 42;
+ public static final int DEFAULT_FALSE_BOOLEAN = 43;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DefaultTrueBoolean <em>Default True Boolean</em>}' enum.
@@ -3291,7 +3355,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDefaultTrueBoolean()
* @generated
*/
- public static final int DEFAULT_TRUE_BOOLEAN = 43;
+ public static final int DEFAULT_TRUE_BOOLEAN = 44;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.TemporalType <em>Temporal Type</em>}' enum.
@@ -3301,7 +3365,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getTemporalType()
* @generated
*/
- public static final int TEMPORAL_TYPE = 44;
+ public static final int TEMPORAL_TYPE = 45;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.InheritanceType <em>Inheritance Type</em>}' enum.
@@ -3311,7 +3375,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getInheritanceType()
* @generated
*/
- public static final int INHERITANCE_TYPE = 45;
+ public static final int INHERITANCE_TYPE = 46;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.DiscriminatorType <em>Discriminator Type</em>}' enum.
@@ -3321,7 +3385,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getDiscriminatorType()
* @generated
*/
- public static final int DISCRIMINATOR_TYPE = 46;
+ public static final int DISCRIMINATOR_TYPE = 47;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.GenerationType <em>Generation Type</em>}' enum.
@@ -3331,7 +3395,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getGenerationType()
* @generated
*/
- public static final int GENERATION_TYPE = 47;
+ public static final int GENERATION_TYPE = 48;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.EnumType <em>Enum Type</em>}' enum.
@@ -3341,7 +3405,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getEnumType()
* @generated
*/
- public static final int ENUM_TYPE = 48;
+ public static final int ENUM_TYPE = 49;
/**
* The meta object id for the '{@link org.eclipse.jpt.core.internal.mappings.OrderingType <em>Ordering Type</em>}' enum.
@@ -3351,7 +3415,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getOrderingType()
* @generated
*/
- public static final int ORDERING_TYPE = 49;
+ public static final int ORDERING_TYPE = 50;
/**
* <!-- begin-user-doc -->
@@ -3386,6 +3450,13 @@ public class JpaCoreMappingsPackage extends EPackageImpl
* <!-- end-user-doc -->
* @generated
*/
+ private EClass iUniqueConstraintEClass = null;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
private EClass iNamedColumnEClass = null;
/**
@@ -4237,6 +4308,44 @@ public class JpaCoreMappingsPackage extends EPackageImpl
}
/**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.ITable#getUniqueConstraints <em>Unique Constraints</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Unique Constraints</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.ITable#getUniqueConstraints()
+ * @see #getITable()
+ * @generated
+ */
+ public EReference getITable_UniqueConstraints() {
+ return (EReference) iTableEClass.getEStructuralFeatures().get(9);
+ }
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint <em>IUnique Constraint</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for class '<em>IUnique Constraint</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.IUniqueConstraint
+ * @generated
+ */
+ public EClass getIUniqueConstraint() {
+ return iUniqueConstraintEClass;
+ }
+
+ /**
+ * Returns the meta object for the attribute list '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint#getColumnNames <em>Column Names</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Column Names</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.IUniqueConstraint#getColumnNames()
+ * @see #getIUniqueConstraint()
+ * @generated
+ */
+ public EAttribute getIUniqueConstraint_ColumnNames() {
+ return (EAttribute) iUniqueConstraintEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
* Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn <em>INamed Column</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5729,6 +5838,19 @@ public class JpaCoreMappingsPackage extends EPackageImpl
}
/**
+ * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.core.internal.mappings.ITableGenerator#getUniqueConstraints <em>Unique Constraints</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the containment reference list '<em>Unique Constraints</em>'.
+ * @see org.eclipse.jpt.core.internal.mappings.ITableGenerator#getUniqueConstraints()
+ * @see #getITableGenerator()
+ * @generated
+ */
+ public EReference getITableGenerator_UniqueConstraints() {
+ return (EReference) iTableGeneratorEClass.getEStructuralFeatures().get(18);
+ }
+
+ /**
* Returns the meta object for class '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator <em>ISequence Generator</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6179,6 +6301,9 @@ public class JpaCoreMappingsPackage extends EPackageImpl
createEAttribute(iTableEClass, ITABLE__SCHEMA);
createEAttribute(iTableEClass, ITABLE__SPECIFIED_SCHEMA);
createEAttribute(iTableEClass, ITABLE__DEFAULT_SCHEMA);
+ createEReference(iTableEClass, ITABLE__UNIQUE_CONSTRAINTS);
+ iUniqueConstraintEClass = createEClass(IUNIQUE_CONSTRAINT);
+ createEAttribute(iUniqueConstraintEClass, IUNIQUE_CONSTRAINT__COLUMN_NAMES);
iNamedColumnEClass = createEClass(INAMED_COLUMN);
createEAttribute(iNamedColumnEClass, INAMED_COLUMN__NAME);
createEAttribute(iNamedColumnEClass, INAMED_COLUMN__SPECIFIED_NAME);
@@ -6296,6 +6421,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__PK_COLUMN_VALUE);
createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__SPECIFIED_PK_COLUMN_VALUE);
createEAttribute(iTableGeneratorEClass, ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE);
+ createEReference(iTableGeneratorEClass, ITABLE_GENERATOR__UNIQUE_CONSTRAINTS);
iSequenceGeneratorEClass = createEClass(ISEQUENCE_GENERATOR);
createEAttribute(iSequenceGeneratorEClass, ISEQUENCE_GENERATOR__SEQUENCE_NAME);
createEAttribute(iSequenceGeneratorEClass, ISEQUENCE_GENERATOR__SPECIFIED_SEQUENCE_NAME);
@@ -6362,6 +6488,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
iEntityEClass.getESuperTypes().add(theJpaCorePackage.getITypeMapping());
iEmbeddableEClass.getESuperTypes().add(theJpaCorePackage.getITypeMapping());
iTableEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject());
+ iUniqueConstraintEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject());
iNamedColumnEClass.getESuperTypes().add(theJpaCorePackage.getIJpaSourceObject());
iAbstractColumnEClass.getESuperTypes().add(this.getINamedColumn());
iColumnEClass.getESuperTypes().add(this.getIAbstractColumn());
@@ -6445,6 +6572,9 @@ public class JpaCoreMappingsPackage extends EPackageImpl
initEAttribute(getITable_Schema(), ecorePackage.getEString(), "schema", null, 0, 1, ITable.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEAttribute(getITable_SpecifiedSchema(), ecorePackage.getEString(), "specifiedSchema", null, 0, 1, ITable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getITable_DefaultSchema(), ecorePackage.getEString(), "defaultSchema", null, 0, 1, ITable.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getITable_UniqueConstraints(), this.getIUniqueConstraint(), null, "uniqueConstraints", null, 0, -1, ITable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(iUniqueConstraintEClass, IUniqueConstraint.class, "IUniqueConstraint", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getIUniqueConstraint_ColumnNames(), theEcorePackage.getEString(), "columnNames", null, 0, -1, IUniqueConstraint.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(iNamedColumnEClass, INamedColumn.class, "INamedColumn", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getINamedColumn_Name(), ecorePackage.getEString(), "name", null, 0, 1, INamedColumn.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEAttribute(getINamedColumn_SpecifiedName(), ecorePackage.getEString(), "specifiedName", null, 0, 1, INamedColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -6565,6 +6695,7 @@ public class JpaCoreMappingsPackage extends EPackageImpl
initEAttribute(getITableGenerator_PkColumnValue(), ecorePackage.getEString(), "pkColumnValue", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEAttribute(getITableGenerator_SpecifiedPkColumnValue(), ecorePackage.getEString(), "specifiedPkColumnValue", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getITableGenerator_DefaultPkColumnValue(), ecorePackage.getEString(), "defaultPkColumnValue", null, 0, 1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getITableGenerator_UniqueConstraints(), this.getIUniqueConstraint(), null, "uniqueConstraints", null, 0, -1, ITableGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(iSequenceGeneratorEClass, ISequenceGenerator.class, "ISequenceGenerator", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getISequenceGenerator_SequenceName(), ecorePackage.getEString(), "sequenceName", null, 0, 1, ISequenceGenerator.class, !IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEAttribute(getISequenceGenerator_SpecifiedSequenceName(), ecorePackage.getEString(), "specifiedSequenceName", null, 0, 1, ISequenceGenerator.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -6936,6 +7067,32 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final EAttribute ITABLE__DEFAULT_SCHEMA = eINSTANCE.getITable_DefaultSchema();
/**
+ * The meta object literal for the '<em><b>Unique Constraints</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EReference ITABLE__UNIQUE_CONSTRAINTS = eINSTANCE.getITable_UniqueConstraints();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint <em>IUnique Constraint</em>}' class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.jpt.core.internal.mappings.IUniqueConstraint
+ * @see org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage#getIUniqueConstraint()
+ * @generated
+ */
+ public static final EClass IUNIQUE_CONSTRAINT = eINSTANCE.getIUniqueConstraint();
+
+ /**
+ * The meta object literal for the '<em><b>Column Names</b></em>' attribute list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EAttribute IUNIQUE_CONSTRAINT__COLUMN_NAMES = eINSTANCE.getIUniqueConstraint_ColumnNames();
+
+ /**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn <em>INamed Column</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -7930,6 +8087,14 @@ public class JpaCoreMappingsPackage extends EPackageImpl
public static final EAttribute ITABLE_GENERATOR__DEFAULT_PK_COLUMN_VALUE = eINSTANCE.getITableGenerator_DefaultPkColumnValue();
/**
+ * The meta object literal for the '<em><b>Unique Constraints</b></em>' containment reference list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final EReference ITABLE_GENERATOR__UNIQUE_CONSTRAINTS = eINSTANCE.getITableGenerator_UniqueConstraints();
+
+ /**
* The meta object literal for the '{@link org.eclipse.jpt.core.internal.mappings.ISequenceGenerator <em>ISequence Generator</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/mappings/util/JpaCoreMappingsAdapterFactory.java
index 073d6cf40c..f70799fa64 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
@@ -56,6 +56,7 @@ import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping;
import org.eclipse.jpt.core.internal.mappings.ITable;
import org.eclipse.jpt.core.internal.mappings.ITableGenerator;
import org.eclipse.jpt.core.internal.mappings.ITransient;
+import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint;
import org.eclipse.jpt.core.internal.mappings.IVersion;
import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
@@ -136,6 +137,11 @@ public class JpaCoreMappingsAdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseIUniqueConstraint(IUniqueConstraint object) {
+ return createIUniqueConstraintAdapter();
+ }
+
+ @Override
public Adapter caseINamedColumn(INamedColumn object) {
return createINamedColumnAdapter();
}
@@ -397,6 +403,20 @@ public class JpaCoreMappingsAdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.IUniqueConstraint <em>IUnique Constraint</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.IUniqueConstraint
+ * @generated
+ */
+ public Adapter createIUniqueConstraintAdapter() {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.jpt.core.internal.mappings.INamedColumn <em>INamed Column</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 29866ec1e4..c40346d716 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
@@ -55,6 +55,7 @@ import org.eclipse.jpt.core.internal.mappings.ISingleRelationshipMapping;
import org.eclipse.jpt.core.internal.mappings.ITable;
import org.eclipse.jpt.core.internal.mappings.ITableGenerator;
import org.eclipse.jpt.core.internal.mappings.ITransient;
+import org.eclipse.jpt.core.internal.mappings.IUniqueConstraint;
import org.eclipse.jpt.core.internal.mappings.IVersion;
import org.eclipse.jpt.core.internal.mappings.JpaCoreMappingsPackage;
@@ -180,6 +181,17 @@ public class JpaCoreMappingsSwitch<T>
result = defaultCase(theEObject);
return result;
}
+ case JpaCoreMappingsPackage.IUNIQUE_CONSTRAINT : {
+ IUniqueConstraint iUniqueConstraint = (IUniqueConstraint) theEObject;
+ T result = caseIUniqueConstraint(iUniqueConstraint);
+ if (result == null)
+ result = caseIJpaSourceObject(iUniqueConstraint);
+ if (result == null)
+ result = caseIJpaEObject(iUniqueConstraint);
+ if (result == null)
+ result = defaultCase(theEObject);
+ return result;
+ }
case JpaCoreMappingsPackage.INAMED_COLUMN : {
INamedColumn iNamedColumn = (INamedColumn) theEObject;
T result = caseINamedColumn(iNamedColumn);
@@ -725,6 +737,21 @@ public class JpaCoreMappingsSwitch<T>
}
/**
+ * Returns the result of interpretting the object as an instance of '<em>IUnique Constraint</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>IUnique Constraint</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseIUniqueConstraint(IUniqueConstraint object) {
+ return null;
+ }
+
+ /**
* Returns the result of interpretting the object as an instance of '<em>INamed Column</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;

Back to the top