You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ad...@apache.org on 2007/05/11 23:36:57 UTC

svn commit: r537297 [6/10] - in /incubator/tuscany/cpp/das: VSExpress/tuscany_das/ VSExpress/tuscany_das/das_lite/ VSExpress/tuscany_das/das_runtime/ das_java_classes/ das_java_classes/config/ runtime/core/include/ runtime/core/include/apache/ runtime/...

Added: incubator/tuscany/cpp/das/das_java_classes/RelationshipImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/RelationshipImpl.cpp?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/RelationshipImpl.cpp (added)
+++ incubator/tuscany/cpp/das/das_java_classes/RelationshipImpl.cpp Fri May 11 14:36:45 2007
@@ -0,0 +1,356 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#include "RelationshipImpl.h"
+
+RelationshipImpl::RelationshipImpl(void) {
+	name = NAME_DEFAULT_;
+	keyPair = NULL;
+	primaryKeyTable = PRIMARY_KEY_TABLE_DEFAULT_;
+	foreignKeyTable = FOREIGN_KEY_TABLE_DEFAULT_;
+	many = MANY_DEFAULT_;
+	keyRestricted = KEY_RESTRICTED_DEFAULT_;
+
+}
+
+RelationshipImpl::~RelationshipImpl(void) {
+}
+
+Type* RelationshipImpl::getType(void) {
+	return ((ConfigFactoryImpl)ConfigFactory.INSTANCE).getRelationship();
+}
+
+list<KeyPair*>* RelationshipImpl::getKeyPair(void) {
+	if (keyPair == NULL) {
+		//keyPair = createPropertyList(ListKind::CONTAINMENT, KeyPair.class, KEY_PAIR);
+    }
+
+    return keyPair;
+
+}
+
+string RelationshipImpl::getName(void) {
+	return name;
+}
+
+void RelationshipImpl::setName(string newName) {
+	name = newName;
+}
+
+string RelationshipImpl::getPrimaryKeyTable(void) {
+	return primaryKeyTable;
+}
+
+void RelationshipImpl::setPrimaryKeyTable(string newPrimaryKeyTable) {
+	primaryKeyTable = newPrimaryKeyTable;
+}
+
+string RelationshipImpl::getForeignKeyTable(void) {
+	return foreignKeyTable;
+}
+
+void RelationshipImpl::setForeignKeyTable(string newForeignKeyTable) {
+	foreignKeyTable = newForeignKeyTable;
+}
+
+bool RelationshipImpl::isMany(void) {
+	return many;
+}
+
+void RelationshipImpl::setMany(bool newMany) {
+	many = newMany;
+}
+
+bool RelationshipImpl::isKeyRestricted(void) {
+	return keyRestricted;
+}
+
+void RelationshipImpl::setKeyRestricted(bool newKeyRestricted) {
+	keyRestricted = newKeyRestricted;
+}
+
+//ChangeContext* RelationshipImpl::inverseRemove(DASObject* otherEnd, int propertyIndex, ChangeContext* changeContext) {}
+
+DASObject* RelationshipImpl::get(int propertyIndex, bool resolve) {
+	/*switch (propertyIndex)
+    {
+      case KEY_PAIR:
+        return getKeyPair();
+      case NAME:
+        return getName();
+      case PRIMARY_KEY_TABLE:
+        return getPrimaryKeyTable();
+      case FOREIGN_KEY_TABLE:
+        return getForeignKeyTable();
+      case MANY:
+        return isMany() ? Boolean.TRUE : Boolean.FALSE;
+      case KEY_RESTRICTED:
+        return isKeyRestricted() ? Boolean.TRUE : Boolean.FALSE;
+    }
+    return super.get(propertyIndex, resolve);*/
+}
+
+void RelationshipImpl::set(int propertyIndex, DASObject* newValue) {
+	/*switch (propertyIndex)
+    {
+      case KEY_PAIR:
+        getKeyPair().clear();
+        getKeyPair().addAll((Collection)newValue);
+        return;
+      case NAME:
+        setName((String)newValue);
+        return;
+      case PRIMARY_KEY_TABLE:
+        setPrimaryKeyTable((String)newValue);
+        return;
+      case FOREIGN_KEY_TABLE:
+        setForeignKeyTable((String)newValue);
+        return;
+      case MANY:
+        setMany(((Boolean)newValue).booleanValue());
+        return;
+      case KEY_RESTRICTED:
+        setKeyRestricted(((Boolean)newValue).booleanValue());
+        return;
+    }
+    super.set(propertyIndex, newValue);*/
+}
+
+void RelationshipImpl::unset(int propertyIndex) {
+	/*switch (propertyIndex)
+    {
+      case KEY_PAIR:
+        getKeyPair().clear();
+        return;
+      case NAME:
+        setName(NAME_DEFAULT_);
+        return;
+      case PRIMARY_KEY_TABLE:
+        setPrimaryKeyTable(PRIMARY_KEY_TABLE_DEFAULT_);
+        return;
+      case FOREIGN_KEY_TABLE:
+        setForeignKeyTable(FOREIGN_KEY_TABLE_DEFAULT_);
+        return;
+      case MANY:
+        setMany(MANY_DEFAULT_);
+        return;
+      case KEY_RESTRICTED:
+        setKeyRestricted(KEY_RESTRICTED_DEFAULT_);
+        return;
+    }
+    super.unset(propertyIndex);*/
+}
+
+bool RelationshipImpl::isSet(int propertyIndex) {
+	/*switch (propertyIndex)
+    {
+      case KEY_PAIR:
+        return keyPair != null && !keyPair.isEmpty();
+      case NAME:
+        return NAME_DEFAULT_ == null ? name != null : !NAME_DEFAULT_.equals(name);
+      case PRIMARY_KEY_TABLE:
+        return PRIMARY_KEY_TABLE_DEFAULT_ == null ? primaryKeyTable != null : !PRIMARY_KEY_TABLE_DEFAULT_.equals(primaryKeyTable);
+      case FOREIGN_KEY_TABLE:
+        return FOREIGN_KEY_TABLE_DEFAULT_ == null ? foreignKeyTable != null : !FOREIGN_KEY_TABLE_DEFAULT_.equals(foreignKeyTable);
+      case MANY:
+        return many != MANY_DEFAULT_;
+      case KEY_RESTRICTED:
+        return keyRestricted != KEY_RESTRICTED_DEFAULT_;
+    }
+    return super.isSet(propertyIndex);*/
+}
+
+//string RelationshipImpl::toString(void) {}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#include "RelationshipImpl.h"
+
+RelationshipImpl::RelationshipImpl(void) {
+	name = NAME_DEFAULT_;
+	keyPair = NULL;
+	primaryKeyTable = PRIMARY_KEY_TABLE_DEFAULT_;
+	foreignKeyTable = FOREIGN_KEY_TABLE_DEFAULT_;
+	many = MANY_DEFAULT_;
+	keyRestricted = KEY_RESTRICTED_DEFAULT_;
+
+}
+
+RelationshipImpl::~RelationshipImpl(void) {
+}
+
+Type* RelationshipImpl::getType(void) {
+	return ((ConfigFactoryImpl)ConfigFactory.INSTANCE).getRelationship();
+}
+
+list<KeyPair*>* RelationshipImpl::getKeyPair(void) {
+	if (keyPair == NULL) {
+		//keyPair = createPropertyList(ListKind::CONTAINMENT, KeyPair.class, KEY_PAIR);
+    }
+
+    return keyPair;
+
+}
+
+string RelationshipImpl::getName(void) {
+	return name;
+}
+
+void RelationshipImpl::setName(string newName) {
+	name = newName;
+}
+
+string RelationshipImpl::getPrimaryKeyTable(void) {
+	return primaryKeyTable;
+}
+
+void RelationshipImpl::setPrimaryKeyTable(string newPrimaryKeyTable) {
+	primaryKeyTable = newPrimaryKeyTable;
+}
+
+string RelationshipImpl::getForeignKeyTable(void) {
+	return foreignKeyTable;
+}
+
+void RelationshipImpl::setForeignKeyTable(string newForeignKeyTable) {
+	foreignKeyTable = newForeignKeyTable;
+}
+
+bool RelationshipImpl::isMany(void) {
+	return many;
+}
+
+void RelationshipImpl::setMany(bool newMany) {
+	many = newMany;
+}
+
+bool RelationshipImpl::isKeyRestricted(void) {
+	return keyRestricted;
+}
+
+void RelationshipImpl::setKeyRestricted(bool newKeyRestricted) {
+	keyRestricted = newKeyRestricted;
+}
+
+//ChangeContext* RelationshipImpl::inverseRemove(DASObject* otherEnd, int propertyIndex, ChangeContext* changeContext) {}
+
+DASObject* RelationshipImpl::get(int propertyIndex, bool resolve) {
+	/*switch (propertyIndex)
+    {
+      case KEY_PAIR:
+        return getKeyPair();
+      case NAME:
+        return getName();
+      case PRIMARY_KEY_TABLE:
+        return getPrimaryKeyTable();
+      case FOREIGN_KEY_TABLE:
+        return getForeignKeyTable();
+      case MANY:
+        return isMany() ? Boolean.TRUE : Boolean.FALSE;
+      case KEY_RESTRICTED:
+        return isKeyRestricted() ? Boolean.TRUE : Boolean.FALSE;
+    }
+    return super.get(propertyIndex, resolve);*/
+}
+
+void RelationshipImpl::set(int propertyIndex, DASObject* newValue) {
+	/*switch (propertyIndex)
+    {
+      case KEY_PAIR:
+        getKeyPair().clear();
+        getKeyPair().addAll((Collection)newValue);
+        return;
+      case NAME:
+        setName((String)newValue);
+        return;
+      case PRIMARY_KEY_TABLE:
+        setPrimaryKeyTable((String)newValue);
+        return;
+      case FOREIGN_KEY_TABLE:
+        setForeignKeyTable((String)newValue);
+        return;
+      case MANY:
+        setMany(((Boolean)newValue).booleanValue());
+        return;
+      case KEY_RESTRICTED:
+        setKeyRestricted(((Boolean)newValue).booleanValue());
+        return;
+    }
+    super.set(propertyIndex, newValue);*/
+}
+
+void RelationshipImpl::unset(int propertyIndex) {
+	/*switch (propertyIndex)
+    {
+      case KEY_PAIR:
+        getKeyPair().clear();
+        return;
+      case NAME:
+        setName(NAME_DEFAULT_);
+        return;
+      case PRIMARY_KEY_TABLE:
+        setPrimaryKeyTable(PRIMARY_KEY_TABLE_DEFAULT_);
+        return;
+      case FOREIGN_KEY_TABLE:
+        setForeignKeyTable(FOREIGN_KEY_TABLE_DEFAULT_);
+        return;
+      case MANY:
+        setMany(MANY_DEFAULT_);
+        return;
+      case KEY_RESTRICTED:
+        setKeyRestricted(KEY_RESTRICTED_DEFAULT_);
+        return;
+    }
+    super.unset(propertyIndex);*/
+}
+
+bool RelationshipImpl::isSet(int propertyIndex) {
+	/*switch (propertyIndex)
+    {
+      case KEY_PAIR:
+        return keyPair != null && !keyPair.isEmpty();
+      case NAME:
+        return NAME_DEFAULT_ == null ? name != null : !NAME_DEFAULT_.equals(name);
+      case PRIMARY_KEY_TABLE:
+        return PRIMARY_KEY_TABLE_DEFAULT_ == null ? primaryKeyTable != null : !PRIMARY_KEY_TABLE_DEFAULT_.equals(primaryKeyTable);
+      case FOREIGN_KEY_TABLE:
+        return FOREIGN_KEY_TABLE_DEFAULT_ == null ? foreignKeyTable != null : !FOREIGN_KEY_TABLE_DEFAULT_.equals(foreignKeyTable);
+      case MANY:
+        return many != MANY_DEFAULT_;
+      case KEY_RESTRICTED:
+        return keyRestricted != KEY_RESTRICTED_DEFAULT_;
+    }
+    return super.isSet(propertyIndex);*/
+}
+
+//string RelationshipImpl::toString(void) {}

