summaryrefslogtreecommitdiffstats
path: root/das-cpp/trunk/runtime/core/include
diff options
context:
space:
mode:
Diffstat (limited to 'das-cpp/trunk/runtime/core/include')
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/Command.h60
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/CommandPtr.h34
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/Config.h46
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/DAS.h55
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/DASCommandNotFoundException.h41
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/DASFactory.h51
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/DASInvalidPropertyNameException.h41
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/DASInvalidTypeNameException.h41
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/DASNullPointerException.h41
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/DataGraphPrinter.h53
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/RefCountingObject.h73
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/RefCountingPointer.h103
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/SDODataObjectWrapper.h45
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/StringWrapper.h60
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/ApplyChanges.h82
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/Column.h79
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/ColumnData.h67
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/CommandImpl.h57
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/ConfigImpl.h89
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/Connection.h67
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/CreatedDataObject.h55
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DASColumnNotFoundException.h43
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DASDataObject.h81
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DASFactoryImpl.h49
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DASImpl.h79
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidColumnNameException.h43
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidRelationshipNameException.h43
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidSDOTypeException.h43
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidSQLTypeException.h43
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidTableNameException.h43
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DASOptimisticConcurrencyControlException.h43
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DASPrimaryKeyNotFoundException.h43
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/DeletedDataObject.h49
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/GraphBuilder.h59
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/GraphBuilderMetaData.h67
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/KeyPair.h60
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/ModifiedDataObject.h62
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/ODBCTypeHelper.h51
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/PKObject.h77
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/PreparedStatement.h51
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/ReadCommandImpl.h52
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/Relationship.h73
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/RelationshipStatement.h72
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/RelationshipWrapper.h58
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSet.h101
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSetMetaData.h75
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSetPtr.h38
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/SQLException.h51
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/Statement.h72
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/StatementPtr.h36
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/Table.h84
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/TableData.h66
-rw-r--r--das-cpp/trunk/runtime/core/include/apache/das/rdb/das_constants.h23
53 files changed, 3070 insertions, 0 deletions
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/Command.h b/das-cpp/trunk/runtime/core/include/apache/das/Command.h
new file mode 100644
index 0000000000..f7a6645826
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/Command.h
@@ -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 COMMAND_H
+#define COMMAND_H
+
+#include "apache/das/RefCountingObject.h"
+
+#include "commonj/sdo/DataObject.h"
+
+#include <string>
+
+namespace apache {
+ namespace das {
+
+class Command;
+typedef RefCountingObject<Command> CommandObject;
+
+/**
+ * A Command is used to execute a read or write to a database
+ */
+class Command : public CommandObject {
+
+ public:
+ Command(void);
+ virtual ~Command(void);
+
+ /**
+ * Performs the function defined by the command
+ */
+ //void execute(void);
+
+ /**
+ * Performs the function defined by the command and return the results in the root DataObject
+ *
+ * @return the root DataObject
+ */
+ virtual commonj::sdo::DataObjectPtr executeQuery(void);
+
+};
+
+ };
+};
+
+#endif //COMMAND_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/CommandPtr.h b/das-cpp/trunk/runtime/core/include/apache/das/CommandPtr.h
new file mode 100644
index 0000000000..60d4082adb
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/CommandPtr.h
@@ -0,0 +1,34 @@
+/*
+ * 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 COMMAND_PTR_H
+#define COMMAND_PTR_H
+
+#include "apache/das/RefCountingPointer.h"
+
+namespace apache {
+ namespace das {
+
+ class Command;
+ typedef RefCountingPointer<Command> CommandPtr;
+
+ };
+};
+
+#endif //COMMAND_PTR_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/Config.h b/das-cpp/trunk/runtime/core/include/apache/das/Config.h
new file mode 100644
index 0000000000..aab771c02c
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/Config.h
@@ -0,0 +1,46 @@
+/*
+ * 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 CONFIG_H
+#define CONFIG_H
+
+#include <string>
+
+namespace apache {
+ namespace das {
+
+class Config {
+
+ private:
+ std::string uri;
+
+ public:
+ Config(void);
+ Config(const Config& config);
+ Config(std::string xmlFile);
+ virtual ~Config(void);
+
+ virtual std::string getURI(void) const;
+ virtual void setURI(std::string uri);
+
+};
+
+ };
+};
+
+#endif //CONFIG_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/DAS.h b/das-cpp/trunk/runtime/core/include/apache/das/DAS.h
new file mode 100644
index 0000000000..ed5269a813
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/DAS.h
@@ -0,0 +1,55 @@
+/*
+ * 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 D_A_S_H
+#define D_A_S_H
+
+#include "apache/das/DASFactory.h"
+#include "apache/das/Command.h"
+#include "apache/das/CommandPtr.h"
+
+#include "commonj/sdo/DataObject.h"
+
+namespace apache {
+ namespace das {
+
+class DASFactory;
+class Config;
+
+class DAS {
+
+ private:
+ static DASFactory* FACTORY;
+
+ public:
+ static DASFactory* getFACTORY(void);
+
+ DAS(void);
+ virtual ~DAS(void);
+
+ virtual const Config& getConfig(void) const = 0;
+ virtual CommandPtr getCommand(std::string commandName);
+ virtual void applyChanges(commonj::sdo::DataObjectPtr root) = 0;
+
+};
+
+ };
+};
+
+#endif //D_A_S_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/DASCommandNotFoundException.h b/das-cpp/trunk/runtime/core/include/apache/das/DASCommandNotFoundException.h
new file mode 100644
index 0000000000..055a157167
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/DASCommandNotFoundException.h
@@ -0,0 +1,41 @@
+/*
+ * 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_COMMAND_NOT_FOUND_EXCEPTION_H
+#define DAS_COMMAND_NOT_FOUND_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+ namespace das {
+
+class DASCommandNotFoundException : public std::exception {
+
+ public:
+ DASCommandNotFoundException(std::string message = "");
+ virtual ~DASCommandNotFoundException(void);
+
+};
+
+ };
+};
+
+#endif //DAS_COMMAND_NOT_FOUND_EXCEPTION_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/DASFactory.h b/das-cpp/trunk/runtime/core/include/apache/das/DASFactory.h
new file mode 100644
index 0000000000..e326d3f171
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/DASFactory.h
@@ -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 D_A_S_FACTORY_H
+#define D_A_S_FACTORY_H
+
+#include <windows.h>
+#include <sql.h>
+#include <string>
+
+#include "apache/das/DAS.h"
+#include "apache/das/rdb/Connection.h"
+
+namespace apache {
+ namespace das {
+
+class Config;
+
+class DAS;
+
+class DASFactory {
+
+ public:
+ DASFactory(void);
+ virtual ~DASFactory(void);
+ virtual DAS* createDAS(rdb::Connection& connection);
+ virtual DAS* createDAS(const Config& config, rdb::Connection& connection);
+ virtual DAS* createDAS(const Config& config);
+
+
+};
+
+ };
+};
+
+#endif //D_A_S_FACTORY_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/DASInvalidPropertyNameException.h b/das-cpp/trunk/runtime/core/include/apache/das/DASInvalidPropertyNameException.h
new file mode 100644
index 0000000000..60490301ed
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/DASInvalidPropertyNameException.h
@@ -0,0 +1,41 @@
+/*
+ * 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_INVALID_PROPERTY_NAME_EXCEPTION_H
+#define DAS_INVALID_PROPERTY_NAME_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+ namespace das {
+
+class DASInvalidPropertyNameException : public std::exception {
+
+ public:
+ DASInvalidPropertyNameException(std::string message = "");
+ virtual ~DASInvalidPropertyNameException(void);
+
+};
+
+ };
+};
+
+#endif //DAS_INVALID_PROPERTY_NAME_EXCEPTION_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/DASInvalidTypeNameException.h b/das-cpp/trunk/runtime/core/include/apache/das/DASInvalidTypeNameException.h
new file mode 100644
index 0000000000..06aea94a09
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/DASInvalidTypeNameException.h
@@ -0,0 +1,41 @@
+/*
+ * 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_INVALID_TYPE_NAME_EXCEPTION_H
+#define DAS_INVALID_TYPE_NAME_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+ namespace das {
+
+class DASInvalidTypeNameException : public std::exception {
+
+ public:
+ DASInvalidTypeNameException(std::string message = "");
+ virtual ~DASInvalidTypeNameException(void);
+
+};
+
+ };
+};
+
+#endif //DAS_INVALID_TYPE_NAME_EXCEPTION_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/DASNullPointerException.h b/das-cpp/trunk/runtime/core/include/apache/das/DASNullPointerException.h
new file mode 100644
index 0000000000..ab9b0a37ea
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/DASNullPointerException.h
@@ -0,0 +1,41 @@
+/*
+ * 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_NULL_POINTER_EXCEPTION_H
+#define DAS_NULL_POINTER_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+ namespace das {
+
+class DASNullPointerException : public std::exception {
+
+ public:
+ DASNullPointerException(std::string message = "");
+ virtual ~DASNullPointerException(void);
+
+};
+
+ };
+};
+
+#endif //DAS_NULL_POINTER_EXCEPTION_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/DataGraphPrinter.h b/das-cpp/trunk/runtime/core/include/apache/das/DataGraphPrinter.h
new file mode 100644
index 0000000000..2c1c63c4eb
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/DataGraphPrinter.h
@@ -0,0 +1,53 @@
+/*
+ * 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 DATA_GRAPH_PRINTER_H
+#define DATA_GRAPH_PRINTER_H
+
+#include <ostream>
+
+#include "apache/das/StringWrapper.h"
+
+#include "commonj/sdo/DataObject.h"
+
+namespace apache {
+ namespace das {
+
+class DataGraphPrinter {
+ private:
+ commonj::sdo::DataObjectPtr root;
+ unsigned int tabCount;
+ std::ostream* out;
+
+ std::string getTab(int count) const;
+ void printDataGraph(commonj::sdo::DataObjectPtr dataObject, bool ref = false);
+
+ public:
+ DataGraphPrinter(commonj::sdo::DataObjectPtr root);
+ virtual ~DataGraphPrinter(void);
+
+ virtual void print(std::ostream& out);
+ virtual void printMetaData(std::ostream& out);
+
+};
+
+ };
+};
+
+#endif //DATA_GRAPH_PRINTER_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/RefCountingObject.h b/das-cpp/trunk/runtime/core/include/apache/das/RefCountingObject.h
new file mode 100644
index 0000000000..c69bcf6e34
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/RefCountingObject.h
@@ -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 REF_COUNTING_OBJECT_H
+#define REF_COUNTING_OBJECT_H
+
+#include <iostream>
+#include <list>
+
+#include "apache/das/RefCountingPointer.h"
+
+namespace apache {
+ namespace das {
+
+/**
+ * RefcountingObject is the base class for all objects in SDO
+ * These objects keep a count of references to themselves, then
+ * free themselves when they are unused.
+ */
+template <class T>
+ class RefCountingObject
+ {
+
+ public:
+ RefCountingObject();
+ RefCountingObject(const RefCountingObject<T>& rc);
+ T& operator=(const T& rc);
+ virtual ~RefCountingObject();
+/**
+ * Add to the reference count - a new pointer has been created.
+ */
+ void addRef(RefCountingPointer<T>* refPtr);
+/**
+ * Subtract from the the reference count - a reference has dropped.
+ */
+ virtual void releaseRef(RefCountingPointer<T>* refPtr);
+
+/**
+ * Print contents to stream
+ */
+ virtual std::ostream& printSelf(std::ostream &os);
+
+ protected:
+ virtual void free(void);
+
+ private:
+ bool freed;
+ unsigned int refCount;
+ std::list<RefCountingPointer<T>*>* refPtrs;
+
+ };
+
+ };
+};
+
+
+#endif //REF_COUNTING_OBJECT_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/RefCountingPointer.h b/das-cpp/trunk/runtime/core/include/apache/das/RefCountingPointer.h
new file mode 100644
index 0000000000..22a2ef7f08
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/RefCountingPointer.h
@@ -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.
+ */
+
+#ifndef REF_COUNTING_POINTER_H
+#define REF_COUNTING_POINTER_H
+
+#include <iostream>
+
+#include "apache/das/DASNullPointerException.h"
+
+namespace apache {
+ namespace das {
+
+ template <class T>
+class RefCountingPointer {
+
+ public:
+ /*SDO_API*/ RefCountingPointer(T* realPtr = 0, bool objectOwner = true);
+ RefCountingPointer(const RefCountingPointer<T>& rhs, bool objectOwner = true);
+ /*SDO_API*/ RefCountingPointer(T& rhs, bool objectOwner = true);
+ /*SDO_API*/ virtual ~RefCountingPointer(void);
+ /*SDO_API*/ RefCountingPointer& operator=(const RefCountingPointer<T>& rhs);
+
+ /*SDO_API*/ bool operator==(RefCountingPointer<T>& test) const;
+ /*SDO_API*/ T* operator->() const;
+ /*SDO_API*/ T& operator*() const;
+ /*SDO_API*/ bool operator!() const;
+ bool isObjectOwner(void) const;
+
+#ifdef MFT
+ // MFT == member function templates
+ // Notes on the items below.
+ // In our code, we use subclasses to expose the API, and super
+ // classes to implement. E,g DataObject and DataObjectImpl.
+ // In some cases, we know that the DataObject given to us is a
+ // DataObjectImpl, and cast it. With RefCountingPointers, however,
+ // the cast cannot work, as the RefCountingPointer to the superclass
+ // is not related to the RCP to the subclass. Recent changes in the
+ // C++ language allow this to work by defining an operator which
+ // causes a pointer of the other type to be returned, as long as pointee
+ // is acceptable as a parameter to the cosntructor of the other type
+ // of pointer. This works in C++.NET, but not in C++6:
+ operator RefCountingPointer<otherType>()
+ {
+ return RefCountingPointer<otherType>(pointee);
+ }
+
+ // Since we are using C6, a possible workround is to provide a method
+ // which returns the dumb pointer, then construct a pointer to the
+ // base class from the pointer returned. This is that the operator T* does.
+ // The code in DataObject could be simpler if we used C7,and we should
+ // discusss changing.
+#else
+ operator T*() {return pointee;}
+#endif
+
+ template <class otherType>
+ operator RefCountingPointer<otherType>()
+ {
+ return RefCountingPointer<otherType>(pointee);
+ }
+
+ friend std::ostream& operator<< (std::ostream &os, const RefCountingPointer<T>& ptr)
+ {
+ if (!ptr)
+ {
+ os << "NULL" << std::endl;
+ }
+ else
+ {
+ ptr->printSelf(os);
+ }
+
+ return os;
+ }
+
+ private:
+ T *pointee;
+ bool objectOwner;
+ void init();
+
+};
+
+ };
+};
+
+#endif //REF_COUNTING_POINTER_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/SDODataObjectWrapper.h b/das-cpp/trunk/runtime/core/include/apache/das/SDODataObjectWrapper.h
new file mode 100644
index 0000000000..e3653640a7
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/SDODataObjectWrapper.h
@@ -0,0 +1,45 @@
+/*
+ * 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 SDO_DATA_OBJECT_WRAPPER_H
+#define SDO_DATA_OBJECT_WRAPPER_H
+
+#include <string>
+
+#include "commonj/sdo/DataObject.h"
+
+namespace apache {
+ namespace das {
+
+class SDODataObjectWrapper {
+
+ private:
+ commonj::sdo::DataObjectPtr dataObject;
+
+ public:
+ SDODataObjectWrapper(commonj::sdo::DataObjectPtr dataObject);
+ virtual ~SDODataObjectWrapper(void);
+
+ std::string getString(std::string propertyName) const;
+
+};
+
+ };
+};
+
+#endif //SDO_DATA_OBJECT_WRAPPER_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/StringWrapper.h b/das-cpp/trunk/runtime/core/include/apache/das/StringWrapper.h
new file mode 100644
index 0000000000..626f2f81e5
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/StringWrapper.h
@@ -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 STRING_WRAPPER_H
+#define STRING_WRAPPER_H
+
+#include <string>
+#include <ctype.h>
+#include <sstream>
+
+#include "commonj/sdo/DataObject.h"
+
+namespace apache {
+ namespace das {
+
+class StringWrapper {
+
+ private:
+ std::string str;
+
+ public:
+ static std::string toString(const int& t);
+ static std::string toString(const double& t);
+ static std::string toString(const long double& t);
+ static std::string toString(const float& t);
+ static std::string toString(const wchar_t& t);
+ static std::string toString(const long& t);
+ static std::string toString(const unsigned int& t);
+ static std::string toString(const unsigned char& t);
+
+ StringWrapper(std::string str);
+ StringWrapper(commonj::sdo::DataObjectPtr dataObject, std::string propertyName);
+
+ std::string toLower(void) const;
+ std::string toUpper(void) const;
+ bool isValidRDBName(void) const;
+ std::string getString(void) const;
+ void defineOnDataObject(commonj::sdo::DataObjectPtr dataObject, std::string propertyName) const;
+
+};
+
+ };
+};
+
+#endif //STRING_WRAPPER_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/ApplyChanges.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ApplyChanges.h
new file mode 100644
index 0000000000..88b6195315
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ApplyChanges.h
@@ -0,0 +1,82 @@
+/*
+ * 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 APPLY_CHANGES_H
+#define APPLY_CHANGES_H
+
+#include <list>
+#include <string>
+
+#include "apache/das/rdb/DASImpl.h"
+#include "apache/das/rdb/ConfigImpl.h"
+#include "apache/das/rdb/Relationship.h"
+#include "apache/das/rdb/KeyPair.h"
+#include "apache/das/rdb/ModifiedDataObject.h"
+#include "apache/das/rdb/DeletedDataObject.h"
+#include "apache/das/rdb/CreatedDataObject.h"
+#include "apache/das/rdb/DASPrimaryKeyNotFoundException.h"
+
+#include "commonj/sdo/DataObject.h"
+#include "commonj/sdo/ChangeSummary.h"
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class DASDataObject;
+class CreatedDataObject;
+class DeletedDataObject;
+class ConfigImpl;
+class DASImpl;
+
+class ApplyChanges {
+
+ private:
+ commonj::sdo::DataObjectPtr root;
+ const ConfigImpl* config;
+ std::map<std::string, const Relationship*> relationships;
+ std::map<std::string, const Table*> tables;
+ std::map<std::string, std::list<DASDataObject*>*> dasDataObjects;
+ std::list<DASDataObject*> stack;
+ std::list<DASDataObject*> updateOrderList;
+ commonj::sdo::ChangeSummaryPtr summary;
+
+ void processRootDataObject(commonj::sdo::DataObjectPtr dataObject);
+ DASDataObject& processDataObject(commonj::sdo::DataObjectPtr dataObject);
+ DeletedDataObject& processDeletedDataObject(commonj::sdo::DataObjectPtr dataObject);
+ CreatedDataObject& processCreatedDataObject(commonj::sdo::DataObjectPtr dataObject);
+ ModifiedDataObject& processModifiedDataObject(commonj::sdo::DataObjectPtr dataObject);
+ DASDataObject* getDASDataObject(commonj::sdo::DataObjectPtr dataObject) const;
+ void addDataObject(DASDataObject& dataObject);
+ void processMetadata(commonj::sdo::DataObjectPtr dataObject);
+ bool isInStack(const DASDataObject& dasDataObject);
+ const Table& getTable(commonj::sdo::DataObjectPtr dataObject);
+ const Relationship& getRelationship(DASDataObject& parentDataObject, DASDataObject& dataObject) const;
+
+ public:
+ ApplyChanges(DASImpl& das, commonj::sdo::DataObjectPtr root);
+ ~ApplyChanges(void);
+
+};
+
+ };
+ };
+};
+
+#endif //APPLY_CHANGES_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/Column.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/Column.h
new file mode 100644
index 0000000000..f162287f25
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/Column.h
@@ -0,0 +1,79 @@
+/*
+ * 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 COLUMN_H
+#define COLUMN_H
+
+#include <windows.h>
+#include <sql.h>
+#include <sqlext.h>
+#include <string>
+#include <list>
+
+#include "apache/das/rdb/Table.h"
+#include "apache/das/rdb/DASInvalidColumnNameException.h"
+#include "apache/das/DASInvalidPropertyNameException.h"
+#include "apache/das/StringWrapper.h"
+#include "apache/das/rdb/das_constants.h"
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class Table;
+
+class Column {
+
+ friend class Table;
+
+ private:
+ bool pk;
+ std::string columnName;
+ std::string propertyName;
+ SQLSMALLINT sqlType;
+ Table* containerTable;
+ bool managed;
+ bool collision;
+
+ void setContainerTable(Table* containerTable);
+
+ public:
+ Column(const Column& column);
+ Column(std::string columnName, SQLSMALLINT sqlType);
+ virtual ~Column(void);
+
+ void setPropertyName(std::string propertyName);
+ void setPK(bool pk);
+ void setCollision(bool collision);
+ void setManaged(bool managed);
+
+ bool isPK(void) const;
+ std::string getPropertyName(void) const;
+ SQLSMALLINT getSQLType(void) const;
+ Table* getContainerTable(void) const;
+ std::string getName(void) const;
+ bool isCollision(void) const;
+ bool isManaged(void) const;
+
+};
+
+ };
+ };
+};
+
+#endif //COLUMN_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/ColumnData.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ColumnData.h
new file mode 100644
index 0000000000..8b25e74c19
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ColumnData.h
@@ -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 COLUMN_DATA_H
+#define COLUMN_DATA_H
+
+#include <windows.h>
+#include <sql.h>
+#include <sqlext.h>
+#include <string>
+
+#include "apache/das/StringWrapper.h"
+#include "apache/das/rdb/DASInvalidSQLTypeException.h"
+#include "apache/das/rdb/Column.h"
+#include "apache/das/rdb/TableData.h"
+
+#include "commonj/sdo/Setting.h"
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class TableData;
+
+class ColumnData {
+
+ private:
+ const Column* column;
+ void* data;
+
+ public:
+ ColumnData(const Column& column, ResultSetPtr resultSet);
+ ColumnData(const Column& column, const commonj::sdo::Setting& setting);
+ ColumnData(const Column& column, commonj::sdo::DataObjectPtr dataObject);
+ virtual ~ColumnData(void);
+
+ bool operator==(const ColumnData& columnData) const;
+ bool operator!=(const ColumnData& columnData) const;
+ bool operator<(const ColumnData& columnData) const;
+ bool operator>(const ColumnData& columnData) const;
+ const Column& getColumn(void) const;
+ std::string toSQL(void) const;
+
+ void populateDataGraph(TableData& tableData) const;
+
+};
+
+ };
+ };
+};
+
+#endif //COLUMN_DATA_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/CommandImpl.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/CommandImpl.h
new file mode 100644
index 0000000000..c96af3d939
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/CommandImpl.h
@@ -0,0 +1,57 @@
+/*
+ * 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 COMMAND_IMPL_H
+#define COMMAND_IMPL_H
+
+#include <string>
+
+#include "apache/das/Command.h"
+#include "apache/das/rdb/Connection.h"
+
+#include "commonj/sdo/DataObject.h"
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class DASImpl;
+
+class CommandImpl : public Command {
+
+ protected:
+ DASImpl* das;
+ std::string sql;
+ StatementPtr statement;
+
+ public:
+ CommandImpl(DASImpl& das, std::string sqlString);
+ virtual ~CommandImpl(void);
+ virtual commonj::sdo::DataObjectPtr executeQuery(void);
+ virtual DASImpl& getDAS(void);
+ virtual void close(void);
+
+};
+
+ };
+ };
+};
+
+#endif //COMMAND_IMPL_H
+
+
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/ConfigImpl.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ConfigImpl.h
new file mode 100644
index 0000000000..d0805b06f2
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ConfigImpl.h
@@ -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.
+ */
+#ifndef CONFIG_IMPL_H
+#define CONFIG_IMPL_H
+
+#include <list>
+#include <map>
+
+#include "commonj/sdo/DataFactory.h"
+#include "commonj/sdo/DataFactoryImpl.h"
+#include "commonj/sdo/XSDHelper.h"
+#include "commonj/sdo/XMLHelper.h"
+#include "commonj/sdo/HelperProvider.h"
+#include "commonj/sdo/DataObject.h"
+
+#include "apache/das/Config.h"
+#include "apache/das/SDODataObjectWrapper.h"
+#include "apache/das/DASCommandNotFoundException.h"
+#include "apache/das/DAS.h"
+#include "apache/das/rdb/Table.h"
+#include "apache/das/rdb/Column.h"
+#include "apache/das/rdb/Relationship.h"
+#include "apache/das/rdb/RelationshipWrapper.h"
+#include "apache/das/DataGraphPrinter.h"
+
+class Column;
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class Table;
+
+class ConfigImpl : public ::apache::das::Config {
+
+ private:
+ std::map<std::string, const Relationship*>* relationships;
+ std::map<std::string, const Table*>* tables;
+ bool convOverConfig;
+ std::map<std::string, std::string>* commands;
+
+ Table& newTable(Table& table);
+ Relationship& newRelationship(Relationship& relationship);
+
+ public:
+ ConfigImpl(void);
+ ConfigImpl(const Config& config);
+ ConfigImpl(std::string xmlFile);
+ virtual ~ConfigImpl(void);
+
+ Table& addTable(std::string tableName);
+ Table& addTable(const Table& table);
+ Relationship& addRelationship(std::string pkTableName, std::string fkTableName, std::string name = "");
+ Relationship& addRelationship(const Relationship& relationship);
+
+ const std::map<std::string, Relationship*>& getRelationships(void) const;
+ const std::map<std::string, Table*>& getTables(void) const;
+ const Table* getTableByTypeName(std::string typeName) const;
+ std::string getCommand(std::string commandName) const;
+
+ DAS& getDAS(void) const;
+ bool isConvOverConfig(void) const;
+
+ const Table* getTable(std::string tableName) const;
+ const Relationship* getRelationship(std::string pkTableName, std::string fkTableName) const;
+
+};
+
+ };
+ };
+};
+
+#endif //CONFIG_IMPL_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/Connection.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/Connection.h
new file mode 100644
index 0000000000..6507c3786e
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/Connection.h
@@ -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 CONNECTION_H
+#define CONNECTION_H
+
+#include <windows.h>
+#include <sql.h>
+#include <sqlext.h>
+
+#include <string>
+#include <list>
+#include <iostream>
+#include <algorithm>
+
+#include "apache/das/rdb/StatementPtr.h"
+#include "apache/das/rdb/Statement.h"
+#include "apache/das/rdb/SQLException.h"
+
+using std::string;
+using std::exception;
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class Connection {
+
+ private:
+ SQLHDBC connection;
+ SQLHENV environment;
+ std::list<StatementPtr*> statements;
+
+ void setAutoCommit(bool autoCommit);
+
+ public:
+ Connection(string dsn, string user, string password);
+ Connection(string connectString);
+ virtual ~Connection(void);
+ SQLHDBC getODBCConnection(void) const;
+ void commit(void);
+ void rollback(void);
+ StatementPtr createStatement(void);
+ //PreparedStatement& prepareStatement(string sql);
+
+};
+
+ };
+ };
+};
+
+#endif //CONNECTION_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/CreatedDataObject.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/CreatedDataObject.h
new file mode 100644
index 0000000000..54ef73b729
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/CreatedDataObject.h
@@ -0,0 +1,55 @@
+/*
+ * 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 CREATED_DATA_OBJECT_H
+#define CREATED_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 ModifiedDataObject;
+
+class CreatedDataObject : public DASDataObject {
+
+ private:
+ std::string statement;
+
+ public:
+ CreatedDataObject(const Table& table, commonj::sdo::DataObjectPtr dataObject,
+ commonj::sdo::ChangeSummaryPtr changeSummary);
+
+ ~CreatedDataObject(void);
+
+ std::string getStatement(void) const;
+ void printStmt(void);
+
+};
+
+ };
+ };
+};
+
+#endif //CREATED_DATA_OBJECT_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASColumnNotFoundException.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASColumnNotFoundException.h
new file mode 100644
index 0000000000..9ebaebc1b9
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASColumnNotFoundException.h
@@ -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_COLUMN_NOT_FOUND_EXCEPTION_H
+#define DAS_COLUMN_NOT_FOUND_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class DASColumnNotFoundException : public std::exception {
+
+ public:
+ DASColumnNotFoundException(std::string message = "");
+ virtual ~DASColumnNotFoundException(void);
+
+};
+
+ };
+ };
+};
+
+#endif //DAS_COLUMN_NOT_FOUND_EXCEPTION_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASDataObject.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASDataObject.h
new file mode 100644
index 0000000000..39a5248f67
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASDataObject.h
@@ -0,0 +1,81 @@
+/*
+ * 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 DAS_DATA_OBJECT_H
+#define DAS_DATA_OBJECT_H
+
+#include "apache/das/rdb/PKObject.h"
+//#include "apache/das/rdb/Statement.h"
+#include "apache/das/rdb/RelationshipStatement.h"
+
+#include "commonj/sdo/DataObject.h"
+#include "commonj/sdo/SettingList.h"
+#include "commonj/sdo/ChangeSummary.h"
+#include "apache/das/rdb/DASOptimisticConcurrencyControlException.h"
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class ColumnData;
+class Table;
+class RelationshipStatement;
+
+class DASDataObject : public PKObject {
+
+ private:
+ commonj::sdo::DataObjectPtr dataObject;
+ commonj::sdo::ChangeSummaryPtr changeSummary;
+ std::list<std::string> updateStatements;
+ std::map<std::string, RelationshipStatement*> fks;
+ std::list<RelationshipStatement*> dependencies;
+ bool occChecked;
+
+ public:
+ DASDataObject(const Table& table, commonj::sdo::DataObjectPtr dataObject,
+ commonj::sdo::ChangeSummaryPtr changeSummary);
+
+ ~DASDataObject(void);
+
+ const commonj::sdo::DataObjectPtr getDataObject(void) const;
+ std::string getWhereStmt(void) const;
+ RelationshipStatement& addFK(const Relationship& relationship, const KeyDataList* keyDataList);
+
+ virtual std::string getStatement(void) const;
+ virtual void addDependency(RelationshipStatement& relationshipStatement);
+
+ virtual void execute(StatementPtr stmt);
+ virtual void printStmt(void);
+
+ virtual bool isOCCChecked(void) const;
+ virtual void setOCCChecked(bool occChecked);
+ virtual long getOldOCC(void) const;
+ virtual long getNewOCC(void) const;
+
+};
+
+ };
+ };
+};
+
+#include "apache/das/rdb/Table.h"
+#include "apache/das/StringWrapper.h"
+#include "apache/das/rdb/ColumnData.h"
+
+#endif //DAS_DATA_OBJECT_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASFactoryImpl.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASFactoryImpl.h
new file mode 100644
index 0000000000..bed088f246
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASFactoryImpl.h
@@ -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 D_A_S_FACTORY_IMPL_H
+#define D_A_S_FACTORY_IMPL_H
+
+#include <windows.h>
+#include <sql.h>
+#include <sqlext.h>
+
+#include "apache/das/DAS.h"
+#include "apache/das/rdb/DASImpl.h"
+#include "apache/das/DASFactory.h"
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class DASFactoryImpl : public DASFactory {
+
+ public:
+ DASFactoryImpl(void);
+ virtual ~DASFactoryImpl(void);
+ DAS* createDAS(Connection& connection);
+ DAS* createDAS(const Config& config, rdb::Connection& connection);
+ DAS* createDAS(const Config& config);
+
+};
+
+ };
+ };
+};
+
+#endif //D_A_S_FACTORY_IMPL_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASImpl.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASImpl.h
new file mode 100644
index 0000000000..36fac709e7
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASImpl.h
@@ -0,0 +1,79 @@
+/*
+ * 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 D_A_S_IMPL_H
+#define D_A_S_IMPL_H
+
+#include <windows.h>
+#include <sql.h>
+#include <map>
+#include <string>
+#include <cctype>
+#include <list>
+
+#include "apache/das/rdb/ApplyChanges.h"
+#include "apache/das/rdb/ConfigImpl.h"
+#include "apache/das/DAS.h"
+#include "apache/das/rdb/Connection.h"
+#include "apache/das/rdb/DASFactoryImpl.h"
+#include "apache/das/rdb/ReadCommandImpl.h"
+#include "apache/das/CommandPtr.h"
+
+#include "commonj/sdo/DataFactory.h"
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class ConfigImpl;
+class CommandImpl;
+class ReadCommandImpl;
+
+class DASImpl : public DAS {
+
+ private:
+ static DASFactory* FACTORY;
+
+ Connection* connection;
+ std::list<CommandPtr*>* createdCommands;
+ ConfigImpl* config;
+
+ public:
+ static DASFactory& getFACTORY(void);
+
+ DASImpl(const Config& config, Connection& inConnection);
+ DASImpl(Connection& inConnection);
+ DASImpl(const Config& config);
+ virtual ~DASImpl(void);
+
+ Connection* getConnection(void);
+ void setConnection(Connection* aConnection);
+ const ::apache::das::Config& getConfig(void) const;
+ void releaseResources(void);
+ CommandPtr createCommand(std::string sql);
+ void closeConnection(void);
+ void applyChanges(commonj::sdo::DataObjectPtr root);
+ CommandPtr getCommand(std::string commandName);
+
+};
+
+ };
+ };
+};
+
+#endif //D_A_S_IMPL_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidColumnNameException.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidColumnNameException.h
new file mode 100644
index 0000000000..2052a50c27
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidColumnNameException.h
@@ -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_INVALID_COLUMN_NAME_EXCEPTION_H
+#define DAS_INVALID_COLUMN_NAME_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class DASInvalidColumnNameException : public std::exception {
+
+ public:
+ DASInvalidColumnNameException(std::string message = "");
+ virtual ~DASInvalidColumnNameException(void);
+
+};
+
+ };
+ };
+};
+
+#endif //DAS_INVALID_COLUMN_NAME_EXCEPTION_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidRelationshipNameException.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidRelationshipNameException.h
new file mode 100644
index 0000000000..58276365ff
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidRelationshipNameException.h
@@ -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_INVALID_RELATIONSHIP_NAME_EXCEPTION_H
+#define DAS_INVALID_RELATIONSHIP_NAME_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class DASInvalidRelationshipNameException : public std::exception {
+
+ public:
+ DASInvalidRelationshipNameException(std::string = "");
+ virtual ~DASInvalidRelationshipNameException(void);
+
+};
+
+ };
+ };
+};
+
+#endif //DAS_INVALID_RELATIONSHIP_NAME_EXCEPTION_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidSDOTypeException.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidSDOTypeException.h
new file mode 100644
index 0000000000..245184d44a
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidSDOTypeException.h
@@ -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_INVALID_SDO_TYPE_EXCEPTION_H
+#define DAS_INVALID_SQL_TYPE_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class DASInvalidSDOTypeException : public std::exception {
+
+ public:
+ DASInvalidSDOTypeException(std::string message = "");
+ virtual ~DASInvalidSDOTypeException(void);
+
+};
+
+ };
+ };
+};
+
+#endif //DAS_INVALID_SDO_TYPE_EXCEPTION_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidSQLTypeException.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidSQLTypeException.h
new file mode 100644
index 0000000000..cf9735bb50
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidSQLTypeException.h
@@ -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_INVALID_SQL_TYPE_EXCEPTION_H
+#define DAS_INVALID_SQL_TYPE_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class DASInvalidSQLTypeException : public std::exception {
+
+ public:
+ DASInvalidSQLTypeException(std::string message = "");
+ virtual ~DASInvalidSQLTypeException(void);
+
+};
+
+ };
+ };
+};
+
+#endif //DAS_INVALID_SQL_TYPE_EXCEPTION_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidTableNameException.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidTableNameException.h
new file mode 100644
index 0000000000..14e831d7be
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASInvalidTableNameException.h
@@ -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_INVALID_TABLE_NAME_EXCEPTION_H
+#define DAS_INVALID_TABLE_NAME_EXCEPTION_H
+
+#include <stdexcept>
+
+namespace apache {
+ namespace das {
+ namespace rdb {
+
+class DASInvalidTableNameException : public std::exception {
+
+ public:
+ DASInvalidTableNameException(std::string message = "");
+ virtual ~DASInvalidTableNameException(void);
+
+};
+
+ };
+ };
+};
+
+#endif //DAS_INVALID_TABLE_NAME_EXCEPTION_H
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASOptimisticConcurrencyControlException.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASOptimisticConcurrencyControlException.h
new file mode 100644
index 0000000000..ca183d819d
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASOptimisticConcurrencyControlException.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASPrimaryKeyNotFoundException.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASPrimaryKeyNotFoundException.h
new file mode 100644
index 0000000000..779d1ca2f0
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DASPrimaryKeyNotFoundException.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/DeletedDataObject.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DeletedDataObject.h
new file mode 100644
index 0000000000..dc18d68bbc
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/DeletedDataObject.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/GraphBuilder.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/GraphBuilder.h
new file mode 100644
index 0000000000..4baaf838e2
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/GraphBuilder.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/GraphBuilderMetaData.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/GraphBuilderMetaData.h
new file mode 100644
index 0000000000..ecc287b302
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/GraphBuilderMetaData.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/KeyPair.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/KeyPair.h
new file mode 100644
index 0000000000..67b4f0c252
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/KeyPair.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/ModifiedDataObject.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ModifiedDataObject.h
new file mode 100644
index 0000000000..ccdd69e3f5
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ModifiedDataObject.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/ODBCTypeHelper.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ODBCTypeHelper.h
new file mode 100644
index 0000000000..0b9f29922d
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ODBCTypeHelper.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/PKObject.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/PKObject.h
new file mode 100644
index 0000000000..ef308bfdc2
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/PKObject.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/PreparedStatement.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/PreparedStatement.h
new file mode 100644
index 0000000000..57f9fc89bd
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/PreparedStatement.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/ReadCommandImpl.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ReadCommandImpl.h
new file mode 100644
index 0000000000..9d16dcbca9
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ReadCommandImpl.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/Relationship.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/Relationship.h
new file mode 100644
index 0000000000..8fb76a845f
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/Relationship.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/RelationshipStatement.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/RelationshipStatement.h
new file mode 100644
index 0000000000..17ab918a4f
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/RelationshipStatement.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/RelationshipWrapper.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/RelationshipWrapper.h
new file mode 100644
index 0000000000..d402ab3ae3
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/RelationshipWrapper.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSet.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSet.h
new file mode 100644
index 0000000000..672a4797d5
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSet.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSetMetaData.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSetMetaData.h
new file mode 100644
index 0000000000..8275412caa
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSetMetaData.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSetPtr.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSetPtr.h
new file mode 100644
index 0000000000..fe62a59a94
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/ResultSetPtr.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/SQLException.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/SQLException.h
new file mode 100644
index 0000000000..3ac52de7c0
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/SQLException.h
@@ -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;
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/Statement.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/Statement.h
new file mode 100644
index 0000000000..956f3e5d5c
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/Statement.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/StatementPtr.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/StatementPtr.h
new file mode 100644
index 0000000000..38980e0877
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/StatementPtr.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/Table.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/Table.h
new file mode 100644
index 0000000000..4847dc0d25
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/Table.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/TableData.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/TableData.h
new file mode 100644
index 0000000000..12fdd73c74
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/TableData.h
@@ -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
diff --git a/das-cpp/trunk/runtime/core/include/apache/das/rdb/das_constants.h b/das-cpp/trunk/runtime/core/include/apache/das/rdb/das_constants.h
new file mode 100644
index 0000000000..e85f6548c2
--- /dev/null
+++ b/das-cpp/trunk/runtime/core/include/apache/das/rdb/das_constants.h
@@ -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"