tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwilli...@apache.org
Subject svn commit: r376322 [1/5] - in /incubator/tuscany/java/das/rdb/src: main/java/org/apache/tuscany/das/rdb/ main/java/org/apache/tuscany/das/rdb/generator/impl/ main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ main/java/org/apache/tuscany/das/rdb/...
Date Thu, 09 Feb 2006 15:33:01 GMT
Author: kwilliams
Date: Thu Feb  9 07:32:58 2006
New Revision: 376322

URL: http://svn.apache.org/viewcvs?rev=376322&view=rev
Log:
Applying Brent's patch: "to move the DAS runtime and acceptance tests to SDO2"

Added:
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DatagraphRoot.java   (with props)
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DatagraphRootImpl.java   (with props)
    incubator/tuscany/java/das/rdb/src/test/resources/basicStaticCustomer.xml   (with props)
Removed:
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyPackage.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DocumentRoot.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DocumentRootImpl.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/CustomerPackage.java
Modified:
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java
    incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/RecursiveTests.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/SerializationTests.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/TopDown.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/commands/ReadCustomersStaticTypesCommand.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyFactory.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/CompanyType.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/DepartmentType.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/EmployeeType.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyFactoryImpl.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyPackageImpl.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/CompanyTypeImpl.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/DepartmentTypeImpl.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/company/impl/EmployeeTypeImpl.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/AnOrder.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/Customer.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/CustomerFactory.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/DataGraphRoot.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/AnOrderImpl.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerFactoryImpl.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerImpl.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/CustomerPackageImpl.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/customer/impl/DataGraphRootImpl.java
    incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/typed/SimplestStaticCrud.java
    incubator/tuscany/java/das/rdb/src/test/resources/company.genmodel
    incubator/tuscany/java/das/rdb/src/test/resources/company.xsd
    incubator/tuscany/java/das/rdb/src/test/resources/customer.genmodel
    incubator/tuscany/java/das/rdb/src/test/resources/customer.xsd

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/ResultSetShape.java Thu Feb  9 07:32:58 2006
@@ -107,7 +107,10 @@
 			result.append('\t');
 			result.append(tables[i]);
 			result.append('\t');
-			result.append(types[i].getName());
+			if ( types[i] == null ) 
+				result.append("null");
+			else 
+				result.append(types[i].getName());
 			result.append('\t');
 			result.append(converters[i]);
 			result.append('\n');

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/SDODataTypes.java Thu Feb  9 07:32:58 2006
@@ -16,10 +16,8 @@
  */
 package org.apache.tuscany.das.rdb;
 
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.sdo.util.SDOUtil;
-
 import commonj.sdo.Type;
+import commonj.sdo.helper.TypeHelper;
 
 /**
  * Defines SDO data types. This is used primalirly to type stored procedure OUT parameters.
@@ -30,39 +28,41 @@
  * 
  */public class SDODataTypes {
 
-	final public static Type BOOLEAN = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEBoolean());
-	final public static Type BYTE = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEByte());
-	final public static Type BYTES = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEByteArray());
-	final public static Type CHARACTER = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEChar());
-	final public static Type DATE = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDate());
-	final public static Type DATETIME = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDate());
-	final public static Type DAY = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDate());
-	final public static Type DECIMAL = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEFloat());
-	final public static Type DOUBLE =SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDouble());
-	final public static Type DURATION = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDate());
-	final public static Type FLOAT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEFloat());
-	final public static Type INT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEInt());
-	final public static Type INTEGER = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEInt());
-	final public static Type LONG = SDOUtil.adaptType(EcorePackage.eINSTANCE.getELong());
-	final public static Type MONTH = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDate());
-	final public static Type MONTHDAY = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDate());
-	final public static Type OBJECT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEObject());
-	final public static Type SHORT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEShort());
-	final public static Type STRING = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEString());
-	final public static Type STRINGS = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEString());
-	final public static Type TIME = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDate());
-	final public static Type URI = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEString());
-	final public static Type YEAR = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDate());
-	final public static Type YEARMONTH = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDate());
-	final public static Type YEARMONTHDAY = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDate());
-	final public static Type BOOLEANOBJECT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEBooleanObject());
-	final public static Type BYTEOBJECT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEByteObject());
-	final public static Type CHARACTEROBJECT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getECharacterObject());
-	final public static Type DOUBLEOBJECT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEDoubleObject());
-	final public static Type FLOATOBJECT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEFloatObject());
-	final public static Type INTEGEROBJECT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEIntegerObject());
-	final public static Type LONGOBJECT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getELongObject());
-	final public static Type SHORTOBJECT = SDOUtil.adaptType(EcorePackage.eINSTANCE.getEShortObject());
+     static TypeHelper helper = TypeHelper.INSTANCE;
+     
+	final public static Type BOOLEAN = helper.getType("commonj.sdo", "Boolean");
+	final public static Type BYTE = helper.getType("commonj.sdo", "Byte");
+	final public static Type BYTES = helper.getType("commonj.sdo", "ByteArray");
+	final public static Type CHARACTER = helper.getType("commonj.sdo", "Char");
+	final public static Type DATE = helper.getType("commonj.sdo", "Date");
+	final public static Type DATETIME = helper.getType("commonj.sdo", "Date");
+	final public static Type DAY = helper.getType("commonj.sdo", "Date");
+	final public static Type DECIMAL = helper.getType("commonj.sdo", "Float");
+	final public static Type DOUBLE =helper.getType("commonj.sdo", "Double");
+	final public static Type DURATION = helper.getType("commonj.sdo", "Date");
+	final public static Type FLOAT = helper.getType("commonj.sdo", "Float");
+	final public static Type INT = helper.getType("commonj.sdo", "Int");
+	final public static Type INTEGER = helper.getType("commonj.sdo", "Integer");
+	final public static Type LONG = helper.getType("commonj.sdo", "Long");
+	final public static Type MONTH = helper.getType("commonj.sdo", "Date");
+	final public static Type MONTHDAY = helper.getType("commonj.sdo", "Date");
+	final public static Type OBJECT = helper.getType("commonj.sdo", "Object");
+	final public static Type SHORT = helper.getType("commonj.sdo", "Short");
+	final public static Type STRING = helper.getType("commonj.sdo", "String");
+	final public static Type STRINGS = helper.getType("commonj.sdo", "String");
+	final public static Type TIME = helper.getType("commonj.sdo", "Date");
+	final public static Type URI = helper.getType("commonj.sdo", "String");
+	final public static Type YEAR = helper.getType("commonj.sdo", "Date");
+	final public static Type YEARMONTH = helper.getType("commonj.sdo", "Date");
+	final public static Type YEARMONTHDAY = helper.getType("commonj.sdo", "Date");
+	final public static Type BOOLEANOBJECT = helper.getType("commonj.sdo", "BooleanObject");
+	final public static Type BYTEOBJECT = helper.getType("commonj.sdo", "ByteObject");
+	final public static Type CHARACTEROBJECT = helper.getType("commonj.sdo", "CharacterObject");
+	final public static Type DOUBLEOBJECT = helper.getType("commonj.sdo", "DoubleObject");
+	final public static Type FLOATOBJECT = helper.getType("commonj.sdo", "FloatObject");
+	final public static Type INTEGEROBJECT = helper.getType("commonj.sdo", "IntObject");
+	final public static Type LONGOBJECT = helper.getType("commonj.sdo", "LongObject");
+	final public static Type SHORTOBJECT = helper.getType("commonj.sdo", "ShortObject");
 
 
 }

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/InsertGenerator.java Thu Feb  9 07:32:58 2006
@@ -28,8 +28,7 @@
 import org.apache.tuscany.das.rdb.impl.InsertCommandImpl;
 import org.apache.tuscany.das.rdb.impl.ParameterImpl;
 import org.apache.tuscany.das.rdb.util.DebugUtil;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
+import org.apache.tuscany.sdo.impl.AttributeImpl;
 import org.eclipse.emf.ecore.EObject;
 
 import commonj.sdo.DataObject;
@@ -51,12 +50,13 @@
 		StringBuffer statement = new StringBuffer("insert into ");
 		statement.append(t.getName());
 