Added: incubator/tuscany/cpp/das/das_java_classes/RelationshipImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/RelationshipImpl.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/RelationshipImpl.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/RelationshipImpl.h Fri May 11 14:36:45 2007
@@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef RELATIONSHIP_IMPL_H
+#define RELATIONSHIP_IMPL_H
+
+#include <string>
+
+#include "Relationship.h"
+#include "DASObject.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
+class RelationshipImpl : /*public DataObjectBase,*/ public Relationship {
+
+	protected:
+		const static string NAME_DEFAULT_;  
+		const static string PRIMARY_KEY_TABLE_DEFAULT_;
+		const static string FOREIGN_KEY_TABLE_DEFAULT_;
+		const static bool MANY_DEFAULT_ = false;
+		const static bool KEY_RESTRICTED_DEFAULT_ = false;
+
+		string name;
+		list<KeyPair*>* keyPair;
+		string primaryKeyTable;
+		string foreignKeyTable;
+		bool many;
+		bool keyRestricted;
+		
+	public:
+		const static int KEY_PAIR = 0;
+		const static int NAME = 1;
+		const static int PRIMARY_KEY_TABLE = 2;
+		const static int FOREIGN_KEY_TABLE = 3;
+		const static int MANY = 4;
+		const static int KEY_RESTRICTED = 5;
+		const static int SDO_PROPERTY_COUNT = 6;
+
+		RelationshipImpl(void);
+		virtual ~RelationshipImpl(void);
+		Type* getType(void);
+		list<KeyPair*>* getKeyPair(void);
+		string getName(void);
+		void setName(string newName);
+		string getPrimaryKeyTable(void);
+		void setPrimaryKeyTable(string newPrimaryKeyTable);
+		string getForeignKeyTable(void);
+		void setForeignKeyTable(string newForeignKeyTable);
+		bool isMany(void);
+		void setMany(bool newMany);
+		bool isKeyRestricted(void);
+		void setKeyRestricted(bool newKeyRestricted);
+		//ChangeContext* inverseRemove(DASObject* otherEnd, int propertyIndex, ChangeContext* changeContext);
+		DASObject* get(int propertyIndex, bool resolve);
+		void set(int propertyIndex, DASObject* newValue);
+		void unset(int propertyIndex);
+		bool isSet(int propertyIndex);
+		string toString(void);
+		
+  
+
+};
+
+#endif //RELATIONSHIP_IMPL_H
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef RELATIONSHIP_IMPL_H
+#define RELATIONSHIP_IMPL_H
+
+#include <string>
+
+#include "Relationship.h"
+#include "DASObject.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
+class RelationshipImpl : /*public DataObjectBase,*/ public Relationship {
+
+	protected:
+		const static string NAME_DEFAULT_;  
+		const static string PRIMARY_KEY_TABLE_DEFAULT_;
+		const static string FOREIGN_KEY_TABLE_DEFAULT_;
+		const static bool MANY_DEFAULT_ = false;
+		const static bool KEY_RESTRICTED_DEFAULT_ = false;
+
+		string name;
+		list<KeyPair*>* keyPair;
+		string primaryKeyTable;
+		string foreignKeyTable;
+		bool many;
+		bool keyRestricted;
+		
+	public:
+		const static int KEY_PAIR = 0;
+		const static int NAME = 1;
+		const static int PRIMARY_KEY_TABLE = 2;
+		const static int FOREIGN_KEY_TABLE = 3;
+		const static int MANY = 4;
+		const static int KEY_RESTRICTED = 5;
+		const static int SDO_PROPERTY_COUNT = 6;
+
+		RelationshipImpl(void);
+		virtual ~RelationshipImpl(void);
+		Type* getType(void);
+		list<KeyPair*>* getKeyPair(void);
+		string getName(void);
+		void setName(string newName);
+		string getPrimaryKeyTable(void);
+		void setPrimaryKeyTable(string newPrimaryKeyTable);
+		string getForeignKeyTable(void);
+		void setForeignKeyTable(string newForeignKeyTable);
+		bool isMany(void);
+		void setMany(bool newMany);
+		bool isKeyRestricted(void);
+		void setKeyRestricted(bool newKeyRestricted);
+		//ChangeContext* inverseRemove(DASObject* otherEnd, int propertyIndex, ChangeContext* changeContext);
+		DASObject* get(int propertyIndex, bool resolve);
+		void set(int propertyIndex, DASObject* newValue);
+		void unset(int propertyIndex);
+		bool isSet(int propertyIndex);
+		string toString(void);
+		
+  
+
+};
+
+#endif //RELATIONSHIP_IMPL_H

Added: incubator/tuscany/cpp/das/das_java_classes/RelationshipWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/RelationshipWrapper.cpp?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/RelationshipWrapper.cpp (added)
+++ incubator/tuscany/cpp/das/das_java_classes/RelationshipWrapper.cpp Fri May 11 14:36:45 2007
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#include "RelationshipWrapper.h"
+
+RelationshipWrapper::RelationshipWrapper(Relationship* r) {
+	relationship = r;
+}
+
+RelationshipWrapper::~RelationshipWrapper(void) {
+}
+
+list<string>* RelationshipWrapper::getForeignKeys(void) {
+	list<string> keys;
+	list<KeyPair*>* keyPairs = relationship->getKeyPair();
+	list<KeyPair*>::iterator i;
+	
+	for (i = keyPairs->begin() ; i != keyPairs->end() ; i++) {
+        keys.insert(i->getForeignKeyColumn());
+    }
+
+    return keys;
+
+}
+
+void RelationshipWrapper::initiateVariables(void) {
+	relationship = NULL;
+}
\ No newline at end of file

