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/11/12 23:03:24 UTC

svn commit: r594314 [5/9] - in /incubator/tuscany/sandbox/crestani/das_distribution_example: ./ bin/ bin/antscripts/ bin/bin/ bin/include/ bin/include/apache/ bin/include/apache/das/ bin/include/apache/das/rdb/ bin/lib/ bin/samples/ bin/samples/Company...

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DASOptimisticConcurrencyControlException.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DASOptimisticConcurrencyControlException.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DASOptimisticConcurrencyControlException.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DASOptimisticConcurrencyControlException.h Mon Nov 12 14:02:46 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.
+ */
+
+/* $Rev: 452786 $ $Date: 2006-10-04 08:57:36 +0100 (Wed, 04 Oct 2006) $ */
+
+#ifndef DAS_OPTIMISTIC_CONCURRENCY_CONTROL_EXCEPTION_H
+#define DAS_OPTIMISTIC_CONCURRENCY_CONTROL_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class DASOptimisticConcurrencyControlException : public std::exception {
+
+	public:
+		DASOptimisticConcurrencyControlException(std::string message = "");
+		virtual ~DASOptimisticConcurrencyControlException(void);
+
+};
+
+		};
+	};
+};
+
+#endif //DAS_OPTIMISTIC_CONCURRENCY_CONTROL_EXCEPTION_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DASPrimaryKeyNotFoundException.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DASPrimaryKeyNotFoundException.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DASPrimaryKeyNotFoundException.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DASPrimaryKeyNotFoundException.h Mon Nov 12 14:02:46 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.
+ */
+
+/* $Rev: 452786 $ $Date: 2006-10-04 08:57:36 +0100 (Wed, 04 Oct 2006) $ */
+
+#ifndef DAS_PRIMARY_KEY_NOT_FOUND_EXCEPTION_H
+#define DAS_PRIMARY_KEY_NOT_FOUND_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class DASPrimaryKeyNotFoundException : public std::exception {
+
+	public:
+		DASPrimaryKeyNotFoundException(std::string message = "");
+		virtual ~DASPrimaryKeyNotFoundException(void);
+
+};
+
+		};
+	};
+};
+
+#endif //DAS_PRIMARY_KEY_NOT_FOUND_EXCEPTION_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DeletedDataObject.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DeletedDataObject.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DeletedDataObject.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/DeletedDataObject.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,49 @@
+/*
+ * 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 DELETED_DATA_OBJECT_H
+#define DELETED_DATA_OBJECT_H
+
+#include "apache/das/rdb/DASDataObject.h"
+
+#include "commonj/sdo/DataObject.h"
+#include "commonj/sdo/SettingList.h"
+#include "commonj/sdo/ChangeSummary.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class ColumnData;
+
+class DeletedDataObject : public DASDataObject {
+
+	public:
+		DeletedDataObject(const Table& table, commonj::sdo::DataObjectPtr dataObject, commonj::sdo::ChangeSummaryPtr changeSummary);
+		~DeletedDataObject(void);
+		
+		std::string getStatement(void) const;
+	
+};
+
+		};
+	};
+};
+
+#endif //DELETED_DATA_OBJECT_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/GraphBuilder.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/GraphBuilder.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/GraphBuilder.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/GraphBuilder.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,59 @@
+/*
+ * 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 GRAPH_BUILDER_H
+#define GRAPH_BUILDER_H
+
+#include "apache/das/rdb/ResultSet.h"
+#include "apache/das/rdb/ConfigImpl.h"
+#include "apache/das/rdb/TableData.h"
+#include "apache/das/rdb/das_constants.h"
+#include "apache/das/rdb/GraphBuilderMetaData.h"
+
+#include "commonj/sdo/DataFactory.h"
+#include "commonj/sdo/DataGraphImpl.h"
+#include "commonj/sdo/DataObject.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class TableData;
+class GraphBuilderMetaData;
+
+class GraphBuilder {
+	private:
+		ResultSet* resultSet;
+		GraphBuilderMetaData* graphBuilderMetaData;
+		commonj::sdo::DataObjectPtr root;
+		std::map<std::string, std::list<TableData*>*> tablesData;
+
+	public:
+		GraphBuilder(const ConfigImpl& config, ResultSetPtr resultSet);
+		virtual ~GraphBuilder(void);
+
+		commonj::sdo::DataObjectPtr GraphBuilder::getRoot(void) const;
+		
+
+};
+
+		};
+	};
+};
+
+#endif //GRAPH_BUILDER_META_DATA_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/GraphBuilderMetaData.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/GraphBuilderMetaData.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/GraphBuilderMetaData.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/GraphBuilderMetaData.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,67 @@
+/*
+ * 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 GRAPH_BUILDER_META_DATA_H
+#define GRAPH_BUILDER_META_DATA_H
+
+#include <string>
+#include <map>
+#include <list>
+
+#include "apache/das/rdb/ResultSet.h"
+#include "apache/das/rdb/Table.h"
+#include "apache/das/rdb/ConfigImpl.h"
+#include "apache/das/rdb/Relationship.h"
+#include "apache/das/rdb/KeyPair.h"
+#include "apache/das/rdb/ResultSetMetaData.h"
+#include "apache/das/rdb/das_constants.h"
+
+#include "commonj/sdo/DataFactory.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class ConfigImpl;
+
+class GraphBuilderMetaData {
+
+	private:
+		const ResultSetMetaData* resultSetMetaData;
+		std::map<std::string, Table*>* graphTables;
+		std::map<std::string, Relationship*>* relationships;
+		const ConfigImpl* config;
+
+	public:
+		GraphBuilderMetaData(const ConfigImpl& config, const ResultSetMetaData& resultSet);
+		virtual ~GraphBuilderMetaData(void);
+
+		const ResultSetMetaData& getResultSetMetaData(void) const;
+		std::map<std::string, Table*>& getTables(void) const;
+		const ConfigImpl& getConfig(void) const;
+		Table* getTable(std::string tableName) const;
+		std::map<std::string, Relationship*>& getRelationships(void) const;
+		commonj::sdo::DataFactoryPtr createGraph(void) const;
+
+};
+
+		};
+	};
+};
+
+#endif //GRAPH_BUILDER_META_DATA_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/KeyPair.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/KeyPair.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/KeyPair.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/KeyPair.h Mon Nov 12 14:02:46 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 KEY_PAIR_H
+#define KEY_PAIR_H
+
+#include <map>
+#include <string>
+
+#include "apache/das/StringWrapper.h"
+#include "apache/das/rdb/DASInvalidColumnNameException.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class Relationship;
+
+class KeyPair {
+
+	friend class Relationship;
+
+	private:
+		std::string pkColumnName;
+		std::string fkColumnName;
+		Relationship* relationship;
+
+		void setRelationship(Relationship* relationship);
+		
+	public:
+		KeyPair(const KeyPair& keyPair);
+		KeyPair(std::string pkColumnName, std::string fkColumnName);
+		virtual ~KeyPair(void);
+
+		std::string getPKColumnName(void) const;
+		std::string getFKColumnName(void) const;
+		Relationship* getRelationship(void) const;
+
+};
+
+		};
+	};
+};
+
+#endif //KEY_PAIR_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ModifiedDataObject.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ModifiedDataObject.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ModifiedDataObject.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ModifiedDataObject.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,62 @@
+/*
+ * 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 MODIFIED_DATA_OBJECT_H
+#define MODIFIED_DATA_OBJECT_H
+
+#include "apache/das/rdb/DASDataObject.h"
+//#include "apache/das/rdb/RelationshipStatement.h"
+
+#include "commonj/sdo/DataObject.h"
+#include "commonj/sdo/SettingList.h"
+#include "commonj/sdo/ChangeSummary.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class ColumnData;
+class Table;
+
+class ModifiedDataObject : public DASDataObject {
+
+	private:
+		std::string sets;
+
+	public:
+		ModifiedDataObject(const Table& table, commonj::sdo::DataObjectPtr dataObject, 
+			commonj::sdo::ChangeSummaryPtr changeSummary);
+
+		~ModifiedDataObject(void);
+
+		std::string getStatement(void) const;
+		//bool isPKModified(void) const;
+		
+	
+};
+
+		};
+	};
+};
+
+#include "apache/das/rdb/Table.h"
+#include "apache/das/StringWrapper.h"
+#include "apache/das/rdb/ColumnData.h"
+
+#endif //MODIFIED_DATA_OBJECT_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ODBCTypeHelper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ODBCTypeHelper.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ODBCTypeHelper.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ODBCTypeHelper.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,51 @@
+/*
+ * 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 ODBC_TYPE_HELPER_H
+#define ODBC_TYPE_HELPER_H
+
+#include <windows.h>
+#include <sql.h>
+#include <sqlext.h>
+#include <string>
+
+#include "commonj/sdo/Type.h"
+
+#include "apache/das/StringWrapper.h"
+#include "apache/das/rdb/das_constants.h"
+#include "apache/das/rdb/DASInvalidSQLTypeException.h"
+#include "apache/das/rdb/DASInvalidSDOTypeException.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class ODBCTypeHelper {
+		
+	public:
+		static const std::string getSDOType(SQLSMALLINT sqlType);
+		static const SQLSMALLINT getSQLType(std::string sqlTypeName);
+		static const SQLSMALLINT getSQLType(const commonj::sdo::Type& type);
+
+};
+
+		};
+	};
+};
+
+#endif //ODBC_TYPE_HELPER_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/PKObject.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/PKObject.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/PKObject.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/PKObject.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,77 @@
+/*
+ * 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 PK_OBJECT_H
+#define PK_OBJECT_H
+
+#include <list>
+#include <map>
+#include <string>
+#include <stdexcept>
+
+#include "commonj/sdo/DataObject.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class ColumnData;
+class ResultSet;
+class GraphBuilder;
+class Table;
+
+typedef std::map<std::string, ColumnData*> KeyDataList;
+
+class PKObject {
+
+	private:
+		const Table* table;
+		KeyDataList* primaryKeys;
+
+	protected:
+		void addPrimaryKey(std::string columnName, ColumnData& columnData);
+		
+	public:
+		PKObject(const Table& table);
+		virtual ~PKObject(void);
+
+		const Table& getTable(void) const;
+
+		bool operator==(const PKObject& pkObject) const;
+		bool operator==(const KeyDataList* primaryKeyList) const;
+		bool operator!=(const PKObject& pkObject) const;
+		bool operator!=(const KeyDataList* primaryKeyList) const;
+		bool operator<(const PKObject& pkObject) const;
+		bool operator<(const KeyDataList* primaryKeyList) const;
+
+		const KeyDataList& getPrimaryKeys(void) const;
+		bool isPK(std::string columnName) const;
+
+};
+
+class KeyDataCmp {
+	public:
+		bool operator() (const KeyDataList* keyDataList1, const KeyDataList* keyDataList2 ) const;
+};
+
+		};
+	};
+};
+
+
+#endif //PK_OBJECT_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/PreparedStatement.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/PreparedStatement.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/PreparedStatement.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/PreparedStatement.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,51 @@
+/*
+ * 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 PREPARED_STATEMENT_H
+#define PREPARED_STATEMENT_H
+
+#include<vector>
+
+#include "apache/das/rdb/Statement.h"
+
+using std::vector;
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class PreparedStatement : Statement {
+
+	private:
+		string sql;
+		vector<int> positions;
+
+	public:
+		PreparedStatement(Connection& connection, SQLHSTMT statementHandle, string sql);
+		~PreparedStatement(void);
+
+		void setInt(int index, int elem);
+
+};
+
+		};
+	};
+};
+
+#endif //PREPARED_STATEMENT_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ReadCommandImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ReadCommandImpl.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ReadCommandImpl.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ReadCommandImpl.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,52 @@
+/*
+ * 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 READ_COMMAND_IMPL_H
+#define READ_COMMAND_IMPL_H
+
+#include <list>
+
+#include "apache/das/rdb/GraphBuilder.h"
+#include "apache/das/rdb/CommandImpl.h"
+#include "apache/das/rdb/das_constants.h"
+
+#include "commonj/sdo/DataFactory.h"
+#include "commonj/sdo/DataObject.h"
+#include "commonj/sdo/ChangeSummary.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class ReadCommandImpl : public CommandImpl {
+
+	public:
+		commonj::sdo::DataObjectPtr buildGraph(ResultSetPtr resultSet);
+		
+	
+		ReadCommandImpl(DASImpl& das, std::string sqlString);
+		~ReadCommandImpl(void);
+		commonj::sdo::DataObjectPtr executeQuery(void);
+
+};
+
+		};
+	};
+};
+
+#endif //READ_COMMAND_IMPL_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Relationship.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Relationship.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Relationship.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Relationship.h Mon Nov 12 14:02:46 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 RELATIONSHIP_H
+#define RELATIONSHIP_H
+
+#include <string>
+#include <map>
+
+#include "apache/das/rdb/KeyPair.h"
+#include "apache/das/rdb/ConfigImpl.h"
+#include "apache/das/rdb/DASInvalidTableNameException.h"
+#include "apache/das/rdb/DASInvalidRelationshipNameException.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class Relationship {
+
+	friend class ConfigImpl;
+
+	private:
+		std::string relationshipName;
+		std::string pkTableName;
+		std::string fkTableName;
+		bool many;
+		std::map<std::string, const KeyPair*>* keyPairs;
+
+		KeyPair& newKeyPair(KeyPair& keyPair);
+
+		
+	public:
+		Relationship(const Relationship& relationship);
+		Relationship(std::string pkTableName, std::string fkTableName, std::string relationshipName = "");
+		virtual ~Relationship(void);
+
+		KeyPair& addKeyPair(std::string pkColumnName, std::string fkColumnName);
+		KeyPair& addKeyPair(const KeyPair& keyPair);
+		void setMany(bool many);
+
+		std::string getPKTableName(void) const;
+		std::string getFKTableName(void) const;
+		std::string getName(void) const;
+		bool isMany(void) const;
+
+		const std::map<std::string, const KeyPair*>& getKeyPairs(void) const;
+		const KeyPair* getKeyPair(std::string pkColumnName, std::string fkColumnName) const;
+		std::list<const KeyPair*>* getKeyPair(std::string columnName, bool pkColumn = true) const;
+		bool containsColumn(std::string columnName, bool pkColumn = true) const;
+		
+};
+
+		};
+	};
+};
+
+#endif //RELATIONSHIP_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/RelationshipStatement.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/RelationshipStatement.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/RelationshipStatement.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/RelationshipStatement.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,72 @@
+/*
+ * 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_STATEMENT_H
+#define RELATIONSHIP_STATEMENT_H
+
+#include <list>
+#include <string>
+
+//#include "apache/das/rdb/Table.h"
+//#include "apache/das/rdb/DASDataObject.h"
+//#include "apache/das/rdb/Relationship.h"
+#include "apache/das/rdb/StatementPtr.h"
+#include "apache/das/rdb/DASOptimisticConcurrencyControlException.h"
+#include "apache/das/rdb/PKObject.h"
+#include "apache/das/rdb/KeyPair.h"
+
+#include "commonj/sdo/DataObject.h"
+#include "commonj/sdo/ChangeSummary.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class DASDataObject;
+class Table;
+class Relationship;
+
+class RelationshipStatement {
+
+	private:
+		const Relationship* relationship;
+		DASDataObject* dataObject;
+		const KeyDataList* keyDataList;
+		bool executed;
+		
+	public:
+		RelationshipStatement(const Relationship& relationship, const KeyDataList* keyDataList = 0);
+		~RelationshipStatement(void);
+
+		void setFKList(const KeyDataList* keyDataList);
+		void setDASDataObject(DASDataObject& dataObject);
+
+		void execute(StatementPtr stmt);
+		bool isUnset(void) const;
+		DASDataObject& getDASDataObject(void) const;
+		
+};
+
+
+
+		};
+	};
+};
+
+#endif //RELATIONSHIP_STATEMENT_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/RelationshipWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/RelationshipWrapper.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/RelationshipWrapper.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/RelationshipWrapper.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,58 @@
+/*
+ * 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
+
+#include <string>
+#include <map>
+#include <list>
+
+#include "apache/das/rdb/Relationship.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class RelationshipWrapper {
+
+	private:
+		std::list<std::list<Relationship*>*> relationshipLists;
+		const std::map<std::string, Relationship*>* relationships;
+		
+	public:
+		RelationshipWrapper(void);
+		~RelationshipWrapper(void);
+
+		std::list<Relationship*>& getRelationshipsByTableName(const std::map<std::string,
+			Relationship*>& relationships, std::string tableName, 
+			bool pkTable = true);
+
+		std::list<Relationship*>& getRelationshipsByTableName(const std::list<
+			Relationship*>& relationships, std::string tableName, 
+			bool pkTable = true);
+
+		void free(std::list<Relationship*>& relationshipList);
+		
+};
+
+		};
+	};
+};
+
+#endif //RELATIONSHIP_WRAPPER_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSet.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSet.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSet.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSet.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,101 @@
+/*
+ * 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
+
+#include <windows.h>
+#include <sql.h>
+#include <sqlext.h>
+#include <string>
+
+#include "apache/das/rdb/StatementPtr.h"
+#include "apache/das/RefCountingObject.h"
+#include "apache/das/rdb/ResultSetMetaData.h"
+#include "apache/das/rdb/DASInvalidSQLTypeException.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class Statement;
+class ResultSetMetaData;
+class ResultSet;
+
+typedef RefCountingObject<ResultSet> ResultSetObject;
+
+class ResultSet : public ResultSetObject {
+
+	private:
+		ResultSetMetaData* metaData;
+		StatementPtr stmt;
+
+		std::string getSQLString(unsigned int columnIndex) const;
+		std::wstring getSQLWString(unsigned int columnIndex) const;
+
+	public:
+		ResultSet(StatementPtr aStmt);
+		virtual ~ResultSet(void);
+
+		const ResultSetMetaData& getResultSetMetaData(void) const;
+		StatementPtr getStatement(void) const;
+		
+		SQLCHAR getSQLChar(unsigned int columnIndex) const;
+		SQLCHAR getSQLChar(std::string tableName, std::string columnName) const;
+
+		std::string getSQLVarchar(unsigned int columnIndex) const;
+		std::string getSQLVarchar(std::string tableName, std::string columnName) const;
+
+		SQLWCHAR getSQLWChar(unsigned int columnIndex) const;
+		SQLWCHAR getSQLWChar(std::string tableName, std::string columnName) const;
+
+		std::wstring getSQLWVarchar(unsigned int columnIndex) const;
+		std::wstring getSQLWVarchar(std::string tableName, std::string columnName) const;
+
+		SQLREAL getSQLReal(unsigned int columnIndex) const;
+		SQLREAL getSQLReal(std::string tableName, std::string columnName) const;
+
+		SQLFLOAT getSQLFloat(unsigned int columnIndex) const;
+		SQLFLOAT getSQLFloat(std::string tableName, std::string columnName) const;
+
+		SQLDOUBLE getSQLDouble(unsigned int columnIndex) const;
+		SQLDOUBLE getSQLDouble(std::string tableName, std::string columnName) const;
+
+		std::string getSQLDecimal(unsigned int columnIndex) const;
+		std::string getSQLDecimal(std::string tableName, std::string columnName) const;
+
+		SQLINTEGER getSQLInteger(unsigned int columnIndex) const;
+		SQLINTEGER getSQLInteger(std::string tableName, std::string columnName) const;
+
+		SQLSMALLINT getSQLSmallInt(unsigned int columnIndex) const;
+		SQLSMALLINT getSQLSmallInt(std::string tableName, std::string columnName) const;
+
+		bool isNull(unsigned int columnIndex) const;
+		bool isNull(std::string tableName, std::string columnName) const;
+
+		unsigned int getRowCount(void) const;
+
+		bool next(void);
+		
+};
+
+		};
+	};
+};
+
+#endif //RESULT_SET_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSetMetaData.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSetMetaData.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSetMetaData.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSetMetaData.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,75 @@
+/*
+ * 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
+
+#include <string>
+#include <map>
+
+#include "apache/das/rdb/Statement.h"
+#include "apache/das/rdb/ResultSet.h"
+#include "apache/das/rdb/DASColumnNotFoundException.h"
+#include "apache/das/rdb/DASInvalidSQLTypeException.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class ResultSet;
+
+class ResultSetMetaData {
+
+	private:
+		const ResultSet* resultSet;
+		std::map<std::string, unsigned int> columnsIndexes;
+
+		static SQLSMALLINT getSQLCType(SQLSMALLINT sqlType);
+
+	public:
+		ResultSetMetaData(const ResultSet& aResultSet);
+		virtual ~ResultSetMetaData(void);
+
+		const ResultSet& getResultSet(void) const;
+
+		std::string getSQLTypeName(unsigned int columnIndex) const;
+		std::string getSQLTypeName(std::string tableName, std::string columnName) const;
+
+		std::string getColumnName(unsigned int columnIndex) const;
+		unsigned int getColumnIndex(std::string tableName, std::string columnName) const;
+
+		std::string getTableName(unsigned int columnIndex) const;
+		std::string getTableName(std::string tableName, std::string columnName) const;
+
+		SQLSMALLINT getSQLType(unsigned int columnIndex) const;
+		SQLSMALLINT getSQLType(std::string tableName, std::string columnName) const;
+
+		SQLSMALLINT getSQLCType(unsigned int columnIndex) const;
+		SQLSMALLINT getSQLCType(std::string tableName, std::string columnName) const;
+
+		unsigned int getColumnCount(void) const;
+
+		bool containsColumn(std::string tableName, std::string columnName) const;
+
+};
+
+		};
+	};
+};
+
+#endif //RESULT_SET_META_DATA_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSetPtr.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSetPtr.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSetPtr.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/ResultSetPtr.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+/* $Rev: 452786 $ $Date: 2006-10-04 08:57:36 +0100 (Wed, 04 Oct 2006) $ */
+
+#ifndef RESULT_SET_PTR_H
+#define RESULT_SET_PTR_H
+
+#include "apache/das/RefCountingPointer.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+	class ResultSet;
+	typedef ::apache::das::RefCountingPointer<ResultSet> ResultSetPtr;
+
+		};
+	};
+};
+
+#endif //RESULT_SET_PTR_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/SQLException.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/SQLException.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/SQLException.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/SQLException.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,51 @@
+/*
+ * 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 SQL_EXCEPTION_H
+#define SQL_EXCEPTION_H
+
+#include <string>
+#include <windows.h>
+#include <sql.h>
+
+using std::exception;
+using std::string;
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class SQLException : public exception {
+
+	private:
+		SQLRETURN returnCode;
+
+	public:
+		SQLException(SQLRETURN returnCode, std::string errorText);
+		~SQLException();
+
+		virtual SQLRETURN getODBCReturnCode(void) const;
+
+};
+
+		};
+	};
+};
+
+#endif;

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Statement.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Statement.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Statement.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Statement.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,72 @@
+/*
+ * 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 "apache/das/StringWrapper.h"
+#include "apache/das/rdb/ResultSetPtr.h"
+#include "apache/das/rdb/Connection.h"
+#include "apache/das/rdb/ResultSet.h"
+
+using std::string;
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class ResultSet;
+class Statement;
+class Connection;
+
+typedef RefCountingObject<Statement> StatementObject;
+
+class Statement : public StatementObject {
+
+	friend class ResultSet;
+	
+	private:
+		SQLHSTMT statementHandle;
+		ResultSetPtr resultSet;
+		Connection* connection;
+		
+	protected:
+		string queryString;
+
+		ResultSetPtr createResultSet(void);
+		std::string getError(void) const;
+		
+	public:
+		Statement(Connection& connection, SQLHSTMT statementHandle);
+		virtual ~Statement(void);
+		virtual SQLHSTMT getODBCStatement(void) const;
+		virtual ResultSetPtr executeQuery(string sql);
+		virtual void close(void);
+		virtual Connection& getConnection(void) const;
+
+};
+
+		};
+	};
+};
+
+#endif //STATEMENT_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/StatementPtr.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/StatementPtr.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/StatementPtr.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/StatementPtr.h Mon Nov 12 14:02:46 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 STATEMENT_PTR_H
+#define STATEMENT_PTR_H
+
+#include "apache/das/RefCountingPointer.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+	class Statement;
+	typedef ::apache::das::RefCountingPointer<Statement> StatementPtr;
+
+		};
+	};
+};
+
+#endif //STATEMENT_PTR_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Table.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Table.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Table.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/Table.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,84 @@
+/*
+ * 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 <map>
+#include <list>
+#include <string>
+#include <stdexcept>
+#include <algorithm>
+
+#include "apache/das/rdb/das_constants.h"
+#include "apache/das/rdb/RelationshipWrapper.h"
+#include "apache/das/rdb/Relationship.h"
+#include "apache/das/rdb/KeyPair.h"
+#include "apache/das/rdb/ResultSet.h"
+#include "apache/das/rdb/Column.h"
+#include "apache/das/rdb/DASImpl.h"
+#include "apache/das/rdb/ODBCTypeHelper.h"
+#include "apache/das/DASInvalidTypeNameException.h"
+
+#include "commonj/sdo/DataFactory.h"
+#include "commonj/sdo/DataObject.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class Column;
+class GraphBuilderMetaData;
+
+class Table {
+
+	private:
+		std::map<std::string, const Column*>* columns;
+		std::string tableName;
+		std::string typeName;
+
+		Column& newColumn(Column& column);
+		
+	public:
+		Table(std::string tableName);
+		Table(std::string tableName, std::string typeName);
+		Table(const Table& table);
+		virtual ~Table(void);
+
+		Column& addColumn(std::string columnName, SQLSMALLINT sqlType);
+		Column& addColumn(const Column& column);
+		void setTypeName(std::string typeName);
+		
+		std::string getTypeName(void) const;
+		std::string getTableName(void) const;
+		const Column* getColumn(std::string columnName) const;
+		Column* getColumn(std::string columnName);
+		const Column* getColumnByProperty(std::string propertyName) const;
+		const std::map<std::string, const Column*>& getColumns(void) const;
+		unsigned int getPKColumnCount(void) const;
+		const Column* getOCCColumn(void) const;
+		
+		void createGraph(const GraphBuilderMetaData& graphBuilderMetaData, commonj::sdo::DataFactoryPtr dataFactory) const;
+		
+};
+
+			};
+		};
+	};
+
+#endif //TABLE_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/TableData.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/TableData.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/TableData.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/TableData.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,66 @@
+/*
+ * 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_DATA_H
+#define TABLE_DATA_H
+
+#include <list>
+#include <map>
+#include <string>
+#include <stdexcept>
+
+#include "apache/das/rdb/PKObject.h"
+#include "apache/das/rdb/Table.h"
+
+#include "commonj/sdo/DataObject.h"
+
+namespace apache {
+	namespace das {
+		namespace rdb {
+
+class ColumnData;
+class ResultSet;
+class GraphBuilder;
+class Table;
+
+typedef std::map<std::string, ColumnData*> KeyDataList;
+
+class TableData : public PKObject {
+
+	protected:
+		commonj::sdo::DataObjectPtr dataObject;
+		std::map<std::string, ColumnData*> columnsData;
+	
+	public:
+		TableData(const Table& table, ResultSetPtr resultSet);
+		virtual ~TableData(void);
+
+		bool hasPK(void) const;
+		commonj::sdo::DataObjectPtr getGraphObject(void) const;
+
+		ColumnData* getColumnData(std::string columnName) const;
+		
+		void populateDataGraph(GraphBuilder& graphBuilder);
+		
+};
+
+		};
+	};
+};
+
+#endif //TABLE_DATA_H

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/das_constants.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/das_constants.h?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/das_constants.h (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/include/apache/das/rdb/das_constants.h Mon Nov 12 14:02:46 2007
@@ -0,0 +1,23 @@
+/*
+ * 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.    
+ */
+
+#define DAS_ROOT_NAME "DAS_ROOT"
+#define DAS_NAMESPACE "apache.das"
+#define SDO_NAMESPACE "commonj.sdo"
+#define SQL_NULL_VALUE "NULL"

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/Command.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/Command.cpp?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/Command.cpp (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/Command.cpp Mon Nov 12 14:02:46 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.    
+ */
+
+#include "apache/das/Command.h"
+
+namespace apache {
+	namespace das {
+
+Command::Command(void) {}
+
+Command::~Command(void) {
+	CommandObject::free();
+}
+
+commonj::sdo::DataObjectPtr Command::executeQuery(void) {
+	return 0;
+};
+
+	};
+};

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/Config.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/Config.cpp?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/Config.cpp (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/Config.cpp Mon Nov 12 14:02:46 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 "apache/das/Config.h"
+
+namespace apache {
+	namespace das {
+
+Config::Config(void) {}
+
+Config::Config(const Config& config) {
+	this->uri = config.uri;
+}
+
+Config::Config(std::string xmlFile) {}
+
+Config::~Config(void) {}
+
+std::string Config::getURI(void) const {
+	return uri;
+}
+
+void Config::setURI(std::string uri) {
+	this->uri = uri;
+}
+
+	};
+};

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DAS.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DAS.cpp?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DAS.cpp (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DAS.cpp Mon Nov 12 14:02:46 2007
@@ -0,0 +1,38 @@
+/*
+ * 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 "apache/das/DAS.h"
+#include "apache/das/rdb/DASFactoryImpl.h"
+
+namespace apache {
+	namespace das {
+
+DASFactory* DAS::FACTORY = 0;
+
+DAS::DAS(void) {}
+
+DASFactory* DAS::getFACTORY(void) {
+	return FACTORY;
+}
+
+DAS::~DAS(void) {}
+
+CommandPtr DAS::getCommand(std::string commandName) { return CommandPtr(0); }
+
+	};
+};

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASCommandNotFoundException.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASCommandNotFoundException.cpp?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASCommandNotFoundException.cpp (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASCommandNotFoundException.cpp Mon Nov 12 14:02:46 2007
@@ -0,0 +1,30 @@
+/*
+ * 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 "apache/das/DASCommandNotFoundException.h"
+
+namespace apache {
+	namespace das {
+
+DASCommandNotFoundException::DASCommandNotFoundException(std::string message) : std::exception(message.c_str()) {}
+
+DASCommandNotFoundException::~DASCommandNotFoundException(void) {}
+
+	};
+};

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASFactory.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASFactory.cpp?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASFactory.cpp (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASFactory.cpp Mon Nov 12 14:02:46 2007
@@ -0,0 +1,42 @@
+/*
+ * 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 "apache/das/DASFactory.h"
+
+namespace apache {
+	namespace das {
+
+DASFactory::DASFactory(void) {}
+
+DASFactory::~DASFactory(void) {}
+
+DAS* DASFactory::createDAS(rdb::Connection& connection) {
+	return 0;
+}
+
+DAS* DASFactory::createDAS(const Config& config, rdb::Connection& connection) {
+	return 0;
+}
+
+DAS* DASFactory::createDAS(const Config& config) {
+	return 0;
+}
+
+	};
+};

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASInvalidPropertyNameException.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASInvalidPropertyNameException.cpp?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASInvalidPropertyNameException.cpp (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASInvalidPropertyNameException.cpp Mon Nov 12 14:02:46 2007
@@ -0,0 +1,30 @@
+/*
+ * 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 "apache/das/DASInvalidPropertyNameException.h"
+
+namespace apache {
+	namespace das {
+
+		DASInvalidPropertyNameException::DASInvalidPropertyNameException(std::string message) : std::exception(message.c_str()) {}
+
+DASInvalidPropertyNameException::~DASInvalidPropertyNameException(void) {}
+
+	};
+};

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASInvalidTypeNameException.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASInvalidTypeNameException.cpp?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASInvalidTypeNameException.cpp (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASInvalidTypeNameException.cpp Mon Nov 12 14:02:46 2007
@@ -0,0 +1,30 @@
+/*
+ * 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 "apache/das/DASInvalidTypeNameException.h"
+
+namespace apache {
+	namespace das {
+
+DASInvalidTypeNameException::DASInvalidTypeNameException(std::string message) : std::exception(message.c_str()) {}
+
+DASInvalidTypeNameException::~DASInvalidTypeNameException(void) {}
+
+	};
+};

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASNullPointerException.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASNullPointerException.cpp?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASNullPointerException.cpp (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DASNullPointerException.cpp Mon Nov 12 14:02:46 2007
@@ -0,0 +1,30 @@
+/*
+ * 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 "apache/das/DASNullPointerException.h"
+
+namespace apache {
+	namespace das {
+
+DASNullPointerException::DASNullPointerException(std::string message) : std::exception(message.c_str()) {}
+
+DASNullPointerException::~DASNullPointerException(void) {}
+
+	};
+};

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DataGraphPrinter.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DataGraphPrinter.cpp?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DataGraphPrinter.cpp (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/DataGraphPrinter.cpp Mon Nov 12 14:02:46 2007
@@ -0,0 +1,171 @@
+/*
+ * 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 "apache/das/DataGraphPrinter.h"
+
+namespace apache {
+	namespace das {
+
+DataGraphPrinter::DataGraphPrinter(commonj::sdo::DataObjectPtr root) {
+	this->root = root;
+}
+
+DataGraphPrinter::~DataGraphPrinter(void) {}
+
+void DataGraphPrinter::printMetaData(std::ostream& out) {
+	tabCount = 0;
+	const commonj::sdo::TypeList& typeList = root->getDataFactory()->getTypes();
+	
+	for (unsigned int i = 0 ; i < typeList.size() ; i++) {
+		out << std::endl << "[" << typeList[i].getName();
+
+		const commonj::sdo::Type* base = typeList[i].getBaseType();
+		/*out << "{";
+		out << " baseType = " << ((base == 0) ? "NULL" : base->getName());
+		out << " uri = " << typeList[i].getURI();
+		out << " abstractType = " << typeList[i].isAbstractType();
+		out << " changeSummaryType = " << typeList[i].isChangeSummaryType();
+		out << " dataObjectType = " << typeList[i].isDataObjectType();
+		out << " dataType = " << typeList[i].isDataType();
+		out << " openType = " << typeList[i].isOpenType();
+		out << " sequencedType = " << typeList[i].isSequencedType() << " } ";*/
+		out << "]" << std::endl;
+
+		commonj::sdo::PropertyList propertyList = typeList[i].getProperties();
+		
+		for (unsigned int j = 0 ; j < propertyList.size() ; j++) {
+
+			out << propertyList[j].getName() << std::endl;
+			/*out << "{";
+			out << " type = " << propertyList[j].getType().getName();
+			out << " alias = " << propertyList[j].getAlias();
+			out << " aliasCount = " << propertyList[j].getAliasCount();
+			out << " contaiment = " << propertyList[j].isContainment();
+			out << " defaulted = " << propertyList[j].isDefaulted();
+			out << " many = " << propertyList[j].isMany();
+			out << " readOnly = " << propertyList[j].isReadOnly();
+			out << " reference = " << propertyList[j].isReference();
+			out << "}" << std::endl;*/
+
+		}
+
+	}
+
+	out << std::endl;
+
+}
+
+void DataGraphPrinter::printDataGraph(commonj::sdo::DataObjectPtr dataObject, bool ref) {
+	std::ostream& out = *this->out;
+	commonj::sdo::PropertyList& propertyList = dataObject->getType().getProperties();
+	out << getTab(tabCount) << "[" << dataObject->getType().getURI() << "." << dataObject->getType().getName() << "]";
+	tabCount++;
+
+	for (unsigned int i = 0 ; i < propertyList.size() ; i++) {
+		
+		if (propertyList[i].isMany()) {
+			out << getTab(tabCount) << ((propertyList[i].isReference()) ? "-> " : "") << "[" << propertyList[i].getType().getName() << " LIST]";
+			tabCount++;
+			commonj::sdo::DataObjectList& objectList = dataObject->getList(propertyList[i]);
+		
+			for (unsigned int j = 0 ; j < objectList.size() ; j++) {
+
+				if (objectList[j]->getType().isDataType()) {
+					std::string typeName = objectList[j]->getType().getName();
+
+					if (typeName == "String") {
+						wchar_t* buf = new wchar_t[200];
+						int copied = dataObject->getString((((std::string) propertyList[j].getName()) + "[" + StringWrapper::toString(j) + "]").c_str(), buf, 200);
+						buf[copied] = 0;
+						std::wstring wstr = buf;
+						std::string str(wstr.begin(), wstr.end());
+						str.assign(wstr.begin(), wstr.end());
+
+
+						out << getTab(tabCount) << str << " : " << objectList[j]->getType().getName();
+						delete [] buf;
+					} else if (typeName == "Integer") {
+						out << getTab(tabCount) << dataObject->getInt((((std::string) propertyList[j].getName()) + "[" + StringWrapper::toString(j) + "]").c_str()) << " : " << objectList[j]->getType().getName();
+					}
+					
+				} else if (!ref) {
+					printDataGraph(objectList[j], propertyList[i].isReference());
+				}
+
+			}
+
+			if (objectList.size() == 0) {
+				out << getTab(tabCount) << "--empty--";
+			}
+
+			tabCount--;
+
+		} else {
+			commonj::sdo::DataObjectPtr actual = dataObject->getDataObject(propertyList[i]);
+			if (actual) {
+				std::string typeName = actual->getType().getName();
+				if (typeName == "String") {
+					wchar_t* buf = new wchar_t[200];
+					int copied = dataObject->getString(propertyList[i], buf, 200);
+					buf[copied] = 0;
+					std::wstring wstr = buf;
+					std::string str(wstr.begin(), wstr.end());
+					str.assign(wstr.begin(), wstr.end());
+
+					out << getTab(tabCount) << ((propertyList[i].isReference()) ? "-> " : "") << str << " : " << actual->getType().getName();
+					delete [] buf;
+				} else if (typeName == "Int") {
+					out << getTab(tabCount) << dataObject->getInt(propertyList[i]) << " : " << actual->getType().getName();
+				} else if (typeName == "Boolean") {
+					out << getTab(tabCount) << dataObject->getBoolean(propertyList[i]) << " : " << actual->getType().getName();
+				}
+
+			} else {
+				out << getTab(tabCount) << "NULL : " << propertyList[i].getType().getName();
+			}
+
+		}
+
+		if (propertyList.size() == 0) {
+			out << getTab(tabCount) << "--empty--";
+		}
+	
+	}
+
+	tabCount--;
+
+}
+
+void DataGraphPrinter::print(std::ostream& out) {
+	tabCount = 0;
+	this->out = &out;
+	printDataGraph(root);
+	out << std::endl;
+
+}
+
+std::string DataGraphPrinter::getTab(int count) const {
+	std::string ret;
+	ret.append(count* 3, ' ');
+	return "\n" + ret;
+
+}
+
+	};
+};