-		Iterator i = getFields(changedObject).iterator();
+		Iterator i = getAttributeProperties(changedObject).iterator();
 
 		ArrayList attributes = new ArrayList();
 		while (i.hasNext()) {
-			EAttribute attr = (EAttribute) i.next();
-			if ((!table.isGeneratedColumnProperty(attr.getName())) && ((EObject)changedObject).eIsSet(attr)) {
+			AttributeImpl attr = (AttributeImpl) i.next();
+			if ((!table.isGeneratedColumnProperty(attr.getName())) && 
+					((EObject)changedObject).eIsSet(attr)) {
 				attributes.add(attr.getName());
 				parameters.add(changedObject.getType().getProperty(
 						attr.getName()));
@@ -113,19 +113,27 @@
 		return null;
 	}
 
-	private List getFields(DataObject obj) {
-		EClass clazz = ((EObject) obj).eClass();
-		return clazz.getEAttributes();
+	private List getAttributeProperties(DataObject obj) {
+		ArrayList fields = new ArrayList();
+		Iterator i = obj.getType().getProperties().iterator();
+		while ( i.hasNext()) {
+			Property p = (Property) i.next();
+			if ( p.getType().isDataType())
+				fields.add(p);
+		}
+		
+		return fields;
+	
 	}
 
 	public Collection getInsertParameters(DataObject changedObject, Table table) {
 		ArrayList parameters = new ArrayList();
 		TableWrapper wrapper = new TableWrapper(table);
 
-		Iterator i = getFields(changedObject).iterator();
+		Iterator i = getAttributeProperties(changedObject).iterator();
 
 		while (i.hasNext()) {
-			EAttribute attr = (EAttribute) i.next();
+			AttributeImpl attr = (AttributeImpl) i.next();
 			if (!wrapper.isGeneratedColumnProperty(attr.getName()))
 				parameters.add(changedObject.getType().getProperty(
 						attr.getName()));

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/generator/impl/UpdateGenerator.java Thu Feb  9 07:32:58 2006
@@ -33,13 +33,10 @@
 import org.apache.tuscany.das.rdb.impl.UpdateCommandImpl;
 import org.apache.tuscany.das.rdb.impl.WriteCommandImpl;
 import org.apache.tuscany.das.rdb.util.DebugUtil;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
+import org.apache.tuscany.sdo.impl.AttributeImpl;
+import org.apache.tuscany.sdo.impl.ChangeSummarySettingImpl;
+import org.apache.tuscany.sdo.impl.ReferenceImpl;
 import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.ecore.sdo.EChangeSummarySetting;
-import org.eclipse.emf.ecore.sdo.EProperty;
 
 import commonj.sdo.ChangeSummary;
 import commonj.sdo.DataObject;
@@ -69,7 +66,7 @@
 		Iterator i = getChangedFields(mapping, summary, changedObject).iterator();
 
 		while (i.hasNext()) {
-			EAttribute attr = (EAttribute) i.next();
+			AttributeImpl attr = (AttributeImpl) i.next();
 			Column c = t.getColumnByPropertyName(attr.getName());
 			if ((c != null) && (c.isCollision() || c.isPrimaryKey())) {
 				// get rid of comma if OCC or PK is last field
@@ -128,9 +125,15 @@
 		return updateCommand;
 	}
 
-	private List getFields(DataObject obj) {
-		EClass clazz = ((EObject) obj).eClass();
-		return clazz.getEAttributes();
+	private List getAttributeProperties(DataObject obj) {
+		ArrayList fields = new ArrayList();
+		Iterator i = obj.getType().getProperties().iterator();
+		while ( i.hasNext() ) {
+			Property p = (Property) i.next();
+			if ( p.getType().isDataType())
+				fields.add(p);
+		}
+		return fields;
 	}
 
 
@@ -138,18 +141,18 @@
 		ArrayList changes = new ArrayList();
 		Iterator i = summary.getOldValues(obj).iterator();
 		while (i.hasNext()) {
-			EChangeSummarySetting setting = (EChangeSummarySetting) i.next();
-			if (setting.getFeature() instanceof EAttribute)
+			ChangeSummarySettingImpl setting = (ChangeSummarySettingImpl) i.next();
+			if (setting.getFeature() instanceof AttributeImpl)
 				changes.add(setting.getFeature());
-			else if ( setting.getFeature() instanceof EReference) {
-				EReference ref = (EReference) setting.getFeature();
+			else if ( setting.getFeature() instanceof ReferenceImpl) {
+				ReferenceImpl ref = (ReferenceImpl) setting.getFeature();
 				if ( ref.getUpperBound() != ETypedElement.UNBOUNDED_MULTIPLICITY ) {
 					RelationshipWrapper r = new RelationshipWrapper(mapping.getRelationshipByName(ref.getEOpposite().getName()));
 					Iterator keys = r.getForeignKeys().iterator();
 					while ( keys.hasNext()) {
 						String key = (String) keys.next();
-						EProperty p = (EProperty) obj.getType().getProperty(key);
-						changes.add(p.getEStructuralFeature());
+						AttributeImpl p = (AttributeImpl) obj.getType().getProperty(key);
+						changes.add(p);
 					}
 				}
 					
@@ -178,9 +181,9 @@
 		ArrayList parameters = new ArrayList();
 		ArrayList pkParams = new ArrayList();
 		
-		Iterator i = getFields(changedObject).iterator();
+		Iterator i = getAttributeProperties(changedObject).iterator();
 		while (i.hasNext()) {
-			EAttribute attr = (EAttribute) i.next();
+			AttributeImpl attr = (AttributeImpl) i.next();
 			String field = attr.getName();
 
 			Parameter p = getParameter(wrapper, type.getProperty(field));

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/DataObjectMaker.java Thu Feb  9 07:32:58 2006
@@ -19,103 +19,102 @@
 import java.util.Iterator;
 
 import org.apache.tuscany.das.rdb.util.DebugUtil;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.sdo.EDataObject;
-import org.eclipse.emf.ecore.sdo.util.SDOUtil;
-import org.eclipse.emf.ecore.util.InternalEList;
 
 import commonj.sdo.DataObject;
 import commonj.sdo.Property;
 import commonj.sdo.Type;
+import commonj.sdo.helper.DataFactory;
 
 public class DataObjectMaker {
 
-	private final EDataObject dataGraph;
+	private final DataObject rootObject;
+
 	private boolean debug = false;
 
-	public DataObjectMaker(DataObject dataGraph) {
-		this.dataGraph = (EDataObject) dataGraph;
+	public DataObjectMaker(DataObject root) {
+		this.rootObject = root;
 	}
-	
+
 	/**
 	 * @param tableData
 	 * @return
 	 */
-	public EObject createAndAddDataObject(TableData tableData, ResultMetadata resultMetadata) {
-		// Get the EClass from the EPackage, and create a standalone EObject
+	public DataObject createAndAddDataObject(TableData tableData,
+			ResultMetadata resultMetadata) {
+		// Get a Type from the package and create a standalone DataObject
 
-		DebugUtil.debugln(getClass(), this.debug,"Looking for EClass for " + tableData.getTableName());
-	
-		EClass tableClass = findTableClass(tableData.getTableName());
+		DebugUtil.debugln(getClass(), this.debug, "Looking for Type for "
+				+ tableData.getTableName());
 
-		if ( tableClass == null ) 
-			throw new RuntimeException("An SDO Type with name " + tableData.getTableName() + " was not found");
-		
-		EObject obj = SDOUtil.create(tableClass);
+		Type tableClass = findTableTypeByPropertyName(tableData.getTableName());
+
+		if (tableClass == null)
+			throw new RuntimeException("An SDO Type with name "
+					+ tableData.getTableName() + " was not found");
+
+		DataObject obj = DataFactory.INSTANCE.create(tableClass);
 
 		// Now, check to see if the root data object has a containment reference
 		// to this EClass. If so, add it to the graph. If not, it will be taken
 		// care
 		// of when we process relationships
-		
-		Iterator i = this.dataGraph.eClass().getEReferences().iterator();
+
+		Iterator i = this.rootObject.getType().getProperties().iterator();
 		while (i.hasNext()) {
-			EReference ref = (EReference) i.next();
-			if (ref.isContainment()
-					&& ref.getEReferenceType().equals(tableClass)) {
-				if ( ref.isMany())
-					((InternalEList) this.dataGraph.eGet(ref)).addUnique(obj);
+			Property p = (Property) i.next();
+
+			if (p.isContainment() && p.getType().equals(tableClass)) {
+				if (p.isMany())
+					rootObject.getList(p).add(obj);
+				// TODO This was a performance optimization for EMF in SDO 1.1,
+				// check to see if there is
+				// something equivalent in SDO 2.0
+				// ((InternalEList) this.dataGraph.eGet(ref)).addUnique(obj);
 				else
-					this.dataGraph.eSet(ref, obj);
+					this.rootObject.set(p, obj);
 			}
 
 		}
 
-		Iterator columnNames = resultMetadata.getColumnNames(tableData.getTableName()).iterator();
+		Iterator columnNames = resultMetadata.getColumnNames(
+				tableData.getTableName()).iterator();
 		while (columnNames.hasNext()) {
 			String columnName = (String) columnNames.next();
-			DataObject dataObject = (DataObject)obj;
+			DataObject dataObject = (DataObject) obj;
 			Property p = findProperty(dataObject.getType(), columnName);
 			Object value = tableData.getColumnData(columnName);
-		//	System.out.println("setting " + p.getName()+ " to " + value);
+
 			dataObject.set(p, value);
 		}
-		
+
 		return obj;
 	}
 
-	//temporary, ignoring case
+	// temporary, ignoring case
 	private Property findProperty(Type type, String columnName) {
 		Iterator properties = type.getProperties().iterator();
-		while ( properties.hasNext()) {
+		while (properties.hasNext()) {
 			Property p = (Property) properties.next();
-			if ( columnName.equalsIgnoreCase(p.getName()))
+			if (columnName.equalsIgnoreCase(p.getName()))
 				return p;
 		}
 		return null;
 	}
-	
-	// Temporary utility to return the Eclass with the given name
-	private EClass findTableClass(String tableName) {
-		Iterator classifiers = getPackage().getEClassifiers().iterator();
-		while (classifiers.hasNext()) {
-			EClass tableClass = (EClass) classifiers.next();
-			if (tableName.equalsIgnoreCase(tableClass.getName()))
-				return tableClass;
-		}
 
+	private Type findTableTypeByPropertyName(String tableName) {
+		Iterator i = rootObject.getType().getProperties().iterator();
+		while (i.hasNext()) {
+			Property p = (Property) i.next();
+	//		System.out.println(p.getType().getName());
+			if (tableName.equals(p.getType().getName()))
+				return p.getType();
+		}
+		
 		return null;
 	}
 
-	private EClass getSchema() {
-		return this.dataGraph.eClass();
-	}
-
-	private EPackage getPackage() {
-		return getSchema().getEPackage();
+	private Type findTableTypeByRootReference(String refName) {
+		return rootObject.getProperty(refName).getType();
 	}
 
 }

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/GraphBuilderMetadata.java Thu Feb  9 07:32:58 2006
@@ -27,7 +27,8 @@
 import org.apache.tuscany.das.rdb.config.Config;
 import org.apache.tuscany.das.rdb.graphbuilder.schema.ESchemaMaker;
 import org.apache.tuscany.das.rdb.util.DebugUtil;
-import org.eclipse.emf.ecore.sdo.EType;
+
+import commonj.sdo.Type;
 
 
 /**
@@ -37,10 +38,10 @@
 	private Config mappingModel;
 	private final Collection resultSets = new ArrayList();
 	private boolean debug = false;
-	private EType schema;
+	private Type schema;
 
 
-	public GraphBuilderMetadata(Collection results, EType schema, Config model, ResultSetShape shape) throws SQLException {
+	public GraphBuilderMetadata(Collection results, Type schema, Config model, ResultSetShape shape) throws SQLException {
 		this.mappingModel = model;
 		this.schema = schema;
 		
@@ -82,7 +83,7 @@
 	/**
 	 * @return
 	 */
-	public EType getSchema() {
+	public Type getSchema() {
 		if ( this.schema == null ) {
 			ESchemaMaker schemaMaker = new ESchemaMaker(this);
 			return schemaMaker.createESchema();

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/MultiTableRegistry.java Thu Feb  9 07:32:58 2006
@@ -21,7 +21,8 @@
 import java.util.List;
 
 import org.apache.tuscany.das.rdb.util.DebugUtil;
-import org.eclipse.emf.ecore.EObject;
+
+import commonj.sdo.DataObject;
 
 
 
@@ -50,12 +51,12 @@
 	 * @param primaryKey
 	 * @return EDataObject
 	 */
-	public EObject get(String tableName, List primaryKey) {
+	public DataObject get(String tableName, List primaryKey) {
 		if ( debug ) {
 			DebugUtil.debugln(getClass(), debug, "Looking for table " + tableName  + " with PK " + primaryKey);
 			DebugUtil.debugln(getClass(), debug, ("\tReturning " + getPkMap(tableName).get(primaryKey)));
 		}
-		return (EObject) getPkMap(tableName).get(primaryKey);
+		return (DataObject) getPkMap(tableName).get(primaryKey);
 	}
 
 	/**
@@ -64,7 +65,7 @@
 	 * @param primaryKey
 	 * @param value
 	 */
-	public void put(String tableName, List primaryKey, EObject value) {
+	public void put(String tableName, List primaryKey, DataObject value) {
 		if ( getPkMap(tableName).put(primaryKey, value) == null )
 		   getCreateValueList(tableName).add(value);
 	}

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/ResultSetProcessor.java Thu Feb  9 07:32:58 2006
@@ -21,7 +21,6 @@
 import java.util.Iterator;
 
 import org.apache.tuscany.das.rdb.util.DebugUtil;
-import org.eclipse.emf.ecore.EObject;
 
 import commonj.sdo.DataObject;
 
@@ -118,7 +117,7 @@
 				continue;   
 
 			String tableName = rawDataFromRow.getTableName();
-			EObject tableObject = registry.get(tableName, rawDataFromRow
+			DataObject tableObject = registry.get(tableName, rawDataFromRow
 					.getPrimaryKeyValues());
 			if (tableObject == null) {
 				tableObject = doMaker.createAndAddDataObject(rawDataFromRow, resultMetadata);

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/RowObjects.java Thu Feb  9 07:32:58 2006
@@ -17,7 +17,6 @@
 package org.apache.tuscany.das.rdb.graphbuilder.impl;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 
@@ -25,10 +24,9 @@
 import org.apache.tuscany.das.rdb.config.Relationship;
 import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper;
 import org.apache.tuscany.das.rdb.util.DebugUtil;
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.ETypedElement;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
 
 
 public class RowObjects {
@@ -50,13 +48,13 @@
 		this.registry = registry;
 	}
 
-	public void put(String key, EObject value) {
+	public void put(String key, DataObject value) {
 		objectsByTableName.put(key, value);
 		tableObjects.add(value);
 	}
 
-	public EObject get(String tablePropertyName) {
-		return (EObject) objectsByTableName.get(tablePropertyName);
+	public DataObject get(String tablePropertyName) {
+		return (DataObject) objectsByTableName.get(tablePropertyName);
 	}
 
 	void processRelationships() {
@@ -70,9 +68,10 @@
 		while (i.hasNext()) {
 			Relationship r = (Relationship) i.next();
 
-			EObject parentTable = get(wrapper
+			
+            DataObject parentTable = get(wrapper
 					.getTablePropertyName(r.getPrimaryKeyTable()));
-			EObject childTable = get(wrapper
+			DataObject childTable = get(wrapper
 					.getTablePropertyName(r.getForeignKeyTable()));
 
 			DebugUtil.debugln(getClass(), debug, "Parent table: " + parentTable);
@@ -81,9 +80,8 @@
 			if ((parentTable == null) || (childTable == null))
 				continue;
 
-			EReference ref = (EReference) parentTable.eClass()
-					.getEStructuralFeature(r.getName());
-			setOrAdd(parentTable, childTable, ref);
+            Property p = parentTable.getType().getProperty(r.getName());
+			setOrAdd(parentTable, childTable, p);
 			
 		}
 	}
@@ -93,34 +91,33 @@
 	private void processRecursiveRelationships(MappingWrapper wrapper) {
 		Iterator i = tableObjects.iterator();
 		while (i.hasNext()) {
-			EObject table = (EObject) i.next();
-		//	System.out.println(table.eClass().getName());
-			Iterator relationships = wrapper.getRelationshipsByChildTable(table.eClass().getName()).iterator();
+			DataObject table = (DataObject) i.next();
+		
+			Iterator relationships = wrapper.getRelationshipsByChildTable(table.getType().getName()).iterator();
 			while ( relationships.hasNext() ) {
 				Relationship r = (Relationship) relationships.next();
-			//	System.out.println(r.getName());
-				EObject parentTable = findParentTable(table, r, wrapper);
+		
+				DataObject parentTable = findParentTable(table, r, wrapper);
 				
 				if (parentTable == null)
 					continue;
 
-				EReference ref = (EReference) parentTable.eClass().getEStructuralFeature(r.getName());
-				setOrAdd(parentTable, table, ref);
+                Property p = parentTable.getType().getProperty(r.getName());
+				setOrAdd(parentTable, table, p);
 			}
 			
 		}
 	}
 	
-	private void setOrAdd(EObject parent, EObject child, EReference ref) {
-		if (ref.getUpperBound() == ETypedElement.UNBOUNDED_MULTIPLICITY) {
-			Collection value = (Collection) parent.eGet(ref);
-			value.add(child);
+	private void setOrAdd(DataObject parent, DataObject child, Property p) {
+		if (p.isMany()) {
+            parent.getList(p).add(child);
 		} else {
-			parent.eSet(ref, child);
+			parent.set(p, child);
 		}
 	}
 	
-	private EObject findParentTable(EObject childTable, 
+	private DataObject findParentTable(DataObject childTable, 
 			Relationship r, MappingWrapper wrapper) {
 		
 		ArrayList fkValue = new ArrayList();
@@ -129,14 +126,13 @@
 			KeyPair pair = (KeyPair) keyPairs.next();
 			String childProperty = wrapper.getColumnPropertyName(r.getPrimaryKeyTable(), pair.getForeignKeyColumn());
 	
-			EAttribute attr = (EAttribute) childTable.eClass()
-					.getEStructuralFeature(childProperty);
-			fkValue.add(childTable.eGet(attr));
+            Property p = childTable.getType().getProperty(childProperty);
+			fkValue.add(childTable.get(p));
 		}
 
 		DebugUtil.debugln(getClass(), debug, "Trying to find parent of " + r.getForeignKeyTable() + " with FK "
 				+ fkValue);
-		EObject parentTable = registry.get(r.getPrimaryKeyTable(), fkValue);
+		DataObject parentTable = registry.get(r.getPrimaryKeyTable(), fkValue);
 		DebugUtil.debugln(getClass(), debug, "Parent table from registry: " + parentTable);
 		return parentTable;
 	}

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/SingleTableRegistry.java Thu Feb  9 07:32:58 2006
@@ -18,13 +18,13 @@
 
 import java.util.List;
 
-import org.eclipse.emf.ecore.EObject;
+import commonj.sdo.DataObject;
 
 /**
  */
 public class SingleTableRegistry implements TableRegistry {
 
-	//private HashMap<List,EObject> values = new HashMap<List,EObject>();
+	//private HashMap<List,DataObject> values = new HashMap<List,DataObject>();
 
 	public SingleTableRegistry() {
 		// Empty Constructor
@@ -33,14 +33,14 @@
 	/* (non-Javadoc)
 	 * @see com.ibm.ws.sdo.mediator.jdbc.graphbuilder.impl.TableRegistry#get(java.lang.String, java.util.List)
 	 */
-	public EObject get(String tableName, List primaryKey) {
+	public DataObject get(String tableName, List primaryKey) {
 		return null;
 	}
 
 	/* (non-Javadoc)
 	 * @see com.ibm.ws.sdo.mediator.jdbc.graphbuilder.impl.TableRegistry#put(java.lang.String, java.util.List, java.lang.Object)
 	 */
-	public void put(String tableName, List primaryKey, EObject value) {
+	public void put(String tableName, List primaryKey, DataObject value) {
 		// do nothing
 		
 	}

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/impl/TableRegistry.java Thu Feb  9 07:32:58 2006
@@ -18,7 +18,7 @@
 
 import java.util.List;
 
-import org.eclipse.emf.ecore.EObject;
+import commonj.sdo.DataObject;
 
 /**
  */
@@ -29,7 +29,7 @@
 	 * @param primaryKey
 	 * @return EDataObject
 	 */
-	public EObject get(String tableName, List primaryKey);
+	public DataObject get(String tableName, List primaryKey);
 
 	/**
 	 * Add the table with the specified name and primary key
@@ -37,7 +37,7 @@
 	 * @param primaryKey
 	 * @param value
 	 */
-	public void put(String tableName, List primaryKey, EObject value);
+	public void put(String tableName, List primaryKey, DataObject value);
 
 	public boolean contains(String name, List list);
 }

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EAttributeMaker.java Thu Feb  9 07:32:58 2006
@@ -16,9 +16,11 @@
  */
 package org.apache.tuscany.das.rdb.graphbuilder.schema;
 
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EcoreFactory;
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.impl.AttributeImpl;
+import org.apache.tuscany.sdo.impl.DataTypeImpl;
+
+import commonj.sdo.Type;
 
 
 /**
@@ -49,17 +51,17 @@
 	 * @param type The type of the new EAttribute
 	 * @return EAttribute
 	 */
-	public EAttribute createEAttribute(String name, EDataType type) {
+	public AttributeImpl createEAttribute(String name, Type type) {
 		
-		EAttribute attr = getFactory().createEAttribute();
+		AttributeImpl attr = (AttributeImpl) getFactory().createAttribute();
 		attr.setName(name);
-		attr.setEType(type);
+		attr.setEType((DataTypeImpl)type);
 		attr.setUnique(false);
 			
 		return attr;
 	}
 
-	private EcoreFactory getFactory() {
-		return EcoreFactory.eINSTANCE;
+	private SDOFactory getFactory() {
+		return SDOFactory.eINSTANCE;
 	}
 }

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/EReferenceMaker.java Thu Feb  9 07:32:58 2006
@@ -17,9 +17,11 @@
 package org.apache.tuscany.das.rdb.graphbuilder.schema;
 
 import org.apache.tuscany.das.rdb.config.Relationship;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.EcoreFactory;
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.impl.ClassImpl;
+import org.apache.tuscany.sdo.impl.ReferenceImpl;
+
+import commonj.sdo.Type;
 
 /**
  * A helper used to create EReferences
@@ -40,10 +42,10 @@
 	 * @param containment
 	 * @return EReference
 	 */
-	public EReference createEReference(String name, EClass type, int lowerBound, int upperBound, boolean containment, boolean changeable) {
-		EReference ref = getFactory().createEReference();
+	public ReferenceImpl createReference(String name, Type type, int lowerBound, int upperBound, boolean containment, boolean changeable) {
+		ReferenceImpl ref = (ReferenceImpl) getFactory().createReference();		
 		ref.setName(name);
-		ref.setEType(type);
+		ref.setEType((ClassImpl)type);
 		ref.setLowerBound(lowerBound);
 		ref.setUpperBound(upperBound);
 		ref.setContainment(containment);
@@ -53,8 +55,8 @@
 		return ref;
 	}
 	
-	public EReference createEReference(String name, EClass type, int lowerBound, int upperBound, boolean containment) {
-		return createEReference(name, type, lowerBound, upperBound, containment, true);
+	public ReferenceImpl createReference(String name, Type type, int lowerBound, int upperBound, boolean containment) {
+		return createReference(name, type, lowerBound, upperBound, containment, true);
 	}
 	/**
 	 * Create a one to many reference with the specified name, type, and containment
@@ -63,8 +65,8 @@
 	 * @param containment
 	 * @return
 	 */
-	public EReference createOneToManyReference(String name, EClass type, boolean containment) {
-		return createEReference(name, type, 0, -1, containment);
+	public ReferenceImpl createOneToManyReference(String name, Type type, boolean containment) {
+		return createReference(name, type, 0, -1, containment);
 	}
 	
 	/**
@@ -73,7 +75,7 @@
 	 * @param type
 	 * @return EReference
 	 */
-	public EReference createOneToManyReference(String name, EClass type) {
+	public ReferenceImpl createOneToManyReference(String name, Type type) {
 		return createOneToManyReference(name, type, false);	
 	}
 	
@@ -83,10 +85,8 @@
 	 * @param type
 	 * @return EReference
 	 */
-	public EReference createOneToOneReference(String name, EClass type) {
-		EReference ref = createEReference(name, type,0,1,false);
-	//	EcoreUtil.setAnnotation(ref, "commonj.sdo", "readOnly", "true");
-		  		
+	public ReferenceImpl createOneToOneReference(String name, Type type) {
+		ReferenceImpl ref = createReference(name, type,0,1,false);		  
 		return ref;
 	}
 	
@@ -96,12 +96,12 @@
 	 * @param type
 	 * @return EReference
 	 */
-	public EReference createManyToOneReference(String name, EClass type) {
-		return createEReference(name,type,0,1,false);
+	public ReferenceImpl createManyToOneReference(String name, Type type) {
+		return createReference(name,type,0,1,false);
 	}
 	
-	private EcoreFactory getFactory() {
-		return EcoreFactory.eINSTANCE;
+	private SDOFactory getFactory() {
+		return SDOFactory.eINSTANCE;
 	}
 
 
@@ -111,16 +111,16 @@
 	 * @param child
 	 * @return
 	 */
-	public EReference createReference(Relationship r, EClass parent, EClass child) {
+	public ReferenceImpl createReference(Relationship r, Type parent, Type child) {
 		if ( !r.isMany() ) {
-			EReference ref = createOneToOneReference(r.getName(), child);
-			EReference opp = createOneToOneReference(r.getName() + "_opposite", parent);
+			ReferenceImpl ref = createOneToOneReference(r.getName(), child);
+			ReferenceImpl opp = createOneToOneReference(r.getName() + "_opposite", parent);
 			ref.setEOpposite(opp);
 			opp.setEOpposite(ref);
 			return ref;
 		} else {
-			EReference ref = createOneToManyReference(r.getName(), child);
-			EReference opp = createManyToOneReference(r.getName() + "_opposite", parent);
+			ReferenceImpl ref = createOneToManyReference(r.getName(), child);
+			ReferenceImpl opp = createManyToOneReference(r.getName() + "_opposite", parent);
 			ref.setEOpposite(opp);
 			opp.setEOpposite(ref);
 			return ref;

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ESchemaMaker.java Thu Feb  9 07:32:58 2006
@@ -25,21 +25,23 @@
 import org.apache.tuscany.das.rdb.graphbuilder.impl.GraphBuilderMetadata;
 import org.apache.tuscany.das.rdb.graphbuilder.impl.ResultMetadata;
 import org.apache.tuscany.das.rdb.util.DebugUtil;
-import org.eclipse.emf.ecore.EAttribute;
+import org.apache.tuscany.sdo.SDOFactory;
+import org.apache.tuscany.sdo.impl.AttributeImpl;
+import org.apache.tuscany.sdo.impl.ClassImpl;
+import org.apache.tuscany.sdo.impl.DynamicDataObjectImpl;
+import org.apache.tuscany.sdo.impl.ReferenceImpl;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.apache.tuscany.sdo.util.SDOUtil;
 import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
 import org.eclipse.emf.ecore.ENamedElement;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
 import org.eclipse.emf.ecore.EcoreFactory;
 import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.sdo.EType;
-import org.eclipse.emf.ecore.sdo.impl.DynamicEDataObjectImpl;
-import org.eclipse.emf.ecore.sdo.util.SDOUtil;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
+
+import commonj.sdo.Type;
+import commonj.sdo.helper.TypeHelper;
 
 /**
  * 
@@ -49,235 +51,243 @@
  */
 public class ESchemaMaker {
 
-    private final GraphBuilderMetadata metadata;
+	private final GraphBuilderMetadata metadata;
 
-    private EPackage dataGraphPackage;
+	private EPackage dataGraphPackage;
 
-    private final String nsPrefix;
+	private final String nsPrefix;
 
-    private final String pkgName;
+	private final String pkgName;
 
-    private boolean debug = false;
-
-    /**
-     * Constructor for ESchemaMaker. Creates an EMF Schema based on the metadata
-     * passed in.
-     * 
-     * @param metadata
-     */
-    public ESchemaMaker(GraphBuilderMetadata metadata) {
-        this(metadata, null, null);
-    }
-
-    /**
-     * Constructor for ESshemaMaker. Creates an EMF Schema based on the supplied
-     * metadata, namespace prefix, and package name
-     * 
-     * @param metadata
-     *            the metadata
-     * @param nsPrefix
-     *            the namespace prefix - this affects the generated
-     *            Factory/Package name - defaults to datagraph
-     * @param pkgName
-     *            the package name - determines package name for generated code -
-     *            defaults to datagraph
-     */
-    public ESchemaMaker(GraphBuilderMetadata metadata, String nsPrefix,
-            String pkgName) {
-        if (nsPrefix == null)
-            nsPrefix = "datagraph";
-        if (pkgName == null)
-            pkgName = "datagraph";
-
-        this.metadata = metadata;
-        this.nsPrefix = nsPrefix;
-        this.pkgName = pkgName;
-
-    }
-
-    /**
-     * Creates an EMF Schema by using the
-     * 
-     * @link TableMaker and
-     * @link RelationshipMaker to transform
-     * @link Metadata elements into EMF Schema elements.
-     */
-
-    public EType createESchema() {
-        EClass rootObject = EcoreFactory.eINSTANCE.createEClass();
-        rootObject.setName("DataGraphRoot");
-        getEPackage().getEClassifiers().add(rootObject);
-
-        EReferenceMaker refMaker = new EReferenceMaker();
-
-        Iterator iter = metadata.getResultMetadata().iterator();
-        while (iter.hasNext()) {
-
-            ResultMetadata resultMetadata = (ResultMetadata) iter.next();
-
-            Iterator names = resultMetadata.getAllTablePropertyNames()
-                    .iterator();
-            while (names.hasNext()) {
-                String tableName = (String) names.next();
-                if (rootObject.getEStructuralFeature(tableName) == null) {
-                    EClass clazz = createEClass(tableName);
-                    getEPackage().getEClassifiers().add(clazz);
-                    EReference ref = refMaker.createOneToManyReference(
-                            tableName, clazz, true);
-                    rootObject.getEStructuralFeatures().add(ref);
-                }
-            }
-
-            for (int i = 1; i <= resultMetadata.getColumnNames().size(); i++) {
-
-                EReference ref = (EReference) rootObject
-                        .getEStructuralFeature(resultMetadata
-                                .getTablePropertyName(i));
-                if (ref == null)
-                    throw new RuntimeException("Could not find table "
-                            + resultMetadata.getTablePropertyName(i)
-                            + " in the SDO model");
-                EClass clazz = ref.getEReferenceType();
-                String columnName = resultMetadata.getColumnPropertyName(i);
-
-                if (clazz.getEStructuralFeature(columnName) == null) {
-                    EType atype = (EType) resultMetadata.getDataType(i);
-                    EDataType type = (EDataType) atype.getEClassifier();
-
-                    EAttribute attr = getAttributeMaker().createEAttribute(
-                            columnName, type);
-
-                    DebugUtil.debugln(getClass(), debug, "Adding column "
-                            + columnName + " to "
-                            + resultMetadata.getTablePropertyName(i));
-                    clazz.getEStructuralFeatures().add(attr);
-                }
-            }
-        }
-
-        if (metadata.hasMappingModel()) {
-            MappingWrapper wrapper = new MappingWrapper(metadata.getMapping());
-            Iterator i = metadata.getRelationships().iterator();
-            while (i.hasNext()) {
-                Relationship r = (Relationship) i.next();
-
-                EClass parent = (EClass) getEPackage().getEClassifier(
-                        wrapper.getTablePropertyName(r.getPrimaryKeyTable()));
-                EClass child = (EClass) getEPackage().getEClassifier(
-                        wrapper.getTablePropertyName(r.getForeignKeyTable()));
-                if (parent == null) {
-                    throw new RuntimeException("The parent table ("
-                            + r.getPrimaryKeyTable() + ") in relationship "
-                            + r.getName()
-                            + " was not found in the mapping information.");
-                } else if (child == null) {
-                    throw new RuntimeException("The child table ("
-                            + r.getForeignKeyTable() + ") in relationship "
-                            + r.getName()
-                            + " was not found in the mapping information.");
-                }
-
-                EReference ref = refMaker.createReference(r, parent, child);
-
-                DebugUtil.debugln(getClass(), debug, "Adding reference: "
-                        + ref.getName() + " to " + parent.getName());
-                if (parent.getEStructuralFeature(ref.getName()) == null)
-                    parent.getEStructuralFeatures().add(ref);
-
-                if (child.getEStructuralFeature(ref.getEOpposite().getName()) == null)
-                    child.getEStructuralFeatures().add(ref.getEOpposite());
-
-            }
-
-        }
-
-        EcoreUtil.freeze(rootObject.getEPackage());
-
-        return SDOUtil.adaptType(rootObject);
-    }
-
-    /**
-     * Create an EClass with the specified name
-     * 
-     * @param name
-     * @return EClass
-     */
-    protected EClass createEClass(String name) {
-        EClass ecl = EcoreFactory.eINSTANCE.createEClass();
-        ecl.setName(name);
-
-        return ecl;
-    }
-
-    /**
-     * Get an EAttributeMaker singleton
-     * 
-     * @return EAttributeMaker
-     */
-    private EAttributeMaker getAttributeMaker() {
-        return EAttributeMaker.singleton();
-    }
-
-    /**
-     * Internal method to save a schema to a file
-     * 
-     * @param eclass
-     *            The EClass to save (usually just the root EClass)
-     * @param name
-     *            The name of the file
-     * @throws IOException
-     */
-    private void save(ENamedElement eclass, OutputStream stream)
-            throws IOException {
-
-        XMIResourceImpl resource = new XMIResourceImpl();
-        resource.getContents().add(eclass);
-        resource.save(stream, null);
-
-    }
-
-    /**
-     * Used by Metadata.saveToEcore() to save the schema to a file
-     * 
-     * @param name
-     *            the file name
-     * @throws IOException
-     */
-    public void save(OutputStream stream) throws IOException {
-        save(getEPackage(), stream);
-    }
-
-    /**
-     * @return the EPackage for this schema
-     */
-    public EPackage getEPackage() {
-        if (this.dataGraphPackage == null)
-            this.dataGraphPackage = createEPackage();
-        return this.dataGraphPackage;
-    }
-
-    /**
-     * Create the EPackage for this schema Uses the packageName and nsPrefix
-     * values set in the constructors The EPackage overrides the default
-     * EFactory so that DataObjects will be created using MapDataObjectImpl.
-     * 
-     * @return the new EPackage
-     */
-    protected EPackage createEPackage() {
-
-        EPackage pkg = EcoreFactory.eINSTANCE.createEPackage();
-        pkg.setName(pkgName);
-        pkg.setNsPrefix(nsPrefix);
-        pkg.setNsURI("datagraph.ecore");
-
-        pkg.setEFactoryInstance(new EFactoryImpl() {
-            public EObject basicCreate(EClass cls) {
-                EObjectImpl result = new DynamicEDataObjectImpl(cls);
-                return result;
-            }
-        });
+	private boolean debug = false;
+
+	/**
+	 * Constructor for ESchemaMaker. Creates an EMF Schema based on the metadata
+	 * passed in.
+	 * 
+	 * @param metadata
+	 */
+	public ESchemaMaker(GraphBuilderMetadata metadata) {
+		this(metadata, null, null);
+	}
+
+	/**
+	 * Constructor for ESshemaMaker. Creates an EMF Schema based on the supplied
+	 * metadata, namespace prefix, and package name
+	 * 
+	 * @param metadata
+	 *            the metadata
+	 * @param nsPrefix
+	 *            the namespace prefix - this affects the generated
+	 *            Factory/Package name - defaults to datagraph
+	 * @param pkgName
+	 *            the package name - determines package name for generated code -
+	 *            defaults to datagraph
+	 */
+	public ESchemaMaker(GraphBuilderMetadata metadata, String nsPrefix,
+			String pkgName) {
+		if (nsPrefix == null)
+			nsPrefix = "datagraph";
+		if (pkgName == null)
+			pkgName = "datagraph";
+
+		this.metadata = metadata;
+		this.nsPrefix = nsPrefix;
+		this.pkgName = pkgName;
+
+		TypeHelper helper = TypeHelper.INSTANCE;
+	}
+
+	/**
+	 * Creates an EMF Schema by using the
+	 * 
+	 * @link TableMaker and
+	 * @link RelationshipMaker to transform
+	 * @link Metadata elements into EMF Schema elements.
+	 */
+
+	public Type createESchema() {
+		TypeHelper.INSTANCE.getType("commonj.sdo", "Integer");
+		DataObjectUtil.initRuntime();
+		SDOUtil.createDataGraph();
+
+		ClassImpl rootClass = (ClassImpl) SDOFactory.eINSTANCE.createClass();
+		Type rootType = (Type) rootClass;
+
+		rootClass.setName("DataGraphRoot");
+		getEPackage().getEClassifiers().add(rootClass);
+
+		EReferenceMaker refMaker = new EReferenceMaker();
+
+		Iterator iter = metadata.getResultMetadata().iterator();
+		while (iter.hasNext()) {
+
+			ResultMetadata resultMetadata = (ResultMetadata) iter.next();
+
+			Iterator names = resultMetadata.getAllTablePropertyNames()
+					.iterator();
+			while (names.hasNext()) {
+				String tableName = (String) names.next();
+				if (rootClass.getEStructuralFeature(tableName) == null) {
+					Type clazz = createEClass(tableName);
+					getEPackage().getEClassifiers().add(clazz);
+					ReferenceImpl ref = refMaker.createOneToManyReference(
+							tableName, clazz, true);
+					rootClass.getEStructuralFeatures().add(ref);
+				}
+			}
+
+			for (int i = 1; i <= resultMetadata.getColumnNames().size(); i++) {
+
+				ReferenceImpl ref = (ReferenceImpl) rootType
+						.getProperty(resultMetadata.getTablePropertyName(i));
+
+				if (ref == null)
+					throw new RuntimeException("Could not find table "
+							+ resultMetadata.getTablePropertyName(i)
+							+ " in the SDO model");
+				EClass clazz = ref.getEReferenceType();
+				String columnName = resultMetadata.getColumnPropertyName(i);
+
+				if (clazz.getEStructuralFeature(columnName) == null) {
+					Type atype = (Type) resultMetadata.getDataType(i);
+
+					// EDataType type = (EDataType) atype.getEClassifier();
+
+					AttributeImpl attr = getAttributeMaker().createEAttribute(
+							columnName, atype);
+
+					DebugUtil.debugln(getClass(), debug, "Adding column "
+							+ columnName + " to "
+							+ resultMetadata.getTablePropertyName(i));
+					clazz.getEStructuralFeatures().add(attr);
+				}
+			}
+		}
+
+		if (metadata.hasMappingModel()) {
+			MappingWrapper wrapper = new MappingWrapper(metadata.getMapping());
+			Iterator i = metadata.getRelationships().iterator();
+			while (i.hasNext()) {
+				Relationship r = (Relationship) i.next();
+
+				EClass parent = (EClass) getEPackage().getEClassifier(
+						wrapper.getTablePropertyName(r.getPrimaryKeyTable()));
+				EClass child = (EClass) getEPackage().getEClassifier(
+						wrapper.getTablePropertyName(r.getForeignKeyTable()));
+				if (parent == null) {
+					throw new RuntimeException("The parent table ("
+							+ r.getPrimaryKeyTable() + ") in relationship "
+							+ r.getName()
+							+ " was not found in the mapping information.");
+				} else if (child == null) {
+					throw new RuntimeException("The child table ("
+							+ r.getForeignKeyTable() + ") in relationship "
+							+ r.getName()
+							+ " was not found in the mapping information.");
+				}
+
+				ReferenceImpl ref = refMaker.createReference(r, (Type)parent, (Type)child);
+
+				DebugUtil.debugln(getClass(), debug, "Adding reference: "
+						+ ref.getName() + " to " + parent.getName());
+				if (parent.getEStructuralFeature(ref.getName()) == null)
+					parent.getEStructuralFeatures().add(ref);
+
+				if (child.getEStructuralFeature(ref.getEOpposite().getName()) == null)
+					child.getEStructuralFeatures().add(ref.getEOpposite());
+
+			}
+
+		}
+
+		// EcoreUtil.freeze(rootObject.getEPackage());
+
+		return (Type) rootClass;
+	}
+
+	/**
+	 * Create an EClass with the specified name
+	 * 
+	 * @param name
+	 * @return EClass
+	 */
+	protected Type createEClass(String name) {
+		ClassImpl ecl = (ClassImpl) SDOFactory.eINSTANCE.createClass();
+		ecl.setName(name);
+
+		return ecl;
+	}
+
+	/**
+	 * Get an EAttributeMaker singleton
+	 * 
+	 * @return EAttributeMaker
+	 */
+	private EAttributeMaker getAttributeMaker() {
+		return EAttributeMaker.singleton();
+	}
+
+	/**
+	 * Internal method to save a schema to a file
+	 * 
+	 * @param eclass
+	 *            The EClass to save (usually just the root EClass)
+	 * @param name
+	 *            The name of the file
+	 * @throws IOException
+	 */
+	private void save(ENamedElement eclass, OutputStream stream)
+			throws IOException {
+
+		XMLResourceImpl resource = new XMLResourceImpl();
+		resource.getContents().add(eclass);
+		resource.save(stream, null);
+
+	}
+
+	/**
+	 * Used by Metadata.saveToEcore() to save the schema to a file
+	 * 
+	 * @param name
+	 *            the file name
+	 * @throws IOException
+	 */
+	public void save(OutputStream stream) throws IOException {
+		save(getEPackage(), stream);
+	}
+
+	/**
+	 * @return the EPackage for this schema
+	 */
+	public EPackage getEPackage() {
+		if (this.dataGraphPackage == null)
+			this.dataGraphPackage = createEPackage();
+		return this.dataGraphPackage;
+	}
+
+	/**
+	 * Create the EPackage for this schema Uses the packageName and nsPrefix
+	 * values set in the constructors The EPackage overrides the default
+	 * EFactory so that DataObjects will be created using MapDataObjectImpl.
+	 * 
+	 * @return the new EPackage
+	 */
+	protected EPackage createEPackage() {
+		
+		EPackage pkg = EcoreFactory.eINSTANCE.createEPackage();
+		pkg.setName(pkgName);
+		pkg.setNsPrefix(nsPrefix);
+		pkg.setNsURI("datagraph.ecore");
+
+		pkg.setEFactoryInstance(new EFactoryImpl() {
+			public EObject basicCreate(EClass cls) {
+				EObject result = new DynamicDataObjectImpl(cls);
+				return result;
+			}
+		});
 
-        return pkg;
-    }
+		return pkg;
+	}
 
 }

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/graphbuilder/schema/ResultSetTypeMap.java Thu Feb  9 07:32:58 2006
@@ -18,14 +18,12 @@
 
 import java.sql.Types;
 
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.emf.ecore.sdo.util.SDOUtil;
+import org.apache.tuscany.sdo.SDOPackage;
 
 import commonj.sdo.Type;
+import commonj.sdo.helper.TypeHelper;
 
 /**
- *         would provide some facility to do this.
  */
 public class ResultSetTypeMap {
 
@@ -46,91 +44,90 @@
 	 * @param isNullable
 	 * @return
 	 */
-	public EDataType getEDataType(int type, boolean isNullable) {
-
+	public Type getEDataType(int type, boolean isNullable) {
+     
+	    TypeHelper helper = TypeHelper.INSTANCE;
+        SDOPackage.eINSTANCE.eClass();
 		switch (type) {
 
 		case Types.CHAR:
 		case Types.VARCHAR:
 		case Types.LONGVARCHAR:
-			return getPackage().getEString();
+			return helper.getType("commonj.sdo", "String");
 
 		case Types.NUMERIC:
 		case Types.DECIMAL:
-			return getPackage().getEBigDecimal();
+			return helper.getType("commonj.sdo", "Decimal");
 
 		case Types.BIT:
 		case Types.BOOLEAN:
 			if (isNullable)
-				return getPackage().getEBooleanObject();
+				return helper.getType("commonj.sdo", "Boolean");
 			else
-				return getPackage().getEBoolean();
+				return helper.getType("commonj.sdo", "boolean");
 
 		case Types.TINYINT:
 		case Types.SMALLINT:
 		case Types.INTEGER:
-			if (isNullable)
-				return getPackage().getEIntegerObject();
-			else
-				return getPackage().getEInt();
+			if (isNullable) {               
+				return helper.getType("commonj.sdo", "IntObject");
+            } else
+				return helper.getType("commonj.sdo", "Int");
 
 		case Types.BIGINT:
 			if (isNullable)
-				return getPackage().getELongObject();
+				return helper.getType("commonj.sdo", "Long");
 			else
-				return getPackage().getELong();
+				return helper.getType("commonj.sdo", "long");
 
 		case Types.REAL:
 			if (isNullable)
-				return getPackage().getEFloatObject();
+				return helper.getType("commonj.sdo", "Real");
 			else
-				return getPackage().getEFloat();
+				return helper.getType("commonj.sdo", "real");
 
 		case Types.FLOAT:
 		case Types.DOUBLE:
 			if (isNullable)
-				return getPackage().getEDoubleObject();
+				return helper.getType("commonj.sdo", "Double");
 			else
-				return getPackage().getEDouble();
+				return helper.getType("commonj.sdo", "double");
 
 		case Types.BINARY:
 		case Types.VARBINARY:
 		case Types.LONGVARBINARY:
-			return getPackage().getEByteArray();
+			return helper.getType("commonj.sdo", "ByteArray");
 
 		case Types.DATE:
 		case Types.TIME:
 		case Types.TIMESTAMP:
-			return getPackage().getEDate();
+			return helper.getType("commonj.sdo", "Date");
 
 		case Types.CLOB:
-			return getPackage().getEString();
+			return helper.getType("commonj.sdo", "Clob");
 
 		case Types.BLOB:
-			return getPackage().getEByteArray();
+			return helper.getType("commonj.sdo", "Blob");
 
 		case Types.ARRAY:
-			return getPackage().getEByteArray();
+			return helper.getType("commonj.sdo", "Array");
 
 		case Types.DISTINCT:
 		case Types.STRUCT:
 		case Types.REF:
 		case Types.DATALINK:
 		case Types.JAVA_OBJECT:
-			return getPackage().getEJavaObject();
+			return helper.getType("commonj.sdo", "Object");
 
 		default:
-			return getPackage().getEJavaObject();
+            return helper.getType("commonj.sdo", "Object");
 		}
 
 	}
 
-	public EcorePackage getPackage() {
-		return EcorePackage.eINSTANCE;
-	}
 
 	public Type getType(int columnType, boolean b) {
-		return SDOUtil.adaptType(getEDataType(columnType, b));
+		return getEDataType(columnType, b);
 	}
 
 }

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ChangeSummarizer.java Thu Feb  9 07:32:58 2006
@@ -28,11 +28,11 @@
 import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper;
 import org.apache.tuscany.das.rdb.config.wrapper.QualifiedColumn;
 import org.apache.tuscany.das.rdb.util.DebugUtil;
-import org.eclipse.emf.ecore.EAttribute;
+import org.apache.tuscany.sdo.impl.AttributeImpl;
+import org.apache.tuscany.sdo.impl.ChangeSummaryImpl;
+import org.apache.tuscany.sdo.impl.ChangeSummarySettingImpl;
 import org.eclipse.emf.ecore.EReference;
 import org.eclipse.emf.ecore.ETypedElement;
-import org.eclipse.emf.ecore.sdo.EChangeSummarySetting;
-import org.eclipse.emf.ecore.sdo.impl.EChangeSummaryImpl;
 
 import commonj.sdo.ChangeSummary;
 import commonj.sdo.DataObject;
@@ -59,7 +59,7 @@
 	public Changes loadChanges(DataObject root) {
 		ChangeSummary changeSummary = root.getDataGraph().getChangeSummary();
 		if (changeSummary.isLogging())
-			((EChangeSummaryImpl) changeSummary).summarize();
+			((ChangeSummaryImpl) changeSummary).summarize();
 
 		List changedObjects = changeSummary.getChangedDataObjects();
 		DebugUtil.debugln(getClass(), debug,
@@ -72,6 +72,7 @@
 		Iterator i = changedObjects.iterator();
 		while (i.hasNext()) {
 			DataObject o = (DataObject) i.next();
+			
 			if (!(o.equals(root))) {
 				createChange(changeSummary, o);
 			}
@@ -116,7 +117,7 @@
 				List values = changeSummary.getOldValues(changedObject);
 				Iterator i = values.iterator();
 				while (i.hasNext()) {
-					EChangeSummarySetting setting = (EChangeSummarySetting) i
+					ChangeSummarySettingImpl setting = (ChangeSummarySettingImpl) i
 							.next();
 
 					if (setting.getFeature() instanceof EReference) {
@@ -144,8 +145,8 @@
 	private boolean hasAttributeChange(List theChanges) {
 		Iterator i = theChanges.iterator();
 		while (i.hasNext()) {
-			EChangeSummarySetting setting = (EChangeSummarySetting) i.next();
-			if (setting.getFeature() instanceof EAttribute)
+			ChangeSummarySettingImpl setting = (ChangeSummarySettingImpl) i.next();
+			if (setting.getFeature() instanceof AttributeImpl)
 				return true;
 		}
 		return false;

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java Thu Feb  9 07:32:58 2006
@@ -16,6 +16,9 @@
  */
 package org.apache.tuscany.das.rdb.impl;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
 import java.sql.Connection;
 import java.util.List;
 
@@ -27,11 +30,12 @@
 
 import commonj.sdo.DataObject;
 import commonj.sdo.Type;
+import commonj.sdo.helper.XSDHelper;
 
 public abstract class CommandImpl implements Command {
 
 	protected Statement statement;
-	
+
 	protected Parameters parameters = new Parameters();
 
 	protected MappingWrapper mappingModel = new MappingWrapper();
@@ -42,6 +46,20 @@
 
 	public CommandImpl(String sqlString) {
 		statement = new Statement(sqlString);
+
+		try {
+			URL url = getClass().getResource("/xml/sdoJava.xsd");
+			if (url == null)
+				throw new RuntimeException(
+					"Could not find resource: xml/sdoJava.xsd");
+		
+			InputStream inputStream = url.openStream();
+			XSDHelper.INSTANCE.define(inputStream, url.toString());
+			inputStream.close();
+		} catch ( IOException ex ) {
+			throw new RuntimeException(ex);
+		}
+
 	}
 
 	public abstract void execute();
@@ -51,19 +69,20 @@
 	public void setParameterValue(String name, Object value) {
 		parameters.setParameter(name, value);
 	}
+
 	public void setParameterValue(int index, Object value) {
 		parameters.setParameter(index, value);
 	}
 
-    public void setParameterType(String name, Type dataType) {
-        parameters.setParameterWithType(name, dataType);
-    }
-    
-    public void setParameterType(int index, Type dataType) {
-        parameters.setParameterWithType(index, dataType);
-    }
+	public void setParameterType(String name, Type dataType) {
+		parameters.setParameterWithType(name, dataType);
+	}
 
-    public void addParameter(int index, Type sdoType) {
+	public void setParameterType(int index, Type dataType) {
+		parameters.setParameterWithType(index, dataType);
+	}
+
+	public void addParameter(int index, Type sdoType) {
 		addParameter(index, Parameter.IN, sdoType);
 	}
 
@@ -96,12 +115,12 @@
 		return parameters.parameterList();
 	}
 
-
 	public Object getParameterValue(String name) {
 		Parameter p = parameters.get(name);
-		if ( p == null ) 
-			throw new RuntimeException("Parameter with name " + name + " not found");
-		
+		if (p == null)
+			throw new RuntimeException("Parameter with name " + name
+					+ " not found");
+
 		return p;
 	}
 

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/ReadCommandImpl.java Thu Feb  9 07:32:58 2006
@@ -32,19 +32,17 @@
 import org.apache.tuscany.das.rdb.config.wrapper.MappingWrapper;
 import org.apache.tuscany.das.rdb.graphbuilder.impl.GraphBuilderMetadata;
 import org.apache.tuscany.das.rdb.graphbuilder.impl.ResultSetProcessor;
+import org.apache.tuscany.sdo.impl.ChangeSummaryImpl;
+import org.apache.tuscany.sdo.util.DataObjectUtil;
+import org.apache.tuscany.sdo.util.SDOUtil;
 import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EClassifier;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.sdo.EType;
-import org.eclipse.emf.ecore.sdo.SDOFactory;
-import org.eclipse.emf.ecore.sdo.impl.EDataGraphImpl;
-import org.eclipse.emf.ecore.sdo.util.SDOUtil;
 import org.eclipse.emf.ecore.util.ExtendedMetaData;
-import org.eclipse.emf.ecore.util.InternalEList;
 import org.eclipse.emf.ecore.xmi.XMLResource;
 import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
 
+import commonj.sdo.DataGraph;
 import commonj.sdo.DataObject;
 import commonj.sdo.Type;
 
@@ -98,7 +96,7 @@
 	}
 
 	protected DataObject buildGraph(ResultSet result) throws SQLException {
-
+		
 		List results = new ArrayList();
 		results.add(result);
 
@@ -110,17 +108,19 @@
 		GraphBuilderMetadata gbmd = new GraphBuilderMetadata(results,
 				getSchema(), mappingModel.getConfig(), resultSetShape);
 
-		EDataGraphImpl g = createEDataGraph(gbmd.getSchema());
+		DataGraph g = createEDataGraph(gbmd.getSchema());
+		ChangeSummaryImpl summary = (ChangeSummaryImpl) g.getChangeSummary();
 
 		ResultSetProcessor rsp = new ResultSetProcessor(g.getRootObject(), gbmd);
 		rsp.processResults(getStartRow(), getEndRow());
 
-		g.getChangeSummary().beginLogging();
+		summary.beginLogging();
+	
 		return g.getRootObject();
 	}
 
-	private EType getSchema() {
-		return (EType) schema;
+	private Type getSchema() {
+		return (Type) schema;
 	}
 
 	protected int getStartRow() {
@@ -139,26 +139,20 @@
 		this.endRow = endRow;
 	}
 
-	private EDataGraphImpl createEDataGraph(EType type) {
+	private DataGraph createEDataGraph(Type type) {
 
-		EClassifier rootClass = type.getEClassifier();
-		EDataGraphImpl g = (EDataGraphImpl) SDOFactory.eINSTANCE
-				.createEDataGraph();
+		DataGraph g = SDOUtil.createDataGraph();
 
 		// Create a ResourceSet to contain the DataGraph
-		ResourceSet resourceSet = SDOUtil.createResourceSet();
+		ResourceSet resourceSet = DataObjectUtil.createResourceSet();
 
 		// Create a Resource to hold the schema
-		Resource r = resourceSet.createResource(URI.createURI(rootClass
-				.getEPackage().getNsURI()));
-		InternalEList list = (InternalEList) r.getContents();
-		list.addUnique(rootClass.getEPackage());
-
-		// Set the DataGraph's ResourceSet
-		g.setResourceSet(resourceSet);
+        
+		Resource r = resourceSet.createResource(URI.createURI(type.getURI()));
+		r.getContents().add(g);
 
 		// Create the root object
-		g.createRootObject(SDOUtil.adaptType(rootClass));
+		g.createRootObject(type);
 
 		return g;
 	}
@@ -168,6 +162,7 @@
 	}
 
 	public void setMappingModel(InputStream stream) {
+        
 		XMLResource resource = new XMLResourceImpl();
 
 		HashMap map = new HashMap();

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/SDODataTypeHelper.java Thu Feb  9 07:32:58 2006
@@ -94,7 +94,7 @@
 		else if ( sdoType == SDODataTypes.SHORTOBJECT )
 			return java.sql.Types.SMALLINT;
 		else
-			throw new RuntimeException("Not a valid SDO Type");
+			throw new RuntimeException("Not a valid SDO Type " + sdoType);
 		
-	}
+	} 
 }

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/Statement.java Thu Feb  9 07:32:58 2006
@@ -138,11 +138,11 @@
                 param.setIndex(queryString.getParameterIndex(param.getName()));
             Object value = param.getValue();
             DebugUtil.debugln(getClass(), debug, "Setting parameter " + param.getIndex() + " to " + value);
-            if (value == null) {
-                // System.out.println(param.getType());
+            if (value == null) {            
                 ps.setNull(param.getIndex(), SDODataTypeHelper.sqlTypeFor(param.getType()));
-            } else
+            } else {           
                 ps.setObject(param.getIndex(), value);
+            }
         }
         return ps.executeUpdate();
     }

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/merge/impl/GraphMerger.java Thu Feb  9 07:32:58 2006
@@ -22,14 +22,13 @@
 import java.util.List;
 import java.util.logging.Logger;
 
-
 import org.apache.tuscany.das.rdb.config.wrapper.QualifiedColumn;
 import org.apache.tuscany.das.rdb.graphbuilder.impl.MultiTableRegistry;
 import org.apache.tuscany.das.rdb.graphbuilder.impl.TableRegistry;
-import org.eclipse.emf.ecore.EAttribute;
+import org.apache.tuscany.sdo.impl.AttributeImpl;
+import org.apache.tuscany.sdo.impl.ChangeSummaryImpl;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.sdo.impl.EChangeSummaryImpl;
 
 import commonj.sdo.DataObject;
 import commonj.sdo.Property;
@@ -63,7 +62,7 @@
 	public DataObject merge(DataObject primary, DataObject secondary) {
 		addGraphToRegistry(primary);
 
-		EChangeSummaryImpl summary = (EChangeSummaryImpl) primary
+		ChangeSummaryImpl summary =  (ChangeSummaryImpl) primary
 				.getDataGraph().getChangeSummary();
 		summary.endLogging();
 		Iterator i = secondary.getType().getProperties().iterator();
@@ -95,11 +94,11 @@
 			Iterator attrs = eObjectToCopy.eClass().getEAllAttributes()
 					.iterator();
 			while (attrs.hasNext()) {
-				EAttribute attr = (EAttribute) attrs.next();
+				AttributeImpl attr = (AttributeImpl) attrs.next();
 				newObject.set(attr.getName(), eObjectToCopy.eGet(attr));
 			}
 			registry.put(object.getType().getName(), Collections
-					.singletonList(pk), (EObject) newObject);
+					.singletonList(pk), newObject);
 
 			Iterator refs = eObjectToCopy.eClass().getEAllReferences()
 					.iterator();
@@ -145,7 +144,7 @@
 				Object pk = object.get(getPrimaryKeyName(object));
 				logger.finest("Adding object with pk " + pk + " to registry");
 				registry.put(object.getType().getName(), Collections
-						.singletonList(pk), (EObject) object);
+						.singletonList(pk), object);
 			}
 		}
 	}

Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/util/DataObjectUtil.java Thu Feb  9 07:32:58 2006
@@ -19,14 +19,13 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.eclipse.emf.ecore.EAttribute;
 import org.eclipse.emf.ecore.EFactory;
 import org.eclipse.emf.ecore.EObject;
 import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.sdo.EChangeSummarySetting;
 
 import commonj.sdo.ChangeSummary;
 import commonj.sdo.DataObject;
+import commonj.sdo.ChangeSummary.Setting;
 
 /**
  */
@@ -68,9 +67,9 @@
 		
 		Iterator i = changes.iterator();
 		while (i.hasNext()) {
-		    EChangeSummarySetting s = (EChangeSummarySetting) i.next();    
-		    if ( s.getFeature() instanceof EAttribute )
-		    	((EObject)changedCopy).eSet(s.getFeature(), s.getValue());
+		    Setting s = (Setting) i.next();    
+		    if ( s.getProperty().getType().isDataType() )
+		    	changedCopy.set(s.getProperty(), s.getValue());
 		}
    }
 

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/CompanyTests.java Thu Feb  9 07:32:58 2006
@@ -20,10 +20,10 @@
 import java.io.InputStream;
 
 import org.apache.tuscany.das.rdb.Command;
-import org.apache.tuscany.das.rdb.test.company.CompanyPackage;
+import org.apache.tuscany.das.rdb.test.company.CompanyFactory;
 import org.apache.tuscany.das.rdb.test.company.CompanyType;
+import org.apache.tuscany.das.rdb.test.company.DatagraphRoot;
 import org.apache.tuscany.das.rdb.test.company.DepartmentType;
-import org.apache.tuscany.das.rdb.test.company.DocumentRoot;
 import org.apache.tuscany.das.rdb.test.company.EmployeeType;
 import org.apache.tuscany.das.rdb.test.data.CompanyData;
 import org.apache.tuscany.das.rdb.test.data.CompanyDeptData;
@@ -31,9 +31,10 @@
 import org.apache.tuscany.das.rdb.test.data.DepartmentData;
 import org.apache.tuscany.das.rdb.test.data.EmployeeData;
 import org.apache.tuscany.das.rdb.test.framework.DasTest;
-import org.eclipse.emf.ecore.sdo.util.SDOUtil;
+import org.apache.tuscany.sdo.util.SDOUtil;
 
 import commonj.sdo.DataObject;
+import commonj.sdo.helper.TypeHelper;
 
 public class CompanyTests extends DasTest {
 
@@ -76,6 +77,7 @@
 
     public void testSimpleStatic() throws Exception {
 
+    	SDOUtil.registerStaticTypes(CompanyFactory.class);
         // Build the select command
         Command selectCommand = Command.FACTORY.createCommand("select COMPANY.NAME, "
                 + "EMPLOYEE.NAME, EMPLOYEE.SN, EMPLOYEE.MANAGER, "
@@ -84,15 +86,16 @@
 
         // Parameterize the command
         selectCommand.setConnection(getConnection());
-        selectCommand.setDataObjectModel(SDOUtil.adaptType(CompanyPackage.eINSTANCE.getDocumentRoot()));
+        selectCommand.setDataObjectModel(TypeHelper.INSTANCE.getType(DatagraphRoot.class));
         selectCommand.addConverter("DEPARTMENT.NUMBER", "org.apache.tuscany.das.rdb.test.mappings.StringToIntegerConverter");
         selectCommand.addConverter("EMPLOYEE.MANAGER", "org.apache.tuscany.das.rdb.test.mappings.IntegerToBooleanConverter");
 
         // Get the graph
-        DocumentRoot root = (DocumentRoot) selectCommand.executeQuery();
+        DatagraphRoot root = (DatagraphRoot) selectCommand.executeQuery();
+        
+        
+        CompanyType company = (CompanyType) root.getCompanies().get(0);
 
-        // Get a company
-        CompanyType company = root.getCompany();
         assertEquals("MegaCorp", company.getName());
 
         // Get a department
@@ -105,8 +108,7 @@
     }
 
     private InputStream getCompanyMappingModel() throws FileNotFoundException {
-        // return new FileInputStream("src/test/resources/companyMapping.xml");
-        return Thread.currentThread().getContextClassLoader().getResourceAsStream("companyMapping.xml");
+        return getClass().getClassLoader().getResourceAsStream("companyMapping.xml");
     }
 
 }

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ConverterTests.java Thu Feb  9 07:32:58 2006
@@ -86,7 +86,7 @@
 
 		String[] columns = { "ID", "LASTNAME", "ADDRESS" };
 		String[] tables = { "CUSTOMER", "CUSTOMER", "CUSTOMER" };
-		Type[] types = { SDODataTypes.INTEGER, SDODataTypes.DATE, SDODataTypes.STRING };
+		Type[] types = { SDODataTypes.INTEGEROBJECT, SDODataTypes.DATE, SDODataTypes.STRING };
 		ResultSetShape shape = new ResultSetShape(tables, columns, types);
 		read.setResultSetShape(shape);
 		

Modified: incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java?rev=376322&r1=376321&r2=376322&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java (original)
+++ incubator/tuscany/java/das/rdb/src/test/java/org/apache/tuscany/das/rdb/test/ExceptionTests.java Thu Feb  9 07:32:58 2006
@@ -17,11 +17,14 @@
 package org.apache.tuscany.das.rdb.test;
 
 import org.apache.tuscany.das.rdb.Command;
-import org.apache.tuscany.das.rdb.test.company.CompanyPackage;
+import org.apache.tuscany.das.rdb.test.company.CompanyFactory;
+import org.apache.tuscany.das.rdb.test.customer.DataGraphRoot;
 import org.apache.tuscany.das.rdb.test.data.CustomerData;
 import org.apache.tuscany.das.rdb.test.data.OrderData;
 import org.apache.tuscany.das.rdb.test.framework.DasTest;
-import org.eclipse.emf.ecore.sdo.util.SDOUtil;
+import org.apache.tuscany.sdo.util.SDOUtil;
+
+import commonj.sdo.helper.TypeHelper;
 
 public class ExceptionTests extends DasTest {
 
@@ -56,13 +59,13 @@
 		Command readCustomers = Command.FACTORY
 				.createCommand("select * from CUSTOMER where ID = 1");
 		readCustomers.setConnection(getConnection());
-		readCustomers.setDataObjectModel(SDOUtil
-				.adaptType(CompanyPackage.eINSTANCE.getDocumentRoot()));
+		SDOUtil.registerStaticTypes(CompanyFactory.class);
+		readCustomers.setDataObjectModel(TypeHelper.INSTANCE.getType(DataGraphRoot.class));
 
 		try {
 			readCustomers.executeQuery();
 			fail("Exception should be thrown");
-		} catch (RuntimeException ex) {
+		} catch (RuntimeException ex) {	
 			assertEquals("An SDO Type with name CUSTOMER was not found", ex
 					.getMessage());
 		}



Mime
View raw message