Added: incubator/tuscany/cpp/das/das_java_classes/RelationshipWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/RelationshipWrapper.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/RelationshipWrapper.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/RelationshipWrapper.h Fri May 11 14:36:45 2007
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef RELATIONSHIP_WRAPPER_H
+#define RELATIONSHIP_WRAPPER_H
+
+class RelationshipWrapper {
+
+	private:
+		Relationship* relationship;
+
+		void initiateVariables(void);
+
+	public:
+		RelationshipWrapper(Relationship* r);
+		~RelationshipWrapper(void);
+		list<string>* getForeignKeys(void);
+
+};
+
+#endif //RELATIONSHIP_WRAPPER_H
\ No newline at end of file

Added: incubator/tuscany/cpp/das/das_java_classes/ResultDescriptor.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/ResultDescriptor.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/ResultDescriptor.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/ResultDescriptor.h Fri May 11 14:36:45 2007
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef RESULT_DESCRIPTOR_H
+#define RESULT_DESCRIPTOR_H
+
+#include <string>
+
+using namespace std;
+
+virtual class ResultDescriptor {
+
+	public:
+
+  /**
+   * Returns the value of the '<em><b>Column Name</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>Column Name</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>Column Name</em>' attribute.
+   * @see #setColumnName(String)
+   * @generated
+   */
+  string getColumnName(void);
+
+  /**
+   * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnName <em>Column Name</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>Column Name</em>' attribute.
+   * @see #getColumnName()
+   * @generated
+   */
+  void setColumnName(string value);
+
+  /**
+   * Returns the value of the '<em><b>Table Name</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>Table Name</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>Table Name</em>' attribute.
+   * @see #setTableName(String)
+   * @generated
+   */
+  string getTableName(void);
+
+  /**
+   * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getTableName <em>Table Name</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>Table Name</em>' attribute.
+   * @see #getTableName()
+   * @generated
+   */
+  void setTableName(string value);
+
+  /**
+   * Returns the value of the '<em><b>Column Type</b></em>' attribute.
+   * <!-- begin-user-doc -->
+   * <p>
+   * If the meaning of the '<em>Column Type</em>' attribute isn't clear,
+   * there really should be more of a description here...
+   * </p>
+   * <!-- end-user-doc -->
+   * @return the value of the '<em>Column Type</em>' attribute.
+   * @see #setColumnType(String)
+   * @generated
+   */
+  string getColumnType(void);
+
+  /**
+   * Sets the value of the '{@link org.apache.tuscany.das.rdb.config.ResultDescriptor#getColumnType <em>Column Type</em>}' attribute.
+   * <!-- begin-user-doc -->
+   * <!-- end-user-doc -->
+   * @param value the new value of the '<em>Column Type</em>' attribute.
+   * @see #getColumnType()
+   * @generated
+   */
+  void setColumnType(string value);
+
+}; // ResultDescriptor
+
+
+#endif //RESULT_DESCRIPTOR_H

Added: incubator/tuscany/cpp/das/das_java_classes/ResultDescriptorImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/ResultDescriptorImpl.cpp?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/ResultDescriptorImpl.cpp (added)
+++ incubator/tuscany/cpp/das/das_java_classes/ResultDescriptorImpl.cpp Fri May 11 14:36:45 2007
@@ -0,0 +1,217 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "ResultDescriptorImpl.h"
+
+ResultDescriptorImpl::ResultDescriptorImpl(void) {
+	tableName = TABLE_NAME_DEFAULT_;
+	columnName = COLUMN_NAME_DEFAULT_;
+	columnType = COLUMN_TYPE_DEFAULT_;
+
+}
+
+ResultDescriptorImpl::~ResultDescriptorImpl(void) {
+}
+
+Type* ResultDescriptorImpl::getType(void) {
+	return ((ConfigFactoryImpl*) ConfigFactory::INSTANCE).getResultDescriptor();
+}
+
+string ResultDescriptorImpl::getColumnName(void) {
+	return columnName;
+}
+
+void ResultDescriptorImpl::setColumnName(string newColumnName) {
+	columnName = newColumnName;
+}
+
+string ResultDescriptorImpl::getTableName(void) {
+	return tableName;
+}
+
+void ResultDescriptorImpl::setTableName(string newTableName) {
+	tableName = newTableName;
+}
+
+string ResultDescriptorImpl::getColumnType(void) {
+	return columnType;
+}
+
+void ResultDescriptorImpl::setColumnType(string newColumnType) {
+	columnType = newColumnType;
+}
+
+DASObject* ResultDescriptorImpl::get(int propertyIndex, bool resolve) {
+	/*switch (propertyIndex)
+    {
+      case COLUMN_NAME:
+        return getColumnName();
+      case TABLE_NAME:
+        return getTableName();
+      case COLUMN_TYPE:
+        return getColumnType();
+    }
+    return super.get(propertyIndex, resolve);*/
+}
+
+void ResultDescriptorImpl::set(int propertyIndex, DASObject* newValue) {
+	/*switch (propertyIndex)
+    {
+      case COLUMN_NAME:
+        setColumnName((String)newValue);
+        return;
+      case TABLE_NAME:
+        setTableName((String)newValue);
+        return;
+      case COLUMN_TYPE:
+        setColumnType((String)newValue);
+        return;
+    }
+    super.set(propertyIndex, newValue);*/
+}
+
+void ResultDescriptorImpl::unset(int propertyIndex) {
+	/*switch (propertyIndex)
+    {
+      case COLUMN_NAME:
+        setColumnName(COLUMN_NAME_DEFAULT_);
+        return;
+      case TABLE_NAME:
+        setTableName(TABLE_NAME_DEFAULT_);
+        return;
+      case COLUMN_TYPE:
+        setColumnType(COLUMN_TYPE_DEFAULT_);
+        return;
+    }
+    super.unset(propertyIndex);*/
+}
+
+bool ResultDescriptorImpl::isSet(int propertyIndex) {
+	/*switch (propertyIndex)
+    {
+      case COLUMN_NAME:
+        return COLUMN_NAME_DEFAULT_ == null ? columnName != null : !COLUMN_NAME_DEFAULT_.equals(columnName);
+      case TABLE_NAME:
+        return TABLE_NAME_DEFAULT_ == null ? tableName != null : !TABLE_NAME_DEFAULT_.equals(tableName);
+      case COLUMN_TYPE:
+        return COLUMN_TYPE_DEFAULT_ == null ? columnType != null : !COLUMN_TYPE_DEFAULT_.equals(columnType);
+    }
+    return super.isSet(propertyIndex);*/
+}
+
+//string ResultDescriptorImpl::toString(void) {}
+#include "ResultDescriptorImpl.h"
+
+ResultDescriptorImpl::ResultDescriptorImpl(void) {
+	tableName = TABLE_NAME_DEFAULT_;
+	columnName = COLUMN_NAME_DEFAULT_;
+	columnType = COLUMN_TYPE_DEFAULT_;
+
+}
+
+ResultDescriptorImpl::~ResultDescriptorImpl(void) {
+}
+
+Type* ResultDescriptorImpl::getType(void) {
+	return ((ConfigFactoryImpl*) ConfigFactory::INSTANCE).getResultDescriptor();
+}
+
+string ResultDescriptorImpl::getColumnName(void) {
+	return columnName;
+}
+
+void ResultDescriptorImpl::setColumnName(string newColumnName) {
+	columnName = newColumnName;
+}
+
+string ResultDescriptorImpl::getTableName(void) {
+	return tableName;
+}
+
+void ResultDescriptorImpl::setTableName(string newTableName) {
+	tableName = newTableName;
+}
+
+string ResultDescriptorImpl::getColumnType(void) {
+	return columnType;
+}
+
+void ResultDescriptorImpl::setColumnType(string newColumnType) {
+	columnType = newColumnType;
+}
+
+DASObject* ResultDescriptorImpl::get(int propertyIndex, bool resolve) {
+	/*switch (propertyIndex)
+    {
+      case COLUMN_NAME:
+        return getColumnName();
+      case TABLE_NAME:
+        return getTableName();
+      case COLUMN_TYPE:
+        return getColumnType();
+    }
+    return super.get(propertyIndex, resolve);*/
+}
+
+void ResultDescriptorImpl::set(int propertyIndex, DASObject* newValue) {
+	/*switch (propertyIndex)
+    {
+      case COLUMN_NAME:
+        setColumnName((String)newValue);
+        return;
+      case TABLE_NAME:
+        setTableName((String)newValue);
+        return;
+      case COLUMN_TYPE:
+        setColumnType((String)newValue);
+        return;
+    }
+    super.set(propertyIndex, newValue);*/
+}
+
+void ResultDescriptorImpl::unset(int propertyIndex) {
+	/*switch (propertyIndex)
+    {
+      case COLUMN_NAME:
+        setColumnName(COLUMN_NAME_DEFAULT_);
+        return;
+      case TABLE_NAME:
+        setTableName(TABLE_NAME_DEFAULT_);
+        return;
+      case COLUMN_TYPE:
+        setColumnType(COLUMN_TYPE_DEFAULT_);
+        return;
+    }
+    super.unset(propertyIndex);*/
+}
+
+bool ResultDescriptorImpl::isSet(int propertyIndex) {
+	/*switch (propertyIndex)
+    {
+      case COLUMN_NAME:
+        return COLUMN_NAME_DEFAULT_ == null ? columnName != null : !COLUMN_NAME_DEFAULT_.equals(columnName);
+      case TABLE_NAME:
+        return TABLE_NAME_DEFAULT_ == null ? tableName != null : !TABLE_NAME_DEFAULT_.equals(tableName);
+      case COLUMN_TYPE:
+        return COLUMN_TYPE_DEFAULT_ == null ? columnType != null : !COLUMN_TYPE_DEFAULT_.equals(columnType);
+    }
+    return super.isSet(propertyIndex);*/
+}
+
+//string ResultDescriptorImpl::toString(void) {}