Added: incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/RefCountingObject.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/RefCountingObject.cpp?rev=594314&view=auto
==============================================================================
--- incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/RefCountingObject.cpp (added)
+++ incubator/tuscany/sandbox/crestani/das_distribution_example/src/runtime/core/src/apache/das/RefCountingObject.cpp Mon Nov 12 14:02:46 2007
@@ -0,0 +1,234 @@
+/*
+ * 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 "apache/das/RefCountingObject.h"
+#include "apache/das/rdb/Connection.h"
+#include "apache/das/rdb/Statement.h"
+#include "apache/das/rdb/ReadCommandImpl.h"
+#include "apache/das/Command.h"
+#include "apache/das/CommandPtr.h"
+
+namespace apache {
+	namespace das {
+
+template <class T>
+RefCountingObject<T>::RefCountingObject()
+{
+	refCount = 0;
+	freed = false;
+    refPtrs = new std::list<RefCountingPointer<T>*>();
+}
+
+template <class T>
+RefCountingObject<T>::RefCountingObject(const RefCountingObject<T>& rc)
+{
+	refCount = 0;
+	freed = false;
+    refPtrs = new std::list<RefCountingPointer<T>*>();
+}
+template <class T>
+T& RefCountingObject<T>::operator=(const T& rc)
+{
+    return *this;
+}
+template <class T>
+RefCountingObject<T>::~RefCountingObject()
+{
+	if (!freed) {
+		throw std::logic_error("Function RefCountingObjec<T>::free() must be invoked before deleting this object!");
+	}
+
+	delete refPtrs;
+
+}
+
+template <class T>
+void RefCountingObject<T>::free(void) {
+	std::list<RefCountingPointer<T>*>::iterator it;
+	
+	while (!refPtrs->empty()) {
+		RefCountingPointer<T>* aux = *refPtrs->begin();
+		refPtrs->erase(refPtrs->begin());
+		*aux = 0;
+
+	}
+
+	freed = true;
+
+}
+
+template <class T>
+void RefCountingObject<T>::addRef(RefCountingPointer<T>* refPtr)
+
+{
+	if ((*refPtr).isObjectOwner()) {
+		refCount++;
+	}
+
+	refPtrs->push_front(refPtr);
+
+}
+template <class T>
+void RefCountingObject<T>::releaseRef(RefCountingPointer<T>* refPtr)
+{
+	std::list<RefCountingPointer<T>*>::iterator it;
+	bool found = false;
+
+	for (it = refPtrs->begin() ; it != refPtrs->end() ; it++) {
+
+		if (refPtr == *it) {
+			found = true;
+			break;
+
+		}
+
+	}
+	
+	if (found) {
+
+		if ((*it)->isObjectOwner()) {
+			refCount--;
+		}
+
+		refPtrs->erase(it);
+
+		if (refCount == 0) {
+			delete this;
+		}
+
+	}
+
+}
+
+template <class T>
+std::ostream& RefCountingObject<T>::printSelf(std::ostream &os) 
+{
+	os << "RefCountingObject: reference count = " << refPtrs->size() << std::endl;
+    return os;
+}
+
+        // officially, there is nothing here- but if I dont use the overrides in
+        // the templates, then they dont get generated.
+        void Test ()
+        {
+            
+#if defined(WIN32) || defined (_WINDOWS)
+            /* 1) construct */
+			    
+			rdb::Connection conn("", "", "");
+			/*rdb::Connection* conn1 = new rdb::Connection("", "", "");
+			delete conn1;*/
+            rdb::StatementObject* fptr = new rdb::StatementObject();
+			rdb::StatementObject statement;
+			rdb::Statement* s = new rdb::Statement(conn, 0);
+			delete s;
+			rdb::StatementObject* fptr2 = new rdb::StatementObject(statement);
+			fptr->releaseRef(0);
+			fptr->addRef(0);
+			delete fptr;
+
+			rdb::StatementPtr stmt = conn.createStatement();
+			rdb::ResultSetObject* rs1 = new rdb::ResultSetObject();
+            rdb::ResultSetObject rs2;
+			delete rs1;
+			rs2.releaseRef(0);
+			rs2.addRef(0);
+			{
+				CommandPtr stmt = *(new CommandPtr(new rdb::ReadCommandImpl(*(new rdb::DASImpl(conn)), "")));
+				CommandObject* rs1 = new CommandObject();
+				CommandObject rs2;
+				delete rs1;
+				rs2.releaseRef(0);
+				rs2.addRef(0);
+			}
+			
+            ///* Use the T*  and  * */
+            //DataObject* dof = dptr;
+            //DataObject& dor = *dptr;
+            //
+            //if (dptr2 == dptr || !dptr){}
+            //
+            //
+            //ChangeSummaryPtr cptr = dptr->getChangeSummary();
+            //cptr = dptr->getChangeSummary();
+            //ChangeSummaryPtr cptr2 = cptr;
+            //
+            //ChangeSummary* cof = cptr;
+            //ChangeSummary& cop = *cptr;
+            //
+            //
+            //if (cptr2 == cptr || !cptr){}
+            //
+            //cptr->endLogging();
+            //
+            //SequencePtr sptr = dptr->getSequence();
+            //sptr = dptr->getSequence();
+            //SequencePtr sptr2 = sptr;
+            //
+            //Sequence* sof = sptr;
+            //Sequence& sop = *sptr;
+            //
+            //
+            //if (sptr2 == sptr || !sptr){}
+            //
+            //sptr->getBooleanValue(0);
+            //
+            //
+            //// Generate code for XMLDocumentPtr
+            //XMLDocumentPtr xmldocptr1 = 0;
+            //XMLDocumentPtr xmldocptr2 = xmldocptr1;
+            //xmldocptr1 = xmldocptr2;
+            //if (xmldocptr2 == xmldocptr1 || !xmldocptr1){}
+            //XMLDocument* xmldocp = xmldocptr1;
+            //XMLDocument& xmldocref = *xmldocptr2;
+            //xmldocptr1->getEncoding();
+
+            //// Generate code for XSDHelperPtr
+            //XSDHelperPtr xsdhptr1 = 0;
+            //XSDHelperPtr xsdhptr2 = xsdhptr1;
+            //xsdhptr1 = xsdhptr2;
+            //if (xsdhptr2 == xsdhptr1 || !xsdhptr1){}
+            //XSDHelper* xsdhp = xsdhptr1;
+            //XSDHelper& xsdhref = *xsdhptr2;
+            //xsdhptr1->define("dummy");
+
+            //// Generate code for XMLHelperPtr
+            //XMLHelperPtr xmlhptr1 = 0;
+            //XMLHelperPtr xmlhptr2 = xmlhptr1;
+            //xmlhptr1 = xmlhptr2;
+            //if (xmlhptr2 == xmlhptr1 || !xmlhptr1){}
+            //XMLHelper* xmlhp = xmlhptr1;
+            //XMLHelper& xmlhref = *xmlhptr2;
+            //xmlhptr1->load("dummy");
+
+            //// Generate code for DataGraphPtr
+            //DataGraphPtr dgptr1 = 0;
+            //DataGraphPtr dgptr2 = dgptr1;
+            //dgptr1 = dgptr2;
+            //if (dgptr2 == dgptr1 || !dgptr1){}
+            //DataGraph* dghp = dgptr1;
+            //DataGraph& dgref = *dgptr2;
+            //dgptr1->getRootObject();
+
+#endif
+            
+        }
+
+	};
+};



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