Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-10-18 07:42:11 -0400
committerEike Stepper2008-10-18 07:42:11 -0400
commit02d23a532418c1f187fc2970caec46c7dc5aeaa1 (patch)
treea2658ba33ff49737907e6b81a7dab22c9f023193
parentcff7f4d572f5f0eb02f0753897efb68fb274b6f3 (diff)
downloadcdo-02d23a532418c1f187fc2970caec46c7dc5aeaa1.tar.gz
cdo-02d23a532418c1f187fc2970caec46c7dc5aeaa1.tar.xz
cdo-02d23a532418c1f187fc2970caec46c7dc5aeaa1.zip
[249847] Store resources in a hierarchical structure
https://bugs.eclipse.org/bugs/show_bug.cgi?id=249847
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore10
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Factory.java18
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Package.java190
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Task.java110
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/TaskContainer.java45
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2FactoryImpl.java30
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2PackageImpl.java101
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TaskContainerImpl.java74
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TaskImpl.java124
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2AdapterFactory.java44
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2Switch.java54
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java22
15 files changed, 841 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
index d77d6f0a74..2218928102 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreWriter.java
@@ -21,7 +21,6 @@ import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.server.IView;
import org.eclipse.emf.cdo.server.db.IClassMapping;
import org.eclipse.emf.cdo.server.db.IDBStoreWriter;
-import org.eclipse.emf.cdo.server.db.IMappingStrategy;
import org.eclipse.emf.cdo.server.internal.db.bundle.OM;
import org.eclipse.emf.cdo.spi.common.InternalCDOClass;
import org.eclipse.emf.cdo.spi.common.InternalCDOFeature;
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
index 723c2aed3f..9ada759e7f 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/HorizontalMappingStrategy.java
@@ -175,7 +175,6 @@ public class HorizontalMappingStrategy extends MappingStrategy
CDOResourceNodeClass resourceNodeClass = resourcePackage.getCDOResourceNodeClass();
IDBTable table = classMapping.getTable();
- IDBField folderField = classMapping.getAttributeMapping(resourceNodeClass.getCDOFolderFeature()).getField();
IDBField nameField = classMapping.getAttributeMapping(resourceNodeClass.getCDONameFeature()).getField();
StringBuilder builder = new StringBuilder();
@@ -184,7 +183,7 @@ public class HorizontalMappingStrategy extends MappingStrategy
builder.append(" FROM ");
builder.append(table);
builder.append(" WHERE ");
- builder.append(folderField);
+ builder.append(CDODBSchema.ATTRIBUTES_CONTAINER);
builder.append("=");
builder.append(CDOIDUtil.getLong(folderID));
builder.append(" AND ");
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 21a24d73b6..2a06d80ad0 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/model/model2.ecore
@@ -8,4 +8,14 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="shippingAddress" eType="ecore:EClass ../../org.eclipse.emf.cdo.tests.model1/model/model1.ecore#//Address"
containment="true"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="TaskContainer">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="tasks" upperBound="-1"
+ eType="#//Task" containment="true" eOpposite="#//Task/taskContainer"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Task">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="taskContainer" eType="#//TaskContainer"
+ eOpposite="#//TaskContainer/tasks"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="done" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Factory.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Factory.java
index 685ce013b7..7032f1bcb8 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Factory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Model2Factory.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: Model2Factory.java,v 1.3 2008-09-18 12:56:55 estepper Exp $
+ * $Id: Model2Factory.java,v 1.3.2.1 2008-10-18 11:42:09 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.model2;
@@ -33,6 +33,22 @@ public interface Model2Factory extends EFactory
SpecialPurchaseOrder createSpecialPurchaseOrder();
/**
+ * Returns a new object of class '<em>Task Container</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Task Container</em>'.
+ * @generated
+ */
+ TaskContainer createTaskContainer();
+
+ /**
+ * Returns a new object of class '<em>Task</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return a new object of class '<em>Task</em>'.
+ * @generated
+ */
+ Task createTask();
+
+ /**
* Returns the package supported by this factory. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the package supported by this factory.
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 a63dc573ed..d7f076c291 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
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: Model2Package.java,v 1.5 2008-09-18 12:56:55 estepper Exp $
+ * $Id: Model2Package.java,v 1.5.2.1 2008-10-18 11:42:09 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.model2;
@@ -119,6 +119,77 @@ public interface Model2Package extends EPackage
int SPECIAL_PURCHASE_ORDER_FEATURE_COUNT = Model1Package.PURCHASE_ORDER_FEATURE_COUNT + 2;
/**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model2.impl.TaskContainerImpl <em>Task Container</em>}
+ * ' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model2.impl.TaskContainerImpl
+ * @see org.eclipse.emf.cdo.tests.model2.impl.Model2PackageImpl#getTaskContainer()
+ * @generated
+ */
+ int TASK_CONTAINER = 1;
+
+ /**
+ * The feature id for the '<em><b>Tasks</b></em>' containment reference list. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int TASK_CONTAINER__TASKS = 0;
+
+ /**
+ * The number of structural features of the '<em>Task Container</em>' class. <!-- begin-user-doc --> <!-- end-user-doc
+ * -->
+ *
+ * @generated
+ * @ordered
+ */
+ int TASK_CONTAINER_FEATURE_COUNT = 1;
+
+ /**
+ * The meta object id for the '{@link org.eclipse.emf.cdo.tests.model2.impl.TaskImpl <em>Task</em>}' class. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model2.impl.TaskImpl
+ * @see org.eclipse.emf.cdo.tests.model2.impl.Model2PackageImpl#getTask()
+ * @generated
+ */
+ int TASK = 2;
+
+ /**
+ * The feature id for the '<em><b>Task Container</b></em>' container reference. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int TASK__TASK_CONTAINER = 0;
+
+ /**
+ * The feature id for the '<em><b>Description</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int TASK__DESCRIPTION = 1;
+
+ /**
+ * The feature id for the '<em><b>Done</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int TASK__DONE = 2;
+
+ /**
+ * The number of structural features of the '<em>Task</em>' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int TASK_FEATURE_COUNT = 3;
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder
* <em>Special Purchase Order</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -153,6 +224,71 @@ public interface Model2Package extends EPackage
EReference getSpecialPurchaseOrder_ShippingAddress();
/**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model2.TaskContainer <em>Task Container</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Task Container</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.TaskContainer
+ * @generated
+ */
+ EClass getTaskContainer();
+
+ /**
+ * Returns the meta object for the containment reference list '
+ * {@link org.eclipse.emf.cdo.tests.model2.TaskContainer#getTasks <em>Tasks</em>}'. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return the meta object for the containment reference list '<em>Tasks</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.TaskContainer#getTasks()
+ * @see #getTaskContainer()
+ * @generated
+ */
+ EReference getTaskContainer_Tasks();
+
+ /**
+ * Returns the meta object for class '{@link org.eclipse.emf.cdo.tests.model2.Task <em>Task</em>}'. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for class '<em>Task</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.Task
+ * @generated
+ */
+ EClass getTask();
+
+ /**
+ * Returns the meta object for the container reference '{@link org.eclipse.emf.cdo.tests.model2.Task#getTaskContainer
+ * <em>Task Container</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the container reference '<em>Task Container</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.Task#getTaskContainer()
+ * @see #getTask()
+ * @generated
+ */
+ EReference getTask_TaskContainer();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.tests.model2.Task#getDescription
+ * <em>Description</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Description</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.Task#getDescription()
+ * @see #getTask()
+ * @generated
+ */
+ EAttribute getTask_Description();
+
+ /**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.tests.model2.Task#isDone <em>Done</em>}'.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Done</em>'.
+ * @see org.eclipse.emf.cdo.tests.model2.Task#isDone()
+ * @see #getTask()
+ * @generated
+ */
+ EAttribute getTask_Done();
+
+ /**
* Returns the factory that creates the instances of the model. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the factory that creates the instances of the model.
@@ -200,6 +336,58 @@ public interface Model2Package extends EPackage
*/
EReference SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS = eINSTANCE.getSpecialPurchaseOrder_ShippingAddress();
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model2.impl.TaskContainerImpl
+ * <em>Task Container</em>}' class. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model2.impl.TaskContainerImpl
+ * @see org.eclipse.emf.cdo.tests.model2.impl.Model2PackageImpl#getTaskContainer()
+ * @generated
+ */
+ EClass TASK_CONTAINER = eINSTANCE.getTaskContainer();
+
+ /**
+ * The meta object literal for the '<em><b>Tasks</b></em>' containment reference list feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EReference TASK_CONTAINER__TASKS = eINSTANCE.getTaskContainer_Tasks();
+
+ /**
+ * The meta object literal for the '{@link org.eclipse.emf.cdo.tests.model2.impl.TaskImpl <em>Task</em>}' class.
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see org.eclipse.emf.cdo.tests.model2.impl.TaskImpl
+ * @see org.eclipse.emf.cdo.tests.model2.impl.Model2PackageImpl#getTask()
+ * @generated
+ */
+ EClass TASK = eINSTANCE.getTask();
+
+ /**
+ * The meta object literal for the '<em><b>Task Container</b></em>' container reference feature. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ EReference TASK__TASK_CONTAINER = eINSTANCE.getTask_TaskContainer();
+
+ /**
+ * The meta object literal for the '<em><b>Description</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute TASK__DESCRIPTION = eINSTANCE.getTask_Description();
+
+ /**
+ * The meta object literal for the '<em><b>Done</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute TASK__DONE = eINSTANCE.getTask_Done();
+
}
} // Model2Package
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Task.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Task.java
new file mode 100644
index 0000000000..e4a357b466
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/Task.java
@@ -0,0 +1,110 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: Task.java,v 1.1.2.1 2008-10-18 11:42:09 estepper Exp $
+ */
+package org.eclipse.emf.cdo.tests.model2;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>Task</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.Task#getTaskContainer <em>Task Container</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.Task#getDescription <em>Description</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.Task#isDone <em>Done</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getTask()
+ * @model
+ * @generated
+ */
+public interface Task extends EObject
+{
+ /**
+ * Returns the value of the '<em><b>Task Container</b></em>' container reference. It is bidirectional and its opposite
+ * is '{@link org.eclipse.emf.cdo.tests.model2.TaskContainer#getTasks <em>Tasks</em>}'. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Task Container</em>' container reference isn't clear, there really should be more of a
+ * description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Task Container</em>' container reference.
+ * @see #setTaskContainer(TaskContainer)
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getTask_TaskContainer()
+ * @see org.eclipse.emf.cdo.tests.model2.TaskContainer#getTasks
+ * @model opposite="tasks" transient="false"
+ * @generated
+ */
+ TaskContainer getTaskContainer();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model2.Task#getTaskContainer <em>Task Container</em>}'
+ * container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Task Container</em>' container reference.
+ * @see #getTaskContainer()
+ * @generated
+ */
+ void setTaskContainer(TaskContainer value);
+
+ /**
+ * Returns the value of the '<em><b>Description</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Description</em>' attribute isn't clear, there really should be more of a description
+ * here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Description</em>' attribute.
+ * @see #setDescription(String)
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getTask_Description()
+ * @model
+ * @generated
+ */
+ String getDescription();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model2.Task#getDescription <em>Description</em>}'
+ * attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Description</em>' attribute.
+ * @see #getDescription()
+ * @generated
+ */
+ void setDescription(String value);
+
+ /**
+ * Returns the value of the '<em><b>Done</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Done</em>' attribute isn't clear, there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Done</em>' attribute.
+ * @see #setDone(boolean)
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getTask_Done()
+ * @model
+ * @generated
+ */
+ boolean isDone();
+
+ /**
+ * Sets the value of the '{@link org.eclipse.emf.cdo.tests.model2.Task#isDone <em>Done</em>}' attribute. <!--
+ * begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @param value
+ * the new value of the '<em>Done</em>' attribute.
+ * @see #isDone()
+ * @generated
+ */
+ void setDone(boolean value);
+
+} // Task
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/TaskContainer.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/TaskContainer.java
new file mode 100644
index 0000000000..009c0b3319
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/TaskContainer.java
@@ -0,0 +1,45 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: TaskContainer.java,v 1.1.2.1 2008-10-18 11:42:09 estepper Exp $
+ */
+package org.eclipse.emf.cdo.tests.model2;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc --> A representation of the model object '<em><b>Task Container</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are supported:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.TaskContainer#getTasks <em>Tasks</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getTaskContainer()
+ * @model
+ * @generated
+ */
+public interface TaskContainer extends EObject
+{
+ /**
+ * Returns the value of the '<em><b>Tasks</b></em>' containment reference list. The list contents are of type
+ * {@link org.eclipse.emf.cdo.tests.model2.Task}. It is bidirectional and its opposite is '
+ * {@link org.eclipse.emf.cdo.tests.model2.Task#getTaskContainer <em>Task Container</em>}'. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Tasks</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>Tasks</em>' containment reference list.
+ * @see org.eclipse.emf.cdo.tests.model2.Model2Package#getTaskContainer_Tasks()
+ * @see org.eclipse.emf.cdo.tests.model2.Task#getTaskContainer
+ * @model opposite="taskContainer" containment="true"
+ * @generated
+ */
+ EList<Task> getTasks();
+
+} // TaskContainer
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2FactoryImpl.java
index c54424975f..a116f5d219 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2FactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/Model2FactoryImpl.java
@@ -2,13 +2,15 @@
* <copyright>
* </copyright>
*
- * $Id: Model2FactoryImpl.java,v 1.4 2008-09-18 12:56:55 estepper Exp $
+ * $Id: Model2FactoryImpl.java,v 1.4.2.1 2008-10-18 11:42:09 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.model2.impl;
import org.eclipse.emf.cdo.tests.model2.Model2Factory;
import org.eclipse.emf.cdo.tests.model2.Model2Package;
import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder;
+import org.eclipse.emf.cdo.tests.model2.Task;
+import org.eclipse.emf.cdo.tests.model2.TaskContainer;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
@@ -68,6 +70,10 @@ public class Model2FactoryImpl extends EFactoryImpl implements Model2Factory
{
case Model2Package.SPECIAL_PURCHASE_ORDER:
return createSpecialPurchaseOrder();
+ case Model2Package.TASK_CONTAINER:
+ return createTaskContainer();
+ case Model2Package.TASK:
+ return createTask();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -89,6 +95,28 @@ public class Model2FactoryImpl extends EFactoryImpl implements Model2Factory
*
* @generated
*/
+ public TaskContainer createTaskContainer()
+ {
+ TaskContainerImpl taskContainer = new TaskContainerImpl();
+ return taskContainer;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public Task createTask()
+ {
+ TaskImpl task = new TaskImpl();
+ return task;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public Model2Package getModel2Package()
{
return (Model2Package)getEPackage();
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 e416a5b275..14f55c3564 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
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: Model2PackageImpl.java,v 1.6 2008-09-18 12:56:55 estepper Exp $
+ * $Id: Model2PackageImpl.java,v 1.6.2.1 2008-10-18 11:42:09 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.model2.impl;
@@ -10,6 +10,8 @@ import org.eclipse.emf.cdo.tests.model1.Model1Package;
import org.eclipse.emf.cdo.tests.model2.Model2Factory;
import org.eclipse.emf.cdo.tests.model2.Model2Package;
import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder;
+import org.eclipse.emf.cdo.tests.model2.Task;
+import org.eclipse.emf.cdo.tests.model2.TaskContainer;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
@@ -32,6 +34,20 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
private EClass specialPurchaseOrderEClass = null;
/**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EClass taskContainerEClass = null;
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EClass taskEClass = 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.
* <p>
@@ -138,6 +154,66 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
*
* @generated
*/
+ public EClass getTaskContainer()
+ {
+ return taskContainerEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EReference getTaskContainer_Tasks()
+ {
+ return (EReference)taskContainerEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EClass getTask()
+ {
+ return taskEClass;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EReference getTask_TaskContainer()
+ {
+ return (EReference)taskEClass.getEStructuralFeatures().get(0);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EAttribute getTask_Description()
+ {
+ return (EAttribute)taskEClass.getEStructuralFeatures().get(1);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public EAttribute getTask_Done()
+ {
+ return (EAttribute)taskEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public Model2Factory getModel2Factory()
{
return (Model2Factory)getEFactoryInstance();
@@ -168,6 +244,14 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
specialPurchaseOrderEClass = createEClass(SPECIAL_PURCHASE_ORDER);
createEAttribute(specialPurchaseOrderEClass, SPECIAL_PURCHASE_ORDER__DISCOUNT_CODE);
createEReference(specialPurchaseOrderEClass, SPECIAL_PURCHASE_ORDER__SHIPPING_ADDRESS);
+
+ taskContainerEClass = createEClass(TASK_CONTAINER);
+ createEReference(taskContainerEClass, TASK_CONTAINER__TASKS);
+
+ taskEClass = createEClass(TASK);
+ createEReference(taskEClass, TASK__TASK_CONTAINER);
+ createEAttribute(taskEClass, TASK__DESCRIPTION);
+ createEAttribute(taskEClass, TASK__DONE);
}
/**
@@ -216,6 +300,21 @@ public class Model2PackageImpl extends EPackageImpl implements Model2Package
null, 0, 1, SpecialPurchaseOrder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(taskContainerEClass, TaskContainer.class, "TaskContainer", !IS_ABSTRACT, !IS_INTERFACE,
+ IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getTaskContainer_Tasks(), getTask(), getTask_TaskContainer(), "tasks", null, 0, -1,
+ TaskContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
+ !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
+ initEClass(taskEClass, Task.class, "Task", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEReference(getTask_TaskContainer(), getTaskContainer(), getTaskContainer_Tasks(), "taskContainer", null, 0, 1,
+ Task.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
+ IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getTask_Description(), ecorePackage.getEString(), "description", null, 0, 1, Task.class,
+ !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getTask_Done(), ecorePackage.getEBoolean(), "done", null, 0, 1, Task.class, !IS_TRANSIENT,
+ !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+
// Create resource
createResource(eNS_URI);
}
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TaskContainerImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TaskContainerImpl.java
new file mode 100644
index 0000000000..72b55410b2
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TaskContainerImpl.java
@@ -0,0 +1,74 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: TaskContainerImpl.java,v 1.1.2.1 2008-10-18 11:42:09 estepper Exp $
+ */
+package org.eclipse.emf.cdo.tests.model2.impl;
+
+import org.eclipse.emf.cdo.tests.model2.Model2Package;
+import org.eclipse.emf.cdo.tests.model2.Task;
+import org.eclipse.emf.cdo.tests.model2.TaskContainer;
+
+import org.eclipse.emf.internal.cdo.CDOObjectImpl;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Task Container</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.TaskContainerImpl#getTasks <em>Tasks</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class TaskContainerImpl extends CDOObjectImpl implements TaskContainer
+{
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TaskContainerImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return Model2Package.Literals.TASK_CONTAINER;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @SuppressWarnings("unchecked")
+ public EList<Task> getTasks()
+ {
+ return (EList<Task>)eGet(Model2Package.Literals.TASK_CONTAINER__TASKS, true);
+ }
+
+} // TaskContainerImpl
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TaskImpl.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TaskImpl.java
new file mode 100644
index 0000000000..61437f8670
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/impl/TaskImpl.java
@@ -0,0 +1,124 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: TaskImpl.java,v 1.1.2.1 2008-10-18 11:42:09 estepper Exp $
+ */
+package org.eclipse.emf.cdo.tests.model2.impl;
+
+import org.eclipse.emf.cdo.tests.model2.Model2Package;
+import org.eclipse.emf.cdo.tests.model2.Task;
+import org.eclipse.emf.cdo.tests.model2.TaskContainer;
+
+import org.eclipse.emf.internal.cdo.CDOObjectImpl;
+
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ * <!-- begin-user-doc --> An implementation of the model object '<em><b>Task</b></em>'. <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.TaskImpl#getTaskContainer <em>Task Container</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.TaskImpl#getDescription <em>Description</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.tests.model2.impl.TaskImpl#isDone <em>Done</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class TaskImpl extends CDOObjectImpl implements Task
+{
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ protected TaskImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass()
+ {
+ return Model2Package.Literals.TASK;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ @Override
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public TaskContainer getTaskContainer()
+ {
+ return (TaskContainer)eGet(Model2Package.Literals.TASK__TASK_CONTAINER, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setTaskContainer(TaskContainer newTaskContainer)
+ {
+ eSet(Model2Package.Literals.TASK__TASK_CONTAINER, newTaskContainer);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public String getDescription()
+ {
+ return (String)eGet(Model2Package.Literals.TASK__DESCRIPTION, true);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDescription(String newDescription)
+ {
+ eSet(Model2Package.Literals.TASK__DESCRIPTION, newDescription);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public boolean isDone()
+ {
+ return ((Boolean)eGet(Model2Package.Literals.TASK__DONE, true)).booleanValue();
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ public void setDone(boolean newDone)
+ {
+ eSet(Model2Package.Literals.TASK__DONE, new Boolean(newDone));
+ }
+
+} // TaskImpl
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2AdapterFactory.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2AdapterFactory.java
index 56418eac30..aa1a790065 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2AdapterFactory.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2AdapterFactory.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: Model2AdapterFactory.java,v 1.4 2008-09-18 12:56:55 estepper Exp $
+ * $Id: Model2AdapterFactory.java,v 1.4.2.1 2008-10-18 11:42:09 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.model2.util;
@@ -10,6 +10,8 @@ import org.eclipse.emf.cdo.tests.model1.Order;
import org.eclipse.emf.cdo.tests.model1.PurchaseOrder;
import org.eclipse.emf.cdo.tests.model2.Model2Package;
import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder;
+import org.eclipse.emf.cdo.tests.model2.Task;
+import org.eclipse.emf.cdo.tests.model2.TaskContainer;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
@@ -81,6 +83,18 @@ public class Model2AdapterFactory extends AdapterFactoryImpl
}
@Override
+ public Adapter caseTaskContainer(TaskContainer object)
+ {
+ return createTaskContainerAdapter();
+ }
+
+ @Override
+ public Adapter caseTask(Task object)
+ {
+ return createTaskAdapter();
+ }
+
+ @Override
public Adapter caseOrder(Order object)
{
return createOrderAdapter();
@@ -129,6 +143,34 @@ public class Model2AdapterFactory extends AdapterFactoryImpl
}
/**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model2.TaskContainer
+ * <em>Task Container</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.emf.cdo.tests.model2.TaskContainer
+ * @generated
+ */
+ public Adapter createTaskContainerAdapter()
+ {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model2.Task <em>Task</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.emf.cdo.tests.model2.Task
+ * @generated
+ */
+ public Adapter createTaskAdapter()
+ {
+ return null;
+ }
+
+ /**
* Creates a new adapter for an object of class '{@link org.eclipse.emf.cdo.tests.model1.Order <em>Order</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 -->
diff --git a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2Switch.java b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2Switch.java
index e77c713041..058afdefdb 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2Switch.java
+++ b/plugins/org.eclipse.emf.cdo.tests.model2/src/org/eclipse/emf/cdo/tests/model2/util/Model2Switch.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: Model2Switch.java,v 1.5 2008-09-18 12:56:55 estepper Exp $
+ * $Id: Model2Switch.java,v 1.5.2.1 2008-10-18 11:42:09 estepper Exp $
*/
package org.eclipse.emf.cdo.tests.model2.util;
@@ -10,6 +10,8 @@ import org.eclipse.emf.cdo.tests.model1.Order;
import org.eclipse.emf.cdo.tests.model1.PurchaseOrder;
import org.eclipse.emf.cdo.tests.model2.Model2Package;
import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder;
+import org.eclipse.emf.cdo.tests.model2.Task;
+import org.eclipse.emf.cdo.tests.model2.TaskContainer;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
@@ -108,6 +110,26 @@ public class Model2Switch<T>
}
return result;
}
+ case Model2Package.TASK_CONTAINER:
+ {
+ TaskContainer taskContainer = (TaskContainer)theEObject;
+ T result = caseTaskContainer(taskContainer);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
+ case Model2Package.TASK:
+ {
+ Task task = (Task)theEObject;
+ T result = caseTask(task);
+ if (result == null)
+ {
+ result = defaultCase(theEObject);
+ }
+ return result;
+ }
default:
return defaultCase(theEObject);
}
@@ -130,6 +152,36 @@ public class Model2Switch<T>
}
/**
+ * Returns the result of interpreting the object as an instance of '<em>Task Container</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 interpreting the object as an instance of '<em>Task Container</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseTaskContainer(TaskContainer object)
+ {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of '<em>Task</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 interpreting the object as an instance of '<em>Task</em>'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseTask(Task object)
+ {
+ return null;
+ }
+
+ /**
* Returns the result of interpreting the object as an instance of '<em>Order</em>'. <!-- begin-user-doc --> This
* implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
*
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
index fa022f83bb..ba29a70ff6 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ContainmentTest.java
@@ -19,6 +19,8 @@ import org.eclipse.emf.cdo.tests.model1.Company;
import org.eclipse.emf.cdo.tests.model1.Order;
import org.eclipse.emf.cdo.tests.model1.Supplier;
import org.eclipse.emf.cdo.tests.model2.SpecialPurchaseOrder;
+import org.eclipse.emf.cdo.tests.model2.Task;
+import org.eclipse.emf.cdo.tests.model2.TaskContainer;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
@@ -423,6 +425,28 @@ public class ContainmentTest extends AbstractCDOTest
assertEquals(container, contained.eContainer());
}
+ public void testModeledBackPointer() throws Exception
+ {
+ Task task = getModel2Factory().createTask();
+ task.setDescription("Task 1");
+
+ TaskContainer taskContainer = getModel2Factory().createTaskContainer();
+ taskContainer.getTasks().add(task);
+ assertEquals(taskContainer, task.eContainer());
+ assertEquals(taskContainer, task.getTaskContainer());
+
+ CDOSession session = openModel2Session();
+ CDOTransaction transaction = session.openTransaction();
+ CDOResource resource = transaction.createResource("/resource1");
+ resource.getContents().add(taskContainer);
+
+ transaction.commit();
+ assertEquals(taskContainer, task.eContainer());
+ assertEquals(taskContainer, task.getTaskContainer());
+ session.close();
+ }
+
+ // TODO Revisit me
// Do not support legacy system
public void _testBug246540() throws Exception
{
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java
index 841ad9aff4..cf72a8333b 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/ResourceTest.java
@@ -375,6 +375,28 @@ public class ResourceTest extends AbstractCDOTest
session.close();
}
+ public void testCommitMultipleResources()
+ {
+ {
+ CDOSession session = openSession();
+ CDOTransaction transaction = session.openTransaction();
+ transaction.createResource("/level1/level2-A/level3");
+ transaction.createResource("/level1/level2-B/level3");
+ transaction.commit();
+ session.close();
+ }
+
+ // ((CDORevisionResolverImpl)getRepository().getRevisionManager()).clearCache();
+ //
+ // CDOSession session = openSession();
+ // CDOTransaction transaction = session.openTransaction();
+ // CDOResource resource1 = transaction.getResource("/level1/level2-A/level3");
+ // CDOResource resource2 = transaction.getResource("/level1/level2-B/level3");
+ // assertEquals("/level1/level2-A/level3", resource1.getPath());
+ // assertEquals("/level1/level2-B/level3", resource2.getPath());
+ // session.close();
+ }
+
public void testDuplicatePath() throws Exception
{
CDOSession session = openModel1Session();

Back to the top