Added: incubator/tuscany/cpp/das/das_java_classes/ResultDescriptorImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/ResultDescriptorImpl.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/ResultDescriptorImpl.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/ResultDescriptorImpl.h Fri May 11 14:36:45 2007
@@ -0,0 +1,132 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef RESULT_DESCRIPTOR_IMPL_H
+#define RESULT_DESCRIPTOR_IMPL_H
+
+#include <string>
+
+#include "ResultDescriptor.h"
+#include "DASObject.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
+class ResultDescriptorImpl : /*public DataObjectBase,*/ public ResultDescriptor {
+  
+	protected:
+		const static string COLUMN_NAME_DEFAULT_;
+		const static string TABLE_NAME_DEFAULT_;
+		const static string COLUMN_TYPE_DEFAULT_;
+
+		string tableName;
+		string columnName;
+		string columnType;
+
+	public:
+		const static int COLUMN_NAME = 0;
+		const static int TABLE_NAME = 1;  
+		const static int COLUMN_TYPE = 2;
+		const static int SDO_PROPERTY_COUNT = 3;
+
+		ResultDescriptorImpl(void);
+		virtual ~ResultDescriptorImpl(void);
+		Type* getType(void);
+		string getColumnName(void);
+		void setColumnName(string newColumnName);
+		string getTableName(void);
+		void setTableName(string newTableName);
+		string getColumnType(void);
+		void setColumnType(string newColumnType);
+		DASObject* get(int propertyIndex, bool resolve);
+		void set(int propertyIndex, DASObject* newValue);
+		void unset(int propertyIndex);
+		bool isSet(int propertyIndex);
+		//string toString(void);
+
+};
+
+#endif //RESULT_DESCRIPTOR_IMPL_H
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef RESULT_DESCRIPTOR_IMPL_H
+#define RESULT_DESCRIPTOR_IMPL_H
+
+#include <string>
+
+#include "ResultDescriptor.h"
+#include "DASObject.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
+class ResultDescriptorImpl : /*public DataObjectBase,*/ public ResultDescriptor {
+  
+	protected:
+		const static string COLUMN_NAME_DEFAULT_;
+		const static string TABLE_NAME_DEFAULT_;
+		const static string COLUMN_TYPE_DEFAULT_;
+
+		string tableName;
+		string columnName;
+		string columnType;
+
+	public:
+		const static int COLUMN_NAME = 0;
+		const static int TABLE_NAME = 1;  
+		const static int COLUMN_TYPE = 2;
+		const static int SDO_PROPERTY_COUNT = 3;
+
+		ResultDescriptorImpl(void);
+		virtual ~ResultDescriptorImpl(void);
+		Type* getType(void);
+		string getColumnName(void);
+		void setColumnName(string newColumnName);
+		string getTableName(void);
+		void setTableName(string newTableName);
+		string getColumnType(void);
+		void setColumnType(string newColumnType);
+		DASObject* get(int propertyIndex, bool resolve);
+		void set(int propertyIndex, DASObject* newValue);
+		void unset(int propertyIndex);
+		bool isSet(int propertyIndex);
+		//string toString(void);
+
+};
+
+#endif //RESULT_DESCRIPTOR_IMPL_H

Added: incubator/tuscany/cpp/das/das_java_classes/ResultMetadata.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/ResultMetadata.cpp?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/ResultMetadata.cpp (added)
+++ incubator/tuscany/cpp/das/das_java_classes/ResultMetadata.cpp Fri May 11 14:36:45 2007
@@ -0,0 +1,290 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#include "ResultMetadata.h"
+
+ResultMetadata::ResultMetadata(ResultSet& rs, MappingWrapper& cfgWrapper, ResultSetShape& shape) {
+	resultSet = rs;
+    configWrapper = cfgWrapper;
+
+    if (shape == NULL) {
+        resultSetShape = *(new ResultSetShape(rs.getMetaData()));
+    } else {
+        resultSetShape = shape;
+    }
+
+    converters = new Converter[resultSetShape.getColumnCount()];
+
+    map<string, string> impliedRelationships;
+
+    for (int i = 1; i <= resultSetShape.getColumnCount(); i++) {
+        string tableName = resultSetShape.getTableName(i);
+
+        if (( tableName == NULL ) || ( tableName[0] == '\0')) {
+            //throw new RuntimeException("Unable to obtain table information from JDBC. DAS configuration must specify ResultDescriptors");
+        }
+        
+        string typeName = configWrapper->getTableTypeName(tableName);
+        string columnName = resultSetShape->getColumnName(i);
+		string lower = columnName.c_str();
+		toLower(lower);
+
+		if (columnName.find("_ID", 0) != string::npos) {
+            impliedRelationships.insert(make_pair(columnName, tableName));
+
+        } else if (strcmp(lower, "id") == 0) {
+            configWrapper->addImpliedPrimaryKey(tableName, columnName);
+        }
+
+        string propertyName = configWrapper->getColumnPropertyName(tableName, columnName);
+        string converterName = configWrapper->getConverter(tableName, resultSetShape.getColumnName(i));
+
+        converters[i - 1] = loadConverter(converterName);
+
+        typeNames.insert(typeName.c_str());
+        propertyNames.insert(propertyName.c_str());
+
+		map<string, list<string>*> i = tableToPropertyMap.find(typeName);
+        list<string>& properties = NULL;
+
+        if (i == tableToPropertyMap.end()) {
+            properties = *(new list<string>);
+		} else {
+			properties = i->second;
+		}
+
+        properties.insert(propertyName);
+        tableToPropertyMap.insert(make_pair(typeName, properties));
+
+    }
+
+	map<string, string>::iterator j;
+    Iterator i = impliedRelationships.keySet().iterator();
+
+	for (j = impliedRelationships.begin() ; j != impliedRelationships.end() ; j++) {
+        string columnName = (string) j->fist;
+
+        string pkTableName = columnName.substr(0, columnName.find("_ID"));
+        string fkTableName = j->second;
+
+		map<string, list<string>*> mapIter = tableToPropertyMap.find(pkTableName);
+		list<string>& pkTableProperties = NULL;
+
+        if (mapIter != tableToPropertyMap.end()) {
+			pkTableProperties = mapIter->second;
+
+			if (pkTableProperties.find("ID") != string::npos) {
+				configWrapper.addImpliedRelationship(pkTableName, fkTableName, columnName);
+			}
+
+        }
+
+    }
+    // Add any tables defined in the model but not included in the ResultSet
+    // to the list of propertyNames
+    Config model = configWrapper.getConfig();
+    if (model != NULL) {
+
+        list<Table*>& tablesFromModel = model.getTable();
+		list<Table*>::iterator i;
+
+		for (i = tablesFromModel.begin() ; i != tablesFromModel.end() ; i++) {
+            TableWrapper t(*i);
+			list<string> emptyList;
+
+            if (tableToPropertyMap.find(t.getTypeName()) == tableToPropertyMap.end()) {
+                tableToPropertyMap.insert(make_pair(t.getTypeName(), emptyList));
+            }
+
+        }
+
+    }
+
+}
+
+ResultMetadata::~ResultMetadata(void) {
+}
+
+string ResultMetadata::getColumnPropertyName(int i) {
+	return propertyNames.at(i - 1);	
+}
+
+string ResultMetadata::getDatabaseColumnName(int i) {
+	return resultSetShape.getColumnName(i);
+}
+
+string ResultMetadata::getTableName(string columnName) {
+	list<string>::iterator i;
+	int index = -1;
+	int j;
+
+	for (j = 0, i = propertyNames.begin() ; i != propertyNames.end() ; i++, j++) {
+
+		if (strcmp(columnName, *i) == 0) {
+			index = j;
+			break;
+
+		}
+
+	}
+
+	if (index == -1) {
+		return NULL;
+	}
+
+	return *(typeNames.at(index));
+
+}
+
+int ResultMetadata::getTableSize(string tableName) {
+	return (((map<string, list<string>*>::iterator) tableToPropertyMap.find(tableName))->second).size();
+}
+
+Type& ResultMetadata::getDataType(string columnName) {
+	list<string>::iterator i;
+	int index = -1;
+	int j;
+
+	for (j = 0, i = propertyNames.begin() ; i != propertyNames.end() ; i++, j++) {
+
+		if (strcmp(columnName, *i) == 0) {
+			index = j;
+			break;
+
+		}
+
+	}
+
+	if (index == -1) {
+		return NULL;
+	}
+
+	return resultSetShape.getColumnType(index);
+
+}
+
+string ResultMetadata::getTablePropertyName(int i) {
+	return typeNames.at(i - 1);
+}
+
+list<string>& ResultMetadata::getAllTablePropertyNames(void) {
+	list<string> res;
+	map<string, list<string>*>::iterator i;
+
+	for (i = tableToPropertyMap.begin() ; i != tableToPropertyMap.end() ; i++) {
+		res.insert(i->second);
+	}
+	
+	return res;
+
+}
+
+//string ResultMetadata::toString(void) {}
+
+int ResultMetadata::getNumberOfTables(void) {
+	return tableToPropertyMap.size();
+}
+
+bool ResultMetadata::isPKColumn(int i) {
+	Table& t = configWrapper.getTableByTypeName(getTablePropertyName(i));
+
+    if (t == NULL) {
+        return true;
+    }
+
+    // If no Columns have been defined, consider every column to be part of
+    // the PK
+    if (t.getColumn().size() == 0) {
+        return true;
+    }
+
+    Column& c = configWrapper.getColumn(t, getDatabaseColumnName(i));
+
+    if (c == NULL) {
+        return false;
+    }
+
+    if (c.isPrimaryKey()) {
+        return true;
+    }
+
+    return false;
+
+}
+
+Type& ResultMetadata::getDataType(int i) {
+	return resultSetShape.getColumnType(i);
+}
+
+list<string>& ResultMetadata::getPropertyNames(string tableName) {
+	return ((map<string, list<string>*>::iterator) tableToPropertyMap.find(tableName))->second;
+}
+
+ResultSet& ResultMetadata::getResultSet(void) {
+	return resultSet;
+}
+
+int ResultMetadata::getResultSetSize(void) {
+	return resultSetShape.getColumnCount();
+}
+
+bool ResultMetadata::isRecursive(void) {
+	return configWrapper.hasRecursiveRelationships();
+}
+
+Converter& ResultMetadata::getConverter(int i) {
+	return converters[i - 1];
+}
+
+Converter& ResultMetadata::loadConverter(string converterName) {
+	if (converterName != NULL) {
+
+        //try {
+            //Class converterClazz = Class.forName(converterName, true, 
+              //      Thread.currentThread().getContextClassLoader());
+            if (NULL != converterClazz) {
+                //return (Converter) converterClazz.newInstance();
+            }
+
+            //converterClazz = Class.forName(converterName);
+            if (converterClazz != NULL) {
+                //return (Converter) converterClazz.newInstance();
+            }
+        //} catch (ClassNotFoundException ex) {
+          //  throw new RuntimeException(ex);
+        //} catch (IllegalAccessException ex) {
+          //  throw new RuntimeException(ex);
+        //} catch (InstantiationException ex) {
+          //  throw new RuntimeException(ex);
+        //}
+
+    }
+
+    return *(new DefaultConverter());
+
+}
+
+void DASImpl::toLower(string string) {
+	int i;
+	int stringSize = strlen(string);
+
+	for (i = 0 ; i < stringSize ; i++) {
+		string[i] = tolower(string[i]);
+	}
+
+}
\ No newline at end of file

