Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2018-04-22 04:29:35 +0000
committerEike Stepper2018-04-22 04:29:35 +0000
commit5f582b20c8a4602fc0cc4f554e5098aa2cc7e8c9 (patch)
tree95144ddf237338d3e57a2458274016a88b19b46f /plugins
parent0b250f569edeb1ea983aa761337b7d57057ac328 (diff)
downloadcdo-5f582b20c8a4602fc0cc4f554e5098aa2cc7e8c9.tar.gz
cdo-5f582b20c8a4602fc0cc4f554e5098aa2cc7e8c9.tar.xz
cdo-5f582b20c8a4602fc0cc4f554e5098aa2cc7e8c9.zip
[533909] Unsettable features that are set to null can't be committed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=533909
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java12
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDNilImpl.java110
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java51
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java19
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore2
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/model/model2.genmodel1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/model/model2.legacy.genmodel1
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Unsettable1.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Unsettable1Impl.java42
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/Model2Package.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/impl/Model2PackageImpl.java13
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/impl/Unsettable1Impl.java114
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java31
18 files changed, 528 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java
index b41a87f441..5ce24b2bd4 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOID.java
@@ -32,10 +32,20 @@ public interface CDOID extends Comparable<CDOID>, Serializable
{
public static final CDOID NULL = org.eclipse.emf.cdo.internal.common.id.CDOIDNullImpl.INSTANCE;
+ /**
+ * @since 4.6
+ */
+ public static final CDOID NIL = org.eclipse.emf.cdo.internal.common.id.CDOIDNilImpl.INSTANCE;
+
public Type getType();
public boolean isNull();
+ /**
+ * @since 4.6
+ */
+ public boolean isNil();
+
public boolean isObject();
public boolean isTemporary();
@@ -65,7 +75,13 @@ public interface CDOID extends Comparable<CDOID>, Serializable
public enum Type
{
NULL('N'), //
- OBJECT(' '), // Superceded by ObjectType.getID()
+
+ /**
+ * @since 4.6
+ */
+ NIL('I'), //
+
+ OBJECT(' '), // Superseded by ObjectType.getID()
/**
* @since 2.0
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java
index 4263a517bc..75c1d04627 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDUtil.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.revision.CDOIDAndBranch;
import org.eclipse.emf.cdo.common.revision.CDOIDAndVersion;
+import org.eclipse.emf.cdo.common.revision.CDORevisionData;
import org.eclipse.emf.cdo.internal.common.bundle.OM;
import org.eclipse.emf.cdo.internal.common.id.CDOIDExternalImpl;
import org.eclipse.emf.cdo.internal.common.id.CDOIDObjectLongImpl;
@@ -110,6 +111,11 @@ public final class CDOIDUtil
return CDOID.NULL;
}
+ if (object == CDORevisionData.NIL)
+ {
+ return CDOID.NIL;
+ }
+
if (object instanceof CDOID)
{
return (CDOID)object;
@@ -389,6 +395,9 @@ public final class CDOIDUtil
case NULL:
return CDOID.NULL;
+ case NIL:
+ return CDOID.NIL;
+
case TEMP_OBJECT:
return CDOIDTempObjectImpl.create(Integer.valueOf(fragment));
@@ -501,6 +510,9 @@ public final class CDOIDUtil
case NULL:
return CDOID.NULL;
+ case NIL:
+ return CDOID.NIL;
+
case TEMP_OBJECT:
return CDOIDTempObjectImpl.create(in.readXInt());
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDNilImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDNilImpl.java
new file mode 100644
index 0000000000..7bf0b5b539
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/id/CDOIDNilImpl.java
@@ -0,0 +1,110 @@
+/*
+ * Copyright (c) 2018 Eike Stepper (Berlin, Germany) and others.
+ * 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:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.emf.cdo.internal.common.id;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.id.CDOIDObject;
+import org.eclipse.emf.cdo.common.id.CDOIDTemp;
+import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+import org.eclipse.emf.cdo.spi.common.id.AbstractCDOID;
+
+import java.io.IOException;
+import java.io.ObjectStreamException;
+
+/**
+ * @author Eike Stepper
+ */
+public final class CDOIDNilImpl extends AbstractCDOID implements CDOIDTemp, CDOIDObject
+{
+ private static final long serialVersionUID = 1L;
+
+ public static final CDOIDNilImpl INSTANCE = new CDOIDNilImpl();
+
+ private CDOIDNilImpl()
+ {
+ }
+
+ public int getIntValue()
+ {
+ return 0;
+ }
+
+ public long getLongValue()
+ {
+ return 0L;
+ }
+
+ @Override
+ public void write(CDODataOutput out) throws IOException
+ {
+ // Do nothing
+ }
+
+ public String toURIFragment()
+ {
+ return "NIL"; //$NON-NLS-1$
+ }
+
+ public Type getType()
+ {
+ return Type.NIL;
+ }
+
+ public boolean isExternal()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isNull()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isNil()
+ {
+ return true;
+ }
+
+ public boolean isObject()
+ {
+ return false;
+ }
+
+ public boolean isTemporary()
+ {
+ return false;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return 0;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "NULL"; //$NON-NLS-1$
+ }
+
+ @Override
+ protected int doCompareTo(CDOID o) throws ClassCastException
+ {
+ return 0; // NULL == NULL
+ }
+
+ private Object readResolve() throws ObjectStreamException
+ {
+ return INSTANCE;
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java
index b3c140ed1a..a6d150c0f8 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java
@@ -21,6 +21,9 @@ import org.eclipse.emf.cdo.spi.common.model.InternalCDOClassInfo;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.cdo.spi.common.revision.StubCDORevision;
+import org.eclipse.net4j.util.io.IOUtil;
+import org.eclipse.net4j.util.om.OMPlatform;
+
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
@@ -32,6 +35,9 @@ import org.eclipse.emf.ecore.impl.EClassImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.FeatureMapUtil;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.io.UnsupportedEncodingException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -45,6 +51,8 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
{
private static final PersistenceFilter[] NO_FILTERS = {};
+ private static final boolean DEBUG = OMPlatform.INSTANCE.isProperty("org.eclipse.emf.cdo.internal.common.model.CDOClassInfoImpl.DEBUG");
+
private final InternalCDORevision revisionWithoutID = new RevisionWithoutID(this);
private EClass eClass;
@@ -65,6 +73,9 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
private int settingsFeatureCount;
+ /**
+ * The eSettings slots of all many-valued and/or transient features.
+ */
private int[] settingsFeatureIndices;
/**
@@ -370,10 +381,48 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
return getPersistentFeatureIndex(featureID);
}
+ public String getDump()
+ {
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ try
+ {
+ dump(new PrintStream(out, true, "UTF-8"));
+ return new String(out.toByteArray(), "UTF-8");
+ }
+ catch (UnsupportedEncodingException ex)
+ {
+ ex.printStackTrace();
+ return ex.getMessage();
+ }
+ }
+
+ public void dump()
+ {
+ dump(IOUtil.OUT());
+ }
+
+ public void dump(PrintStream out)
+ {
+ out.println(eClass.getName());
+
+ out.println("\t\t\tallPersistentFeatures");
+ for (EStructuralFeature feature : getAllPersistentFeatures())
+ {
+ out.println("\t" + eClass.getFeatureID(feature) + "\t" + feature.getName() + "\t" + (feature.isTransient() ? "transient" : "persistent"));
+ }
+
+ out.println("\t\t\tsettingsFeatureIndices\tpersistentFeatureIndices\ttransientFeatureIndices");
+ for (int featureID = 0; featureID < settingsFeatureIndices.length; featureID++)
+ {
+ out.println("\t" + featureID + "\t" + eClass.getEStructuralFeature(featureID).getName() + "\t" + settingsFeatureIndices[featureID] + "\t"
+ + persistentFeatureIndices[featureID] + "\t" + transientFeatureIndices[featureID]);
+ }
+ }
+
@Override
public String toString()
{
- return eClass.toString();
+ return DEBUG ? getDump() : eClass.toString();
}
/**
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java
index b14ed0f4b6..9b217be917 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java
@@ -243,13 +243,26 @@ public abstract class CDOTypeImpl implements CDOType
}
else
{
- out.writeCDOID((CDOID)value);
+ if (value == CDORevisionData.NIL)
+ {
+ out.writeCDOID(CDOID.NIL);
+ }
+ else
+ {
+ out.writeCDOID((CDOID)value);
+ }
}
}
- public CDOID readValue(CDODataInput in) throws IOException
+ public Object readValue(CDODataInput in) throws IOException
{
- return in.readCDOID();
+ CDOID id = in.readCDOID();
+ if (id == CDOID.NIL)
+ {
+ return CDORevisionData.NIL;
+ }
+
+ return id;
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java
index 4820bbf61d..4b2dde2491 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java
@@ -14,6 +14,7 @@ package org.eclipse.emf.cdo.internal.common.revision.delta;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
+import org.eclipse.emf.cdo.common.revision.CDORevisionData;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.spi.common.revision.CDOReferenceAdjuster;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDOFeatureDelta.WithIndex;
@@ -85,7 +86,7 @@ public abstract class CDOSingleValueFeatureDeltaImpl extends CDOFeatureDeltaImpl
out.writeXInt(featureID);
}
- if (valueToWrite != null && feature instanceof EReference)
+ if (valueToWrite != null && valueToWrite != CDORevisionData.NIL && feature instanceof EReference)
{
valueToWrite = out.getIDProvider().provideCDOID(value);
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java
index 8887fec521..a17621adb5 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/id/AbstractCDOID.java
@@ -43,6 +43,14 @@ public abstract class AbstractCDOID implements CDOID
}
/**
+ * @since 4.6
+ */
+ public boolean isNil()
+ {
+ return false;
+ }
+
+ /**
* @since 4.2
*/
@Deprecated
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore
index 5fcf7ef17a..c4c87b99a5 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore
@@ -40,6 +40,8 @@
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="unsettableVAT" eType="ecore:EEnum ../../org.eclipse.emf.cdo.tests.model1/model/model1.ecore#//VAT"
unsettable="true"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="unsettableElement" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"
+ unsettable="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Unsettable2WithDefault">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="unsettableBoolean" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.genmodel b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.genmodel
index 8481c79fd0..468ffde371 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.genmodel
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.genmodel
@@ -37,6 +37,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute model2.ecore#//Unsettable1/unsettableShort"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute model2.ecore#//Unsettable1/unsettableString"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute model2.ecore#//Unsettable1/unsettableVAT"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model2.ecore#//Unsettable1/unsettableElement"/>
</genClasses>
<genClasses ecoreClass="model2.ecore#//Unsettable2WithDefault">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute model2.ecore#//Unsettable2WithDefault/unsettableBoolean"/>
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.legacy.genmodel b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.legacy.genmodel
index ffe90972c8..8db015b996 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.legacy.genmodel
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.legacy.genmodel
@@ -35,6 +35,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute model2.ecore#//Unsettable1/unsettableShort"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute model2.ecore#//Unsettable1/unsettableString"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute model2.ecore#//Unsettable1/unsettableVAT"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference model2.ecore#//Unsettable1/unsettableElement"/>
</genClasses>
<genClasses ecoreClass="model2.ecore#//Unsettable2WithDefault">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute model2.ecore#//Unsettable2WithDefault/unsettableBoolean"/>
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java
index b0cb9d2300..39e87b4d4d 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java
@@ -298,13 +298,22 @@ public interface Model2Package extends EPackage
int UNSETTABLE1__UNSETTABLE_VAT = 10;
/**
+ * The feature id for the '<em><b>Unsettable Element</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int UNSETTABLE1__UNSETTABLE_ELEMENT = 11;
+
+ /**
* The number of structural features of the '<em>Unsettable1</em>' class. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @generated
* @ordered
*/
- int UNSETTABLE1_FEATURE_COUNT = 11;
+ int UNSETTABLE1_FEATURE_COUNT = 12;
/**
* The meta object id for the '{@link org.eclipse.emf.cdo.tests.model2.impl.Unsettable2WithDefaultImpl <em>Unsettable2 With Default</em>}' class.
@@ -1372,6 +1381,17 @@ public interface Model2Package extends EPackage
EAttribute getUnsettable1_UnsettableVAT();
/**
+ * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.tests.model2.Unsettable1#getUnsettableElement <em>Unsettable Element</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Unsettable Element</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.Unsettable1#getUnsettableElement()
+ * @see #getUnsettable1()
+ * @generated
+ */
+ EReference getUnsettable1_UnsettableElement();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model2.Unsettable2WithDefault <em>Unsettable2 With Default</em>}'.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @return the meta object for class '<em>Unsettable2 With Default</em>'.
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Unsettable1.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Unsettable1.java
index 7268748c2f..381b50e4e2 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Unsettable1.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Unsettable1.java
@@ -34,6 +34,7 @@ import java.util.Date;
* <li>{@link org.eclipse.emf.cdo.tests.model2.Unsettable1#getUnsettableShort <em>Unsettable Short</em>}</li>
* <li>{@link org.eclipse.emf.cdo.tests.model2.Unsettable1#getUnsettableString <em>Unsettable String</em>}</li>
* <li>{@link org.eclipse.emf.cdo.tests.model2.Unsettable1#getUnsettableVAT <em>Unsettable VAT</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.Unsettable1#getUnsettableElement <em>Unsettable Element</em>}</li>
* </ul>
*
* @see org.eclipse.emf.cdo.tests.model2.Model2Package#getUnsettable1()
@@ -595,4 +596,57 @@ public interface Unsettable1 extends EObject
*/
boolean isSetUnsettableVAT();
+ /**
+ * Returns the value of the '<em><b>Unsettable Element</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Unsettable Element</em>' reference isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Unsettable Element</em>' reference.
+ * @see #isSetUnsettableElement()
+ * @see #unsetUnsettableElement()
+ * @see #setUnsettableElement(EObject)
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getUnsettable1_UnsettableElement()
+ * @model unsettable="true"
+ * @generated
+ */
+ EObject getUnsettableElement();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model2.Unsettable1#getUnsettableElement <em>Unsettable Element</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @param value the new value of the '<em>Unsettable Element</em>' reference.
+ * @see #isSetUnsettableElement()
+ * @see #unsetUnsettableElement()
+ * @see #getUnsettableElement()
+ * @generated
+ */
+ void setUnsettableElement(EObject value);
+
+ /**
+ * Unsets the value of the '{@link org.eclipse.emf.cdo.tests.model2.Unsettable1#getUnsettableElement <em>Unsettable Element</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isSetUnsettableElement()
+ * @see #getUnsettableElement()
+ * @see #setUnsettableElement(EObject)
+ * @generated
+ */
+ void unsetUnsettableElement();
+
+ /**
+ * Returns whether the value of the '{@link org.eclipse.emf.cdo.tests.model2.Unsettable1#getUnsettableElement <em>Unsettable Element</em>}' reference is set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return whether the value of the '<em>Unsettable Element</em>' reference is set.
+ * @see #unsetUnsettableElement()
+ * @see #getUnsettableElement()
+ * @see #setUnsettableElement(EObject)
+ * @generated
+ */
+ boolean isSetUnsettableElement();
+
} // Unsettable1
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java
index 77f3521d55..d63b0d1054 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java
@@ -416,6 +416,16 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
}
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getUnsettable1_UnsettableElement()
+ {
+ return (EReference)unsettable1EClass.getEStructuralFeatures().get(11);
+ }
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@@ -1216,6 +1226,7 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_SHORT);
createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_STRING);
createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_VAT);
+ createEReference(unsettable1EClass, UNSETTABLE1__UNSETTABLE_ELEMENT);
unsettable2WithDefaultEClass = createEClass(UNSETTABLE2_WITH_DEFAULT);
createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BOOLEAN);
@@ -1394,6 +1405,8 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getUnsettable1_UnsettableVAT(), theModel1Package.getVAT(), "unsettableVAT", null, 0, 1, Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getUnsettable1_UnsettableElement(), ecorePackage.getEObject(), null, "unsettableElement", null, 0, 1, Unsettable1.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(unsettable2WithDefaultEClass, Unsettable2WithDefault.class, "Unsettable2WithDefault", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getUnsettable2WithDefault_UnsettableBoolean(), ecorePackage.getEBoolean(), "unsettableBoolean", "true", 0, 1, Unsettable2WithDefault.class,
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Unsettable1Impl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Unsettable1Impl.java
index 5a4e65c852..f0d8944ee8 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Unsettable1Impl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Unsettable1Impl.java
@@ -17,6 +17,7 @@ import org.eclipse.emf.cdo.tests.model2.Unsettable1;
import org.eclipse.emf.internal.cdo.CDOObjectImpl;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
import java.util.Date;
@@ -37,6 +38,7 @@ import java.util.Date;
* <li>{@link org.eclipse.emf.cdo.tests.model2.impl.Unsettable1Impl#getUnsettableShort <em>Unsettable Short</em>}</li>
* <li>{@link org.eclipse.emf.cdo.tests.model2.impl.Unsettable1Impl#getUnsettableString <em>Unsettable String</em>}</li>
* <li>{@link org.eclipse.emf.cdo.tests.model2.impl.Unsettable1Impl#getUnsettableVAT <em>Unsettable VAT</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.Unsettable1Impl#getUnsettableElement <em>Unsettable Element</em>}</li>
* </ul>
*
* @generated
@@ -468,4 +470,44 @@ public class Unsettable1Impl extends CDOObjectImpl implements Unsettable1
return eIsSet(Model2Package.eINSTANCE.getUnsettable1_UnsettableVAT());
}
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject getUnsettableElement()
+ {
+ return (EObject)eGet(Model2Package.eINSTANCE.getUnsettable1_UnsettableElement(), true);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setUnsettableElement(EObject newUnsettableElement)
+ {
+ eSet(Model2Package.eINSTANCE.getUnsettable1_UnsettableElement(), newUnsettableElement);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetUnsettableElement()
+ {
+ eUnset(Model2Package.eINSTANCE.getUnsettable1_UnsettableElement());
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetUnsettableElement()
+ {
+ return eIsSet(Model2Package.eINSTANCE.getUnsettable1_UnsettableElement());
+ }
+
} // Unsettable1Impl
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/Model2Package.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/Model2Package.java
index b12fdf3f0b..89172c97a5 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/Model2Package.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/Model2Package.java
@@ -298,13 +298,22 @@ public interface Model2Package extends EPackage, org.eclipse.emf.cdo.tests.model
int UNSETTABLE1__UNSETTABLE_VAT = 10;
/**
+ * The feature id for the '<em><b>Unsettable Element</b></em>' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int UNSETTABLE1__UNSETTABLE_ELEMENT = 11;
+
+ /**
* The number of structural features of the '<em>Unsettable1</em>' class. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
* @generated
* @ordered
*/
- int UNSETTABLE1_FEATURE_COUNT = 11;
+ int UNSETTABLE1_FEATURE_COUNT = 12;
/**
* The meta object id for the '{@link org.eclipse.emf.cdo.tests.model2.legacy.impl.Unsettable2WithDefaultImpl <em>Unsettable2 With Default</em>}' class.
@@ -1392,6 +1401,17 @@ public interface Model2Package extends EPackage, org.eclipse.emf.cdo.tests.model
EAttribute getUnsettable1_UnsettableVAT();
/**
+ * Returns the meta object for the reference '{@link org.eclipse.emf.cdo.tests.model2.Unsettable1#getUnsettableElement <em>Unsettable Element</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the reference '<em>Unsettable Element</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.Unsettable1#getUnsettableElement()
+ * @see #getUnsettable1()
+ * @generated
+ */
+ EReference getUnsettable1_UnsettableElement();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model2.Unsettable2WithDefault <em>Unsettable2 With Default</em>}'.
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @return the meta object for class '<em>Unsettable2 With Default</em>'.
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/impl/Model2PackageImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/impl/Model2PackageImpl.java
index 8582c1e2ec..019d5edd94 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/impl/Model2PackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/impl/Model2PackageImpl.java
@@ -416,6 +416,16 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
}
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EReference getUnsettable1_UnsettableElement()
+ {
+ return (EReference)unsettable1EClass.getEStructuralFeatures().get(11);
+ }
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@@ -1216,6 +1226,7 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_SHORT);
createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_STRING);
createEAttribute(unsettable1EClass, UNSETTABLE1__UNSETTABLE_VAT);
+ createEReference(unsettable1EClass, UNSETTABLE1__UNSETTABLE_ELEMENT);
unsettable2WithDefaultEClass = createEClass(UNSETTABLE2_WITH_DEFAULT);
createEAttribute(unsettable2WithDefaultEClass, UNSETTABLE2_WITH_DEFAULT__UNSETTABLE_BOOLEAN);
@@ -1394,6 +1405,8 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getUnsettable1_UnsettableVAT(), theModel1Package.getVAT(), "unsettableVAT", null, 0, 1, Unsettable1.class, !IS_TRANSIENT, !IS_VOLATILE,
IS_CHANGEABLE, IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getUnsettable1_UnsettableElement(), ecorePackage.getEObject(), null, "unsettableElement", null, 0, 1, Unsettable1.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(unsettable2WithDefaultEClass, Unsettable2WithDefault.class, "Unsettable2WithDefault", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getUnsettable2WithDefault_UnsettableBoolean(), ecorePackage.getEBoolean(), "unsettableBoolean", "true", 0, 1, Unsettable2WithDefault.class,
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/impl/Unsettable1Impl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/impl/Unsettable1Impl.java
index 8b05fd968f..bed4b8bf6b 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/impl/Unsettable1Impl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/legacy/impl/Unsettable1Impl.java
@@ -16,6 +16,8 @@ import org.eclipse.emf.cdo.tests.model2.legacy.Model2Package;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
@@ -38,6 +40,7 @@ import java.util.Date;
* <li>{@link org.eclipse.emf.cdo.tests.model2.legacy.impl.Unsettable1Impl#getUnsettableShort <em>Unsettable Short</em>}</li>
* <li>{@link org.eclipse.emf.cdo.tests.model2.legacy.impl.Unsettable1Impl#getUnsettableString <em>Unsettable String</em>}</li>
* <li>{@link org.eclipse.emf.cdo.tests.model2.legacy.impl.Unsettable1Impl#getUnsettableVAT <em>Unsettable VAT</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.legacy.impl.Unsettable1Impl#getUnsettableElement <em>Unsettable Element</em>}</li>
* </ul>
*
* @generated
@@ -353,6 +356,25 @@ public class Unsettable1Impl extends EObjectImpl implements Unsettable1
protected boolean unsettableVATESet;
/**
+ * The cached value of the '{@link #getUnsettableElement() <em>Unsettable Element</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUnsettableElement()
+ * @generated
+ * @ordered
+ */
+ protected EObject unsettableElement;
+
+ /**
+ * This is true if the Unsettable Element reference has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean unsettableElementESet;
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@@ -942,6 +964,84 @@ public class Unsettable1Impl extends EObjectImpl implements Unsettable1
}
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject getUnsettableElement()
+ {
+ if (unsettableElement != null && unsettableElement.eIsProxy())
+ {
+ InternalEObject oldUnsettableElement = (InternalEObject)unsettableElement;
+ unsettableElement = eResolveProxy(oldUnsettableElement);
+ if (unsettableElement != oldUnsettableElement)
+ {
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, Model2Package.UNSETTABLE1__UNSETTABLE_ELEMENT, oldUnsettableElement, unsettableElement));
+ }
+ }
+ }
+ return unsettableElement;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject basicGetUnsettableElement()
+ {
+ return unsettableElement;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setUnsettableElement(EObject newUnsettableElement)
+ {
+ EObject oldUnsettableElement = unsettableElement;
+ unsettableElement = newUnsettableElement;
+ boolean oldUnsettableElementESet = unsettableElementESet;
+ unsettableElementESet = true;
+ if (eNotificationRequired())
+ {
+ eNotify(new ENotificationImpl(this, Notification.SET, Model2Package.UNSETTABLE1__UNSETTABLE_ELEMENT, oldUnsettableElement, unsettableElement,
+ !oldUnsettableElementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetUnsettableElement()
+ {
+ EObject oldUnsettableElement = unsettableElement;
+ boolean oldUnsettableElementESet = unsettableElementESet;
+ unsettableElement = null;
+ unsettableElementESet = false;
+ if (eNotificationRequired())
+ {
+ eNotify(
+ new ENotificationImpl(this, Notification.UNSET, Model2Package.UNSETTABLE1__UNSETTABLE_ELEMENT, oldUnsettableElement, null, oldUnsettableElementESet));
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetUnsettableElement()
+ {
+ return unsettableElementESet;
+ }
+
+ /**
* <!-- begin-user-doc --> <!-- end-user-doc -->
* @generated
*/
@@ -972,6 +1072,12 @@ public class Unsettable1Impl extends EObjectImpl implements Unsettable1
return getUnsettableString();
case Model2Package.UNSETTABLE1__UNSETTABLE_VAT:
return getUnsettableVAT();
+ case Model2Package.UNSETTABLE1__UNSETTABLE_ELEMENT:
+ if (resolve)
+ {
+ return getUnsettableElement();
+ }
+ return basicGetUnsettableElement();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -1018,6 +1124,9 @@ public class Unsettable1Impl extends EObjectImpl implements Unsettable1
case Model2Package.UNSETTABLE1__UNSETTABLE_VAT:
setUnsettableVAT((VAT)newValue);
return;
+ case Model2Package.UNSETTABLE1__UNSETTABLE_ELEMENT:
+ setUnsettableElement((EObject)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -1064,6 +1173,9 @@ public class Unsettable1Impl extends EObjectImpl implements Unsettable1
case Model2Package.UNSETTABLE1__UNSETTABLE_VAT:
unsetUnsettableVAT();
return;
+ case Model2Package.UNSETTABLE1__UNSETTABLE_ELEMENT:
+ unsetUnsettableElement();
+ return;
}
super.eUnset(featureID);
}
@@ -1099,6 +1211,8 @@ public class Unsettable1Impl extends EObjectImpl implements Unsettable1
return isSetUnsettableString();
case Model2Package.UNSETTABLE1__UNSETTABLE_VAT:
return isSetUnsettableVAT();
+ case Model2Package.UNSETTABLE1__UNSETTABLE_ELEMENT:
+ return isSetUnsettableElement();
}
return super.eIsSet(featureID);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java
index 9193659106..2d693fa34b 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/UnsetTest.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.tests;
import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.tests.model1.Company;
import org.eclipse.emf.cdo.tests.model1.Supplier;
import org.eclipse.emf.cdo.tests.model1.VAT;
import org.eclipse.emf.cdo.tests.model2.Unsettable1;
@@ -510,6 +511,36 @@ public class UnsetTest extends AbstractCDOTest
}
}
+ public void testUnsettableObject() throws Exception
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource(getResourcePath("/test1"));
+
+ Unsettable1 unsettable = getModel2Factory().createUnsettable1();
+ resource.getContents().add(unsettable);
+ assertEquals(false, unsettable.isSetUnsettableElement());
+ transaction.commit();
+ assertEquals(false, unsettable.isSetUnsettableElement());
+
+ unsettable.setUnsettableElement(null);
+ assertEquals(true, unsettable.isSetUnsettableElement());
+ transaction.commit();
+ assertEquals(true, unsettable.isSetUnsettableElement());
+
+ unsettable.unsetUnsettableElement();
+ assertEquals(false, unsettable.isSetUnsettableElement());
+ transaction.commit();
+ assertEquals(false, unsettable.isSetUnsettableElement());
+
+ Company company = getModel1Factory().createCompany();
+ unsettable.eResource().getContents().add(company);
+ unsettable.setUnsettableElement(company);
+ assertEquals(true, unsettable.isSetUnsettableElement());
+ transaction.commit();
+ assertEquals(true, unsettable.isSetUnsettableElement());
+ }
+
@Override
protected void doTearDown() throws Exception
{

Back to the top