Added: incubator/tuscany/cpp/das/das_java_classes/ResultMetadata.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/ResultMetadata.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/ResultMetadata.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/ResultMetadata.h Fri May 11 14:36:45 2007
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef RESULT_METADATA_H
+#define RESULT_METADATA_H
+
+#include <map>
+#include <string>
+
+#include "ResultSet.h"
+#include "DASImpl.h"
+#include "ResultSetShape.h"
+#include "MappingWrapper.h"
+#include "Converter.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
+class ResultMetadata {
+
+	private:
+		map<string, list<string>*> tableToPropertyMap;
+		list<string> typeNames;
+		list<string> propertyNames;
+		ResultSet* resultSet;
+		ResultSetShape* resultSetShape;
+		MappingWrapper* configWrapper;
+		Converter** converters;
+		int convertersCount;
+
+		Converter* loadConverter(string converterName);
+		void toLower(string string);
+
+	public:
+		ResultMetadata(ResultSet* rs, MappingWrapper* cfgWrapper, ResultSetShape* shape);
+		~ResultMetadata(void);
+		string getColumnPropertyName(int i);
+		string getDatabaseColumnName(int i);
+		string getTableName(string columnName);
+		int getTableSize(string tableName);
+		Type* getDataType(string columnName);
+		string getTablePropertyName(int i);
+		list<string>* getAllTablePropertyNames(void);
+		//string toString(void);
+		int getNumberOfTables(void);
+		bool isPKColumn(int i);
+		Type* getDataType(int i);
+		list<string>* getPropertyNames(string tableName);
+		ResultSet* getResultSet(void);
+		int getResultSetSize(void);
+		bool isRecursive(void);
+		Converter* getConverter(int i);
+
+};
+
+#endif //RESULT_METADATA_H

Added: incubator/tuscany/cpp/das/das_java_classes/ResultSet.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/ResultSet.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/ResultSet.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/ResultSet.h Fri May 11 14:36:45 2007
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef RESULT_SET_H
+#define RESULT_SET_H
+
+class ResultSet {
+};
+
+#endif
\ No newline at end of file

Added: incubator/tuscany/cpp/das/das_java_classes/ResultSetMetaData.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/ResultSetMetaData.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/ResultSetMetaData.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/ResultSetMetaData.h Fri May 11 14:36:45 2007
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef RESULT_SET_META_DATA_H
+#define RESULT_SET_META_DATA_H
+
+class ResultSetMetaData {
+};
+
+#endif
\ No newline at end of file

Added: incubator/tuscany/cpp/das/das_java_classes/ResultSetShape.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/ResultSetShape.cpp?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/ResultSetShape.cpp (added)
+++ incubator/tuscany/cpp/das/das_java_classes/ResultSetShape.cpp Fri May 11 14:36:45 2007
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#include "ResultSetShape.h"
+
+//ResultSetShape::ResultSetShape(ResultSetMetaData* metadata) { /*throws SQLException*/
+//	columnsLength = metadata->getColumnCount();
+//	columns = char[columnsLength]*;
+//
+//	tablesLength = metadata->getColumnCount();
+//    tables = char[tablesLength]*;
+//
+//	typesLength = metadata->getColumnCount();
+//    types = Type[typesLength]*;
+//
+//    ResultSetTypeMap typeMap = ResultSetTypeMap.INSTANCE;
+//    for (int i = 1; i <= metadata->getColumnCount(); i++) {
+//        tables[i - 1] = metadata->getTableName(i);
+//        columns[i - 1] = metadata->getColumnName(i);
+//        types[i - 1] = typeMap.getType(metadata->getColumnType(i), 1);
+//
+//    }
+//
+//}
+
+ResultSetShape::ResultSetShape(vector<ResultDescriptor*>* resultDescriptor) {
+	TypeHelper helper = TypeHelper.INSTANCE;
+    int size = resultDescriptor->size();
+	columnsLength = size;
+	tablesLength = size;
+	typesLength = size;
+    columns = char[size]*;
+    tables = char[size]*;
+    types = Type[size]*;
+
+    for (int i = 0; i < size; i++) {
+        ResultDescriptor* desc = (ResultDescriptor*) resultDescriptor.at(i);
+        tables[i] = desc->getTableName();
+        columns[i] = desc->getColumnName();
+
+        int idx = ((string) desc->getColumnType()).find_last_of('.');
+        string uri = (string) ((string) desc->getColumnType()).substr(0, idx);
+        string typeName = (string) ((string) desc->getColumnType()).substr(idx + 1);
+
+        types[i] = helper->getType(uri, typeName);
+        if (types[i] == NULL) {
+            //throw new RuntimeException("Could not find type " + desc.getColumnType() 
+              //      + " for column " + desc.getColumnName());
+        }
+
+    }
+
+}
+
+ResultSetShape::~ResultSetShape() {
+}
+
+int ResultSetShape::getColumnCount(void) {
+	columnsLength;
+}
+
+string ResultSetShape::getTableName(int i) {
+	return tables[i - 1];
+}
+
+string ResultSetShape::getColumnName(int i) {
+	return columns[i - 1];
+}
+
+Type* ResultSetShape::getColumnType(int i) {
+	return types[i - 1];
+}
+
+//string ResultSetShape::toString(void) {}

Added: incubator/tuscany/cpp/das/das_java_classes/ResultSetShape.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/ResultSetShape.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/ResultSetShape.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/ResultSetShape.h Fri May 11 14:36:45 2007
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef RESULT_SET_SHAPE_H
+#define RESULT_SET_SHAPE_H
+
+#include <vector>
+#include <windows.h>
+#include <sql.h>
+
+#include "ResultSetMetaData.h"
+#include "ResultDescriptor.h"
+//#include "ResultSetTypeMap.h"
+//#include "TypeHelper.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
+class ResultSetShape {
+
+	private:
+		string* columns;
+		string* tables;
+		Type** types;
+		int columnsLength;
+		int tablesLength;
+		int typesLength;
+		
+
+	public:
+		//ResultSetShape(ResultSetMetaData* metadata); /*throws SQLException*/
+		ResultSetShape(vector<ResultDescriptor*>* resultDescriptor);
+		~ResultSetShape();
+		int getColumnCount(void);
+		string getTableName(int i);
+		string getColumnName(int i);
+		Type* getColumnType(int i);
+		//string toString(void);
+
+
+};
+
+#endif //RESULT_SET_SHAPE_H

Added: incubator/tuscany/cpp/das/das_java_classes/SDODataTypeHelper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/SDODataTypeHelper.cpp?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/SDODataTypeHelper.cpp (added)
+++ incubator/tuscany/cpp/das/das_java_classes/SDODataTypeHelper.cpp Fri May 11 14:36:45 2007
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#include "SDODataTypeHelper.h"
+
+#include <sql>
+
+static int SDODataTypeHelper::sqlTypeFor(Type* sdoType) {
+
+	if (sdoType == NULL) {
+        return SQL_C_DEFAULT;
+    }
+
+	switch (sdoType) {
+
+		case Types::BigDecimalType :
+			return SQL_C_DEFAULT;
+
+		case Types::BigIntegerType :
+			return SQL_C_SBIGINT;
+
+		case Types::BooleanType :
+			return SQL_C_DEFAULT;
+
+		case Types::ByteType :
+			return SQL_C_BINARY;
+
+		case Types::BytesType :
+			return SQL_C_DEFAULT;
+
+		case Types::CharacterType :
+			return SQL_C_CHAR;
+
+		case Types::DateType :
+			return SQL_C_DATE;
+
+		case Types::DoubleType :
+			return SQL_C_DOUBLE;
+
+		case Types::FloatType :
+			return SQL_C_FLOAT;
+
+		case Types::IntegerType :
+			return SQL_C_DEFAULT;
+
+		case Types::LongType :
+			return SQL_C_LONG;
+
+		case Types::ShortType :
+			return SQL_C_SHORT;
+
+		case Types::StringType :
+			return SQL_C_CHAR;
+
+		case Types::UriType :
+			return SQL_C_DEFAULT;
+			
+		case Types::DataObjectType :
+			return SQL_C_DEFAULT;
+
+		case ChangeSummaryType :
+			return SQL_C_DEFAULT;
+
+		case TextType :
+			return SQL_C_DEFAULT;
+
+		case OpenDataObjectType :
+			return SQL_C_DEFAULT;
+
+		default:
+			return SQL_C_DEFAULT;
+		
+	}
+
+}
\ No newline at end of file

Added: incubator/tuscany/cpp/das/das_java_classes/SDODataTypeHelper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/SDODataTypeHelper.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/SDODataTypeHelper.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/SDODataTypeHelper.h Fri May 11 14:36:45 2007
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef S_D_O_DATA_TYPE_HELPER_H
+#define S_D_O_DATA_TYPE_HELPER_H
+
+#include <sql.h>
+
+#include "commonj/sdo/DataFactory.h"
+
+#include "SDODataTypes.h"
+
+using namespace commonj::sdo;
+
+class SDODataTypeHelper {
+
+	public:
+		static int sqlTypeFor(Type* sdoType);
+
+};
+
+#endif //S_D_O_DATA_TYPE_HELPER_H
\ No newline at end of file

Added: incubator/tuscany/cpp/das/das_java_classes/SDODataTypes.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/SDODataTypes.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/SDODataTypes.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/SDODataTypes.h Fri May 11 14:36:45 2007
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef S_D_O_DATA_TYPES_H
+#define S_D_O_DATA_TYPES_H
+
+#include <sql.h>
+
+class SDODataTypes {
+
+	public:
+		/*static TypeHelper TYPE_HELPER = TypeHelper.INSTANCE;
+
+		static Type BOOLEAN = TYPE_HELPER.getType("commonj.sdo", "Boolean");
+
+		static Type BYTE = TYPE_HELPER.getType("commonj.sdo", "Byte");
+
+		static Type BYTES = TYPE_HELPER.getType("commonj.sdo", "Bytes");
+
+		static Type CHARACTER = TYPE_HELPER.getType("commonj.sdo", "Character");
+
+		static Type DATE = TYPE_HELPER.getType("commonj.sdo", "Date");
+
+		static Type DATETIME = TYPE_HELPER.getType("commonj.sdo", "Date");
+
+		static Type DAY = TYPE_HELPER.getType("commonj.sdo", "Date");
+
+		static Type DECIMAL = TYPE_HELPER.getType("commonj.sdo", "Float");
+
+		static Type DOUBLE = TYPE_HELPER.getType("commonj.sdo", "Double");
+
+		static Type DURATION = TYPE_HELPER.getType("commonj.sdo", "Date");
+
+		static Type FLOAT = TYPE_HELPER.getType("commonj.sdo", "Float");
+
+		static Type INT = TYPE_HELPER.getType("commonj.sdo", "Int");
+
+		static Type INTEGER = TYPE_HELPER.getType("commonj.sdo", "Integer");
+
+		static Type LONG = TYPE_HELPER.getType("commonj.sdo", "Long");
+
+		static Type MONTH = TYPE_HELPER.getType("commonj.sdo", "Date");
+
+		static Type MONTHDAY = TYPE_HELPER.getType("commonj.sdo", "Date");
+
+		static Type OBJECT = TYPE_HELPER.getType("commonj.sdo", "Object");
+
+		static Type SHORT = TYPE_HELPER.getType("commonj.sdo", "Short");
+
+		static Type STRING = TYPE_HELPER.getType("commonj.sdo", "String");
+
+		static Type STRINGS = TYPE_HELPER.getType("commonj.sdo", "String");
+
+		static Type TIME = TYPE_HELPER.getType("commonj.sdo", "Date");
+
+		static Type URI = TYPE_HELPER.getType("commonj.sdo", "String");
+
+		static Type YEAR = TYPE_HELPER.getType("commonj.sdo", "Date");
+
+		static Type YEARMONTH = TYPE_HELPER.getType("commonj.sdo", "Date");
+
+		static Type YEARMONTHDAY = TYPE_HELPER.getType("commonj.sdo", "Date");
+
+		static Type BOOLEANOBJECT = TYPE_HELPER.getType("commonj.sdo", "BooleanObject");
+
+		static Type BYTEOBJECT = TYPE_HELPER.getType("commonj.sdo", "ByteObject");
+
+		static Type CHARACTEROBJECT = TYPE_HELPER.getType("commonj.sdo", "CharacterObject");
+
+		static Type DOUBLEOBJECT = TYPE_HELPER.getType("commonj.sdo", "DoubleObject");
+
+		static Type FLOATOBJECT = TYPE_HELPER.getType("commonj.sdo", "FloatObject");
+
+		static Type INTEGEROBJECT = TYPE_HELPER.getType("commonj.sdo", "IntObject");
+
+		static Type LONGOBJECT = TYPE_HELPER.getType("commonj.sdo", "LongObject");
+
+		static Type SHORTOBJECT = TYPE_HELPER.getType("commonj.sdo", "ShortObject");*/
+
+};
+
+#endif //S_D_O_DATA_TYPES_H
\ No newline at end of file

Added: incubator/tuscany/cpp/das/das_java_classes/SPCommandImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/SPCommandImpl.cpp?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/SPCommandImpl.cpp (added)
+++ incubator/tuscany/cpp/das/das_java_classes/SPCommandImpl.cpp Fri May 11 14:36:45 2007
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#include "SPCommandImpl.h"
+
+SPCommandImpl::SPCommandImpl(string sqlString, MappingWrapper* config, list<Parameter*>* params) {
+	super(sqlString, config, NULL);
+
+	list<Parameter*>::iterator i;
+	for (i = params->begin() ; i != params->end() ; i++) {
+
+        int index = ((string) *i->getColumnType()).find_last_of('.');
+        string pkg = (string) ((string) *i->getColumnType()).substr(0, index);
+        string typeName = (string) ((string) *i->getColumnType()).substr(index + 1);
+
+        Type* sdoType = TypeHelper.INSTANCE.getType(pkg, typeName);
+
+        int direction = ParameterImpl.IN;
+        if (strcmp("OUT", toLower(*i->getDirection())) == 0) {
+            direction = ParameterImpl.OUT;
+        } else if (strcmp("INOUT", toLower(*i->getDirection())) == 0) {
+            direction = ParameterImpl.IN_OUT;
+        }
+
+        parameters.findOrCreateParameterWithIndex(p->getIndex(), direction, sdoType);
+
+    }
+
+}
+
+SPCommandImpl::~SPCommandImpl(void) {
+}
+
+DataObject* SPCommandImpl::executeQuery(void) {
+	int success = 0;
+
+    //try {
+        list<ResultSet*>* results = statement->executeCall(parameters);
+        success = 1;
+
+        return buildGraph(results);
+
+    //} catch (SQLException e) {
+
+        /*if (this.logger.isDebugEnabled()) {
+            this.logger.debug(e);
+        }*/
+
+      //  throw new RuntimeException(e);
+    //} finally {
+        if (success) {
+            statement->getConnection()->cleanUp();
+        } else {
+            statement->getConnection()->errorCleanUp();
+        }
+
+    //}
+
+}
+
+void SPCommandImpl::execute(void) {
+	int success = 0;
+    //try {
+        statement->executeUpdateCall(parameters);
+        success = 1;
+
+    //} catch (SQLException e) {
+        //throw new RuntimeException(e);
+    //} finally {
+        if (success) {
+            statement->getConnection()->cleanUp();
+        } else {
+            statement->getConnection()->errorCleanUp();
+        }
+
+    //}
+
+}
+
+void DASImpl::toLower(string string) {
+	int i;
+	int stringSize = strlen(string);
+
+	for (i = 0 ; i < stringSize ; i++) {
+		string[i] = tolower(string[i]);
+	}
+
+}
\ No newline at end of file

Added: incubator/tuscany/cpp/das/das_java_classes/SPCommandImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/SPCommandImpl.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/SPCommandImpl.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/SPCommandImpl.h Fri May 11 14:36:45 2007
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef S_P_COMMAND_IMPL_H
+#define S_P_COMMAND_IMPL_H
+
+#include <list>
+#include <string>
+
+#include "ReadCommandImpl.h"
+#include "MappingWrapper.h"
+#include "Parameter.h"
+//#include "TypeHelper.h"
+#include "Parameter.h"
+
+#include "commonj/sdo/DataFactory.h"
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
+class SPCommandImpl : public ReadCommandImpl {
+
+	private:
+		void toLower(string string);
+
+	public:
+		SPCommandImpl(string sqlString, MappingWrapper* config, list<Parameter*>* params);
+		~SPCommandImpl(void);
+		DataObject* executeQuery(void);
+		void execute(void);
+
+};
+
+#endif //S_P_COMMAND_IMPL_H

Added: incubator/tuscany/cpp/das/das_java_classes/Statement.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/Statement.cpp?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/Statement.cpp (added)
+++ incubator/tuscany/cpp/das/das_java_classes/Statement.cpp Fri May 11 14:36:45 2007
@@ -0,0 +1,258 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#include "Statement.h"
+
+Statement::Statement(string sqlString) {
+	queryString = sqlString;	
+}
+
+Statement::~Statement(void) {
+}
+
+list<ResultSet*>* Statement::executeQuery(Parameters* parameters) { /*throws SQLException*/
+	PreparedStatement* ps = getPreparedStatement(NULL, 0);
+    ps = setParameters(ps, parameters);
+    ResultSet* rs = ps->executeQuery();
+	list<ResultSet*> resultSetList;
+	resultSetList.insert(rs);
+
+    return &resultSetList;
+
+}
+
+list<ResultSet*>* Statement::executeCall(Parameters* parameters) { /*throws SQLException*/
+	CallableStatement* cs = jdbcConnection.prepareCall(queryString);
+
+	list<ParameterImpl*>* params = parameters->inParams();
+	list<ParameterImpl*>::iterator i;
+	for (i = params->begin() ; i != params->end() ; i++) {
+        cs->setObject(*i->getIndex(), *i->getValue());
+    }
+
+    // register out parameters
+    list<ParameterImpl*>* outParams = parameters->outParams();
+	for (i = outParams->begin() ; i != outParams->end() ; i++) {
+        
+		/*if (this.logger.isDebugEnabled()) {
+            this.logger.debug("Registering parameter " + param.getName());
+        }*/
+
+        cs->registerOutParameter(*i->getIndex(), SDODataTypeHelper.sqlTypeFor(*i->getType()));
+
+    }
+
+    // Using execute because Derby does not currenlty support
+    // executeQuery
+    // for SP
+    cs->execute();
+    list<ResultSet*> results;
+    results.add(cs->getResultSet());
+
+    while (cs->getMoreResults(java.sql.Statement.KEEP_CURRENT_RESULT)) {
+        results.add(cs->getResultSet());
+    }
+
+    for (i = outParams->begin() ; i != outParams->end() ; i++) {
+        *i->setValue(cs->getObject(*i->getIndex()));
+
+    }
+
+    return &results;
+
+}
+
+void Statement::executeUpdateCall(Parameters* parameters) { /*throws SQLException*/
+	CallableStatement* cs = odbcConnection.prepareCall(queryString);
+
+	list<ParameterImpl*>* inParams = parameters->inParams();
+	list<ParameterImpl*>::iterator i;
+	for (i = inParams->begin() ; i != inParams->end() ; i++) {
+		cs->setObject(*i->getIndex(), *i->getValue());
+	}
+
+	// register out parameters
+	list<ParameterImpl*>* outParams = parameters->outParams();
+	for (i = outParams->begin() ; i != outParams->end() ; i++) {
+		
+		/*if (this.logger.isDebugEnabled()) {
+			this.logger.debug("Registering parameter " + param.getName());
+		}*/
+
+		cs->registerOutParameter(*i->getIndex(), SDODataTypeHelper.sqlTypeFor(*i->getType()));
+
+	}
+
+	cs->execute();
+
+	for (i = outParams->begin() ; i != outParams->end() ; i++) {
+		*i->setValue(cs->getObject(*i->getIndex()));
+	}
+
+}
+
+int Statement::executeUpdate(Parameters* parameters, string* generatedKeys, int keyCount) { /*throws SQLException*/
+	return executeUpdate(getPreparedStatement(generatedKeys, keyCount), parameters);
+}
+
+int Statement::executeUpdate(Parameters* parameters) { /*throws SQLException*/
+	return executeUpdate(parameters, NULL, 0);
+}
+
+void Statement::setConnection(ConnectionImpl* jdbcConnection) {
+	/*if (this.logger.isDebugEnabled()) {
+        this.logger.debug("Executing statement " + queryString);
+    }*/
+
+    list<ParameterImpl*>* inParams = parameters->inParams();
+	list<ParameterImpl*>::iterator i;
+	for (i = inParams->begin() ; i != inParams->end() ; i++) {
+        DASObject value = *i->getValue();
+
+        /*if (this.logger.isDebugEnabled()) {
+            this.logger.debug("Setting parameter " + param.getIndex() + " to " + value);
+        }*/
+
+        if (value == NULL) {
+            if (*i->getType() == NULL) {
+
+                //try {
+                    ParameterMetaData* pmd = ps->getParameterMetaData();
+                    ps->setNull(param->getIndex(), pmd->getParameterType(*i->getIndex()));
+
+                //} catch (SQLException ex) {
+                    ps->setNull(*i->getIndex(), SDODataTypeHelper.sqlTypeFor(NULL));
+                //}
+
+            } else {
+                ps->setNull(*i->getIndex(), SDODataTypeHelper.sqlTypeFor(*i->getType()));
+            }
+
+        } else {
+            ps->setObject(*i->getIndex(), value);
+        }
+
+    }
+
+    return ps->executeUpdate();
+
+}
+ConnectionImpl* Statement::getConnection(void) {
+	return odbcConnection;
+}
+
+int Statement::getGeneratedKey(void) { /*throws SQLException*/
+
+	if (getConnection()->useGetGeneratedKeys()) {
+        ResultSet* rs = preparedStatement->getGeneratedKeys();
+
+        if (rs->next()) {
+            return rs.getInt(1);
+        }
+
+    }
+
+    return NULL;
+
+}
+
+void Statement::close(void) {
+
+	if (preparedStatement != NULL) {
+        
+		//try {
+            preparedStatement->close();
+        //} catch (SQLException e) {
+            //throw new RuntimeException(e);
+        //}
+
+    }
+
+}
+
+PreparedStatement* Statement::setParameters(PreparedStatement* ps, Parameters* parameters) { /*throws SQLException*/
+    list<ParameterImpl*>* inParams = parameters->inParams();
+	list<ParameterImpl*>::iterator i;
+
+	for (i = inParams->begin() ; i != inParams->end() ; i++) {
+        ps->setObject(*i->getIndex(), *i->getValue());
+    }
+
+    return ps;
+
+}
+
+void Statement::enablePaging(void) {
+	isPaging = 1;
+}
+
+int Statement::executeUpdate(PreparedStatement* ps, Parameters* parameters) { /*throws SQLException*/
+	/*if (this.logger.isDebugEnabled()) {
+        this.logger.debug("Executing statement " + queryString);
+    }*/
+
+    list<ParameterImpl*>* inParams = parameters->inParams();
+	list<ParameterImpl*>::iterator i;
+	for (i = inParams->begin() ; i != inParams->end() ; i++) {
+        DASObject value = *i->getValue();
+
+        /*if (this.logger.isDebugEnabled()) {
+            this.logger.debug("Setting parameter " + param.getIndex() + " to " + value);
+        }*/
+
+        if (value == NULL) {
+
+            if (*i->getType() == NULL) {
+
+                //try {
+                    ParameterMetaData pmd = ps->getParameterMetaData();
+                    ps->setNull(*i->getIndex(), pmd->getParameterType(*i->getIndex()));
+
+                //} catch (SQLException ex) {
+                    ps->setNull(*i->getIndex(), SDODataTypeHelper.sqlTypeFor(NULL));
+                //}
+
+            } else {
+                ps->setNull(*i->getIndex(), SDODataTypeHelper.sqlTypeFor(*i->getType()));
+            }
+
+        } else {
+            ps->setObject(*i->getIndex(), value);
+        }
+
+    }
+
+    return ps->executeUpdate();
+
+}
+
+PreparedStatement* Statement::getPreparedStatement(string* returnKeys, int keyCount) { /*throws SQLException*/
+
+	if (preparedStatement == NULL) {
+    
+		if (isPaging) {
+            preparedStatement = jdbcConnection->preparePagedStatement(queryString);
+        } else {
+            preparedStatement = jdbcConnection->prepareStatement(queryString, returnKeys);
+        }
+
+    }
+
+    return preparedStatement;
+
+}
\ No newline at end of file

Added: incubator/tuscany/cpp/das/das_java_classes/Statement.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/Statement.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/Statement.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/Statement.h Fri May 11 14:36:45 2007
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef STATEMENT_H
+#define STATEMENT_H
+
+#include <list>
+#include <windows.h>
+#include <sql.h>
+
+#include "PreparedStatement.h"
+#include "Parameters.h"
+#include "PreparedStatement.h"
+#include "ConnectionImpl.h"
+#include "ResultSet.h"
+#include "CallableStatement.h"
+#include "ParameterImpl.h"
+#include "SDODataTypeHelper.h"
+#include "DASObject.h"
+#include "SDODataTypeHelper.h"
+
+using namespace std;
+
+class Statement {
+	
+	private:
+		PreparedStatement* preparedStatement;
+		int isPaging;
+
+		int executeUpdate(PreparedStatement* ps, Parameters* parameters); /*throws SQLException*/
+		PreparedStatement* getPreparedStatement(string* returnKeys, int keyCount); /*throws SQLException*/
+		
+	protected:
+		string queryString;
+		ConnectionImpl* odbcConnection;
+
+		PreparedStatement* setParameters(PreparedStatement* ps, Parameters* parameters); /*throws SQLException*/
+		void enablePaging(void);
+
+	public:
+		Statement(string sqlString);
+		~Statement(void);
+		list<ResultSet*>* executeQuery(Parameters* parameters); /*throws SQLException*/
+		list<ResultSet*>* executeCall(Parameters* parameters); /*throws SQLException*/
+		void executeUpdateCall(Parameters* parameters); /*throws SQLException*/
+		int executeUpdate(Parameters* parameters, string* generatedKeys, int keyCount); /*throws SQLException*/
+		int executeUpdate(Parameters* parameters); /*throws SQLException*/
+		void setConnection(ConnectionImpl* jdbcConnection);
+		ConnectionImpl* getConnection(void);
+		int getGeneratedKey(void); /*throws SQLException*/
+		void close(void);
+
+};
+
+#endif //STATEMENT_H
\ No newline at end of file

Added: incubator/tuscany/cpp/das/das_java_classes/Table.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/das_java_classes/Table.h?view=auto&rev=537297
==============================================================================
--- incubator/tuscany/cpp/das/das_java_classes/Table.h (added)
+++ incubator/tuscany/cpp/das/das_java_classes/Table.h Fri May 11 14:36:45 2007
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+#ifndef TABLE_H
+#define TABLE_H
+
+#include <list>
+
+#include "Delete.h"
+#include "Update.h"
+#include "Create.h"
+#include "Column.h"
+
+using namespace std;
+
+virtual class Table {
+
+	public:
+		/**
+		* Returns the value of the '<em><b>Column</b></em>' containment reference list.
+		* The list contents are of type {@link org.apache.tuscany.das.rdb.config.Column}.
+		* <!-- begin-user-doc -->
+		* <p>
+		* If the meaning of the '<em>Column</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>Column</em>' containment reference list.
+		* @generated
+		*/
+		list<Column*>* getColumn(void);
+
+		/**
+		* Returns the value of the '<em><b>Create</b></em>' containment reference.
+		* <!-- begin-user-doc -->
+		* <p>
+		* If the meaning of the '<em>Create</em>' containment reference isn't clear,
+		* there really should be more of a description here...
+		* </p>
+		* <!-- end-user-doc -->
+		* @return the value of the '<em>Create</em>' containment reference.
+		* @see #setCreate(Create)
+		* @generated
+		*/
+		Create* getCreate(void);
+
+		/**
+		* Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getCreate <em>Create</em>}' containment reference.
+		* <!-- begin-user-doc -->
+		* <!-- end-user-doc -->
+		* @param value the new value of the '<em>Create</em>' containment reference.
+		* @see #getCreate()
+		* @generated
+		*/
+		void setCreate(Create* value);
+
+		/**
+		* Returns the value of the '<em><b>Update</b></em>' containment reference.
+		* <!-- begin-user-doc -->
+		* <p>
+		* If the meaning of the '<em>Update</em>' containment reference isn't clear,
+		* there really should be more of a description here...
+		* </p>
+		* <!-- end-user-doc -->
+		* @return the value of the '<em>Update</em>' containment reference.
+		* @see #setUpdate(Update)
+		* @generated
+		*/
+		Update* getUpdate(void);
+
+		/**
+		* Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getUpdate <em>Update</em>}' containment reference.
+		* <!-- begin-user-doc -->
+		* <!-- end-user-doc -->
+		* @param value the new value of the '<em>Update</em>' containment reference.
+		* @see #getUpdate()
+		* @generated
+		*/
+		void setUpdate(Update* value);
+
+		Delete* getDelete(void);
+
+		/**
+		* Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getDelete <em>Delete</em>}' containment reference.
+		* <!-- begin-user-doc -->
+		* <!-- end-user-doc -->
+		* @param value the new value of the '<em>Delete</em>' containment reference.
+		* @see #getDelete()
+		* @generated
+		*/
+		void setDelete(Delete* value);
+
+		/**
+		* Returns the value of the '<em><b>Table Name</b></em>' attribute.
+		* <!-- begin-user-doc -->
+		* <p>
+		* If the meaning of the '<em>Table Name</em>' attribute isn't clear,
+		* there really should be more of a description here...
+		* </p>
+		* <!-- end-user-doc -->
+		* @return the value of the '<em>Table Name</em>' attribute.
+		* @see #setTableName(String)
+		* @generated
+		*/
+		string getTableName(void);
+
+		/**
+		* Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getTableName <em>Table Name</em>}' attribute.
+		* <!-- begin-user-doc -->
+		* <!-- end-user-doc -->
+		* @param value the new value of the '<em>Table Name</em>' attribute.
+		* @see #getTableName()
+		* @generated
+		*/
+		void setTableName(string value);
+
+		/**
+		* Returns the value of the '<em><b>Type Name</b></em>' attribute.
+		* <!-- begin-user-doc -->
+		* <p>
+		* If the meaning of the '<em>Type Name</em>' attribute isn't clear,
+		* there really should be more of a description here...
+		* </p>
+		* <!-- end-user-doc -->
+		* @return the value of the '<em>Type Name</em>' attribute.
+		* @see #setTypeName(String)
+		* @generated
+		*/
+		string getTypeName(void);
+
+		/**
+		* Sets the value of the '{@link org.apache.tuscany.das.rdb.config.Table#getTypeName <em>Type Name</em>}' attribute.
+		* <!-- begin-user-doc -->
+		* <!-- end-user-doc -->
+		* @param value the new value of the '<em>Type Name</em>' attribute.
+		* @see #getTypeName()
+		* @generated
+		*/
+		void setTypeName(string value);
+
+}; // Table
+
+
+#endif //TABLE_H
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org