You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2007/02/07 09:06:57 UTC
svn commit: r504457 - in /incubator/tuscany/cpp/das:
VSExpress/tuscany_das/das_runtime/ runtime/core/src/
Author: lresende
Date: Wed Feb 7 00:06:55 2007
New Revision: 504457
URL: http://svn.apache.org/viewvc?view=rev&rev=504457
Log:
Latest patch from Adriano Crestani
Modified:
incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_runtime/das_runtime.vcproj
incubator/tuscany/cpp/das/runtime/core/src/BaseCommandImpl.h
incubator/tuscany/cpp/das/runtime/core/src/ChangeOperation.h
incubator/tuscany/cpp/das/runtime/core/src/Config.h
incubator/tuscany/cpp/das/runtime/core/src/ConfigFactory.h
incubator/tuscany/cpp/das/runtime/core/src/ConfigFactoryImpl.cpp
incubator/tuscany/cpp/das/runtime/core/src/ConfigHelper.cpp
incubator/tuscany/cpp/das/runtime/core/src/ConfigHelper.h
incubator/tuscany/cpp/das/runtime/core/src/ConfigImpl.cpp
incubator/tuscany/cpp/das/runtime/core/src/ConfigImpl.h
incubator/tuscany/cpp/das/runtime/core/src/ConnectionImpl.cpp
incubator/tuscany/cpp/das/runtime/core/src/ConnectionImpl.h
incubator/tuscany/cpp/das/runtime/core/src/CreateOperation.cpp
incubator/tuscany/cpp/das/runtime/core/src/DAS.h
incubator/tuscany/cpp/das/runtime/core/src/DASFactory.h
incubator/tuscany/cpp/das/runtime/core/src/DASFactoryImpl.cpp
incubator/tuscany/cpp/das/runtime/core/src/DASFactoryImpl.h
incubator/tuscany/cpp/das/runtime/core/src/DASImpl.cpp
incubator/tuscany/cpp/das/runtime/core/src/DASImpl.h
incubator/tuscany/cpp/das/runtime/core/src/DASObject.h
incubator/tuscany/cpp/das/runtime/core/src/DataObjectMaker.cpp
incubator/tuscany/cpp/das/runtime/core/src/DataObjectMaker.h
incubator/tuscany/cpp/das/runtime/core/src/DatabaseObject.cpp
incubator/tuscany/cpp/das/runtime/core/src/DatabaseObject.h
incubator/tuscany/cpp/das/runtime/core/src/Delete.h
incubator/tuscany/cpp/das/runtime/core/src/GraphBuilderMetadata.h
incubator/tuscany/cpp/das/runtime/core/src/InsertCommandImpl.cpp
incubator/tuscany/cpp/das/runtime/core/src/KeyPair.h
incubator/tuscany/cpp/das/runtime/core/src/MappingWrapper.h
incubator/tuscany/cpp/das/runtime/core/src/Parameter.h
incubator/tuscany/cpp/das/runtime/core/src/ReadCommandImpl.h
incubator/tuscany/cpp/das/runtime/core/src/ResultDescriptor.h
incubator/tuscany/cpp/das/runtime/core/src/ResultMetadata.h
incubator/tuscany/cpp/das/runtime/core/src/ResultSetShape.h
incubator/tuscany/cpp/das/runtime/core/src/SPCommandImpl.h
Modified: incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_runtime/das_runtime.vcproj
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_runtime/das_runtime.vcproj?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_runtime/das_runtime.vcproj (original)
+++ incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_runtime/das_runtime.vcproj Wed Feb 7 00:06:55 2007
@@ -292,6 +292,10 @@
>
</File>
<File
+ RelativePath="..\..\..\runtime\core\src\DAS.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\runtime\core\src\DASFactoryImpl.cpp"
>
</File>
@@ -450,6 +454,10 @@
>
</File>
<File
+ RelativePath="..\..\..\runtime\core\src\TableData.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\runtime\core\src\TableImpl.cpp"
>
</File>
@@ -481,6 +489,32 @@
RelativePath="..\..\..\runtime\core\src\WriteCommandImpl.cpp"
>
</File>
+ <Filter
+ Name="Config"
+ >
+ <File
+ RelativePath="..\..\..\runtime\core\src\config\CommandImpl.cpp"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ ObjectFile="$(IntDir)\$(InputName)1.obj"
+ XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ ObjectFile="$(IntDir)\$(InputName)1.obj"
+ XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
</Filter>
<Filter
Name="Header Files"
@@ -783,6 +817,10 @@
>
</File>
<File
+ RelativePath="..\..\..\runtime\core\src\TableData.h"
+ >
+ </File>
+ <File
RelativePath="..\..\..\runtime\core\src\TableImpl.h"
>
</File>
@@ -818,6 +856,18 @@
RelativePath="..\..\..\runtime\core\src\WriteCommandImpl.h"
>
</File>
+ <Filter
+ Name="Config"
+ >
+ <File
+ RelativePath="..\..\..\runtime\core\src\config\Command.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\runtime\core\src\config\CommandImpl.h"
+ >
+ </File>
+ </Filter>
</Filter>
<Filter
Name="Resource Files"
Modified: incubator/tuscany/cpp/das/runtime/core/src/BaseCommandImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/BaseCommandImpl.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/BaseCommandImpl.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/BaseCommandImpl.h Wed Feb 7 00:06:55 2007
@@ -35,11 +35,11 @@
BaseCommandImpl(void);
virtual ~BaseCommandImpl(void);
void setConnection(HDBC* connection);
- void setConnection(HDBC* connection, Config* config);
+ virtual void setConnection(HDBC* connection, Config* config);
void setConnection(HDBC* connection, bool manageTransaction);
virtual void setConnection(ConnectionImpl* c);
void setConfigWrapper(MappingWrapper* configWrapper);
};
-#endif //BASE_COMMAND_IMPL_H
\ No newline at end of file
+#endif //BASE_COMMAND_IMPL_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/ChangeOperation.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ChangeOperation.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ChangeOperation.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ChangeOperation.h Wed Feb 7 00:06:55 2007
@@ -38,7 +38,7 @@
protected:
DatabaseObject* dObject;
- string* propagatedID;
+ string propagatedID;
public:
ChangeOperation(DeleteCommandImpl* command);
@@ -50,4 +50,4 @@
};
-#endif //CHANGE_OPERATION_H
\ No newline at end of file
+#endif //CHANGE_OPERATION_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/Config.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/Config.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/Config.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/Config.h Wed Feb 7 00:06:55 2007
@@ -19,9 +19,11 @@
#ifndef CONFIG_H
#define CONFIG_H
-#include <list>;
+#include <list>
#include "ConnectionInfo.h"
+#include "Relationship.h"
+#include "config/Command.h"
using namespace std;
@@ -40,7 +42,7 @@
* @return the value of the '<em>Command</em>' containment reference list.
* @generated
*/
- list<string>* getCommand(void);
+ list<config::Command*>* getCommand(void);
/**
* Returns the value of the '<em><b>Table</b></em>' containment reference list.
@@ -68,7 +70,7 @@
* @return the value of the '<em>Relationship</em>' containment reference list.
* @generated
*/
- list<string>* getRelationship();
+ list<Relationship*>* getRelationship();
/**
* Returns the value of the '<em><b>Connection Info</b></em>' containment reference.
@@ -145,4 +147,4 @@
}; // Config
-#endif //CONFIG_H
\ No newline at end of file
+#endif //CONFIG_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/ConfigFactory.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ConfigFactory.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ConfigFactory.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ConfigFactory.h Wed Feb 7 00:06:55 2007
@@ -20,7 +20,7 @@
#define CONFIG_FACTORY_H
#include "Column.h"
-#include "Command.h"
+#include "config/Command.h"
#include "Config.h"
#include "ConnectionInfo.h"
#include "Create.h"
@@ -60,7 +60,7 @@
* @return a new object of class '<em>Command</em>'.
* @generated
*/
- virtual Command* createCommand(void) = 0;
+ virtual config::Command* createCommand(void) = 0;
/**
* Returns a new object of class '<em>Config</em>'.
Modified: incubator/tuscany/cpp/das/runtime/core/src/ConfigFactoryImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ConfigFactoryImpl.cpp?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ConfigFactoryImpl.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ConfigFactoryImpl.cpp Wed Feb 7 00:06:55 2007
@@ -6,17 +6,16 @@
* 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.
+ * under the License.
*/
-
#include "ConfigFactoryImpl.h"
ConfigFactoryImpl* ConfigFactoryImpl::init(void) {
@@ -146,7 +145,7 @@
Type* ConfigFactoryImpl::getParameter(void) {
return parameterType;
-
+
}
Type* ConfigFactoryImpl::getRelationship(void) {
@@ -170,7 +169,7 @@
return;
}
- isCreated = true;
+ isCreated = true;
/*columnType = createType(false, COLUMN);
createProperty(true, columnType, ColumnImpl::COLUMN_NAME);
@@ -248,12 +247,12 @@
//void ConfigFactoryImpl::createXSDMetaData(ModelFactoryImpl& theModelPackageImpl) {
// super.createXSDMetaData();
-//
+//
// Property& property = NULL;
-//
+//
// addXSDMapping
// (columnType,
-// new String[]
+// new String[]
// {
// "name", "Column",
// "kind", "empty"
@@ -317,7 +316,7 @@
//
// addXSDMapping
// (commandType,
-// new String[]
+// new String[]
// {
// "name", "Command",
// "kind", "elementOnly"
@@ -367,7 +366,7 @@
//
// addXSDMapping
// (configType,
-// new String[]
+// new String[]
// {
// "name", "Config",
// "kind", "elementOnly"
@@ -427,7 +426,7 @@
//
// addXSDMapping
// (connectionInfoType,
-// new String[]
+// new String[]
// {
// "name", "ConnectionInfo",
// "kind", "empty"
@@ -451,7 +450,7 @@
//
// addXSDMapping
// (createType,
-// new String[]
+// new String[]
// {
// "name", "Create",
// "kind", "empty"
@@ -475,7 +474,7 @@
//
// addXSDMapping
// (deleteType,
-// new String[]
+// new String[]
// {
// "name", "Delete",
// "kind", "empty"
@@ -506,10 +505,10 @@
// "name", "Config",
// "namespace", "##targetNamespace"
// });
-//
+//
// addXSDMapping
// (keyPairType,
-// new String[]
+// new String[]
// {
// "name", "KeyPair",
// "kind", "empty"
@@ -533,7 +532,7 @@
//
// addXSDMapping
// (parameterType,
-// new String[]
+// new String[]
// {
// "name", "Parameter",
// "kind", "empty"
@@ -565,7 +564,7 @@
//
// addXSDMapping
// (relationshipType,
-// new String[]
+// new String[]
// {
// "name", "Relationship",
// "kind", "elementOnly"
@@ -622,7 +621,7 @@
//
// addXSDMapping
// (resultDescriptorType,
-// new String[]
+// new String[]
// {
// "name", "ResultDescriptor",
// "kind", "empty"
@@ -654,7 +653,7 @@
//
// addXSDMapping
// (tableType,
-// new String[]
+// new String[]
// {
// "name", "Table",
// "kind", "elementOnly"
@@ -714,7 +713,7 @@
//
// addXSDMapping
// (updateType,
-// new String[]
+// new String[]
// {
// "name", "Update",
// "kind", "empty"
Modified: incubator/tuscany/cpp/das/runtime/core/src/ConfigHelper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ConfigHelper.cpp?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ConfigHelper.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ConfigHelper.cpp Wed Feb 7 00:06:55 2007
@@ -16,19 +16,21 @@
* specific language governing permissions and limitations
* under the License.
*/
+#include "ConfigHelper.h"
+
ConfigHelper::ConfigHelper() {
factory = ConfigFactory.INSTANCE;
- config = factory->createConfig();
- configWrapper = MappingWrapper(config);
+ iConfig = factory->createConfig();
+ configWrapper = new MappingWrapper(iConfig);
}
-ConfigHelper::ConfigHelper(Config* config) {
+ConfigHelper::ConfigHelper(Config* aConfig) {
factory = ConfigFactory.INSTANCE;
iConfig = aConfig;
- configWrapper = MappingWrapper(config);
+ configWrapper = new MappingWrapper(iConfig);
}
@@ -92,6 +94,7 @@
}
Config* ConfigHelper::getConfig(void) {
- return config;
+ return iConfig;
}
+
Modified: incubator/tuscany/cpp/das/runtime/core/src/ConfigHelper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ConfigHelper.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ConfigHelper.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ConfigHelper.h Wed Feb 7 00:06:55 2007
@@ -38,7 +38,7 @@
public:
ConfigHelper(void);
- ConfigHelper(Config* config);
+ ConfigHelper(Config* aConfig);
virtual ~ConfigHelper(void);
void addPrimaryKey(string columnName);
Relationship* addRelationship(string parentName, string childName);
@@ -58,4 +58,4 @@
};
-#endif //CONFIG_HELPER_H
\ No newline at end of file
+#endif //CONFIG_HELPER_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/ConfigImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ConfigImpl.cpp?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ConfigImpl.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ConfigImpl.cpp Wed Feb 7 00:06:55 2007
@@ -22,7 +22,7 @@
initializeaVariables();
}
-ConfigImpl::~ConfigImple(void) {
+ConfigImpl::~ConfigImpl(void) {
}
void ConfigImpl::initializeaVariables(void) {
@@ -35,55 +35,55 @@
}
-Type& ConfigImpl::getType(void) {
- return ((ConfigFactoryImpl) ConfigFactory.INSTANCE).getConfig();
+Type* ConfigImpl::getType(void) {
+ return ((ConfigFactoryImpl*) ConfigFactory::INSTANCE)->getConfig();
}
-list<Command*>& ConfigImpl::getCommand(void) {
+list<Command*>* ConfigImpl::getCommand(void) {
if (command == NULL) {
- command = createPropertyList(ListKind.CONTAINMENT, Command.class, COMMAND);
+ //command = createPropertyList(ListKind.CONTAINMENT, Command.class, COMMAND);
}
return command;
}
-list<Table*>& ConfigImpl::getTable(void) {
+list<Table*>* ConfigImpl::getTable(void) {
if (table == NULL) {
- table = createPropertyList(ListKind.CONTAINMENT, Table.class, TABLE);
+ //table = createPropertyList(ListKind.CONTAINMENT, Table.class, TABLE);
}
return table;
}
-list<Relationship*>& ConfigImpl::getRelationship(void) {
+list<Relationship*>* ConfigImpl::getRelationship(void) {
if (relationship == NULL) {
- relationship = createPropertyList(ListKind.CONTAINMENT, Relationship.class, RELATIONSHIP);
+ //relationship = createPropertyList(ListKind.CONTAINMENT, Relationship.class, RELATIONSHIP);
}
return relationship;
}
-ConnectionInfo& ConfigImpl::getConnectionInfo(void) {
+ConnectionInfo* ConfigImpl::getConnectionInfo(void) {
return connectionInfo;
}
-ChangeContext& ConfigImpl::basicSetConnectionInfo(ConnectionInfo& newConnectionInfo, ChangeContext& changeContext) {
- ConnectionInfo oldConnectionInfo = connectionInfo;
- connectionInfo = newConnectionInfo;
- return changeContext;
+//ChangeContext& ConfigImpl::basicSetConnectionInfo(ConnectionInfo& newConnectionInfo, ChangeContext& changeContext) {
+// ConnectionInfo oldConnectionInfo = connectionInfo;
+// connectionInfo = newConnectionInfo;
+// return changeContext;
+//
+//}
-}
-
-void ConfigImpl::setConnectionInfo(ConnectionInfo& newConnectionInfo) {
+void ConfigImpl::setConnectionInfo(ConnectionInfo* newConnectionInfo) {
if (newConnectionInfo != connectionInfo) {
- ChangeContext changeContext = NULL;
+ /*ChangeContext changeContext = NULL;
if (connectionInfo != NULL) {
changeContext = inverseRemove(connectionInfo, *this, OPPOSITE_FEATURE_BASE - CONNECTION_INFO, NULL, changeContext);
@@ -94,7 +94,9 @@
}
changeContext = basicSetConnectionInfo(newConnectionInfo, changeContext);
- if (changeContext != null) dispatch(changeContext);
+ if (changeContext != NULL) {
+ dispatch(changeContext);
+ }*/
}
@@ -116,30 +118,30 @@
dataObjectModel = newDataObjectModel;
}
-ChangeContext& ConfigImpl::inverseRemove(DASObject& otherEnd, int propertyIndex, ChangeContext& changeContext) {
+//ChangeContext& ConfigImpl::inverseRemove(DASObject& otherEnd, int propertyIndex, ChangeContext& changeContext) {
+//
+// switch (propertyIndex) {
+//
+// case COMMAND:
+// return removeFromList(getCommand(), otherEnd, changeContext);
+//
+// case TABLE:
+// return removeFromList(getTable(), otherEnd, changeContext);
+//
+// case RELATIONSHIP:
+// return removeFromList(getRelationship(), otherEnd, changeContext);
+//
+// case CONNECTION_INFO:
+// return basicSetConnectionInfo(null, changeContext);
+//
+// }
+//
+// return DataObjectBase::inverseRemove(otherEnd, propertyIndex, changeContext);
+//
+//}
- switch (propertyIndex) {
-
- case COMMAND:
- return removeFromList(getCommand(), otherEnd, changeContext);
-
- case TABLE:
- return removeFromList(getTable(), otherEnd, changeContext);
-
- case RELATIONSHIP:
- return removeFromList(getRelationship(), otherEnd, changeContext);
-
- case CONNECTION_INFO:
- return basicSetConnectionInfo(null, changeContext);
-
- }
-
- return DataObjectBase::inverseRemove(otherEnd, propertyIndex, changeContext);
-
-}
-
-DASObject& ConfigImpl::get(int propertyIndex, bool resolve) {
- switch (propertyIndex) {
+DASObject* ConfigImpl::get(int propertyIndex, bool resolve) {
+ /*switch (propertyIndex) {
case COMMAND:
return getCommand();
@@ -161,12 +163,12 @@
}
- return DataObjectBase::get(propertyIndex, resolve);
+ return DataObjectBase::get(propertyIndex, resolve);*/
}
-void ConfigImpl::set(int propertyIndex, DASObject& newValue) {
- switch (propertyIndex) {
+void ConfigImpl::set(int propertyIndex, DASObject* newValue) {
+ /*switch (propertyIndex) {
case COMMAND:
getCommand().clear();
@@ -197,27 +199,27 @@
}
- DataObjectBase::set(propertyIndex, newValue);
+ DataObjectBase::set(propertyIndex, newValue);*/
}
void ConfigImpl::unset(int propertyIndex) {
- switch (propertyIndex) {
+ /*switch (propertyIndex) {
case COMMAND:
- getCommand().clear();
+ getCommand()->clear();
return;
case TABLE:
- getTable().clear();
+ getTable()->clear();
return;
case RELATIONSHIP:
- getRelationship().clear();
+ getRelationship()->clear();
return;
case CONNECTION_INFO:
- setConnectionInfo((ConnectionInfo)null);
+ setConnectionInfo(NULL);
return;
case URI:
@@ -230,34 +232,34 @@
}
- DataObjectBase::unset(propertyIndex);
+ DataObjectBase::unset(propertyIndex);*/
}
bool ConfigImpl::isSet(int propertyIndex) {
- switch (propertyIndex) {
+ /*switch (propertyIndex) {
case COMMAND:
- return command != NULL && !(command.size() == 0);
+ return command != NULL && !(command->size() == 0);
case TABLE:
- return table != NULL && !(table.size() == 0);
+ return table != NULL && !(table->size() == 0);
case RELATIONSHIP:
- return relationship != NULL && !(relationship.size() == 0);
+ return relationship != NULL && !(relationship->size() == 0);
case CONNECTION_INFO:
return connectionInfo != NULL;
case URI:
- return URI_DEFAULT_ == NULL ? uri != NULL : strcmp(URI_DEFAULT_, uri) != 0;
+ return URI_DEFAULT_ == "" ? uri != "" : URI_DEFAULT_ != uri;
case DATA_OBJECT_MODEL:
- return DATA_OBJECT_MODEL_DEFAULT_ == NULL ? dataObjectModel != NULL : strcmp(DATA_OBJECT_MODEL_DEFAULT_, dataObjectModel) != 0;
+ return DATA_OBJECT_MODEL_DEFAULT_ == "" ? dataObjectModel != "" : DATA_OBJECT_MODEL_DEFAULT_ != dataObjectModel;
}
- return DataObjectBase::isSet(propertyIndex);
+ return DataObjectBase::isSet(propertyIndex);*/
}
Modified: incubator/tuscany/cpp/das/runtime/core/src/ConfigImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ConfigImpl.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ConfigImpl.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ConfigImpl.h Wed Feb 7 00:06:55 2007
@@ -28,6 +28,8 @@
#include "Relationship.h"
#include "ConnectionInfo.h"
#include "DASObject.h"
+#include "ConfigFactory.h"
+#include "ConfigFactoryImpl.h"
#include "commonj/sdo/Type.h"
Modified: incubator/tuscany/cpp/das/runtime/core/src/ConnectionImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ConnectionImpl.cpp?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ConnectionImpl.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ConnectionImpl.cpp Wed Feb 7 00:06:55 2007
@@ -18,25 +18,27 @@
*/
#include "ConnectionImpl.h"
-ConnectionImpl::ConnectionImpl(HDBC* aConnection) {
+ConnectionImpl::ConnectionImpl(HENV* aEnvironment, HDBC* aConnection) {
managingTransaction = true;
connection = aConnection;
+ environment = aEnvironment;
//try {
SQLCHAR sqlDbmsName[255];
SQLSMALLINT strLen;
+ SQLINTEGER strLen2;
SQLGetInfo(connection, SQL_DBMS_NAME, sqlDbmsName, sizeof(sqlDbmsName), &strLen);
- string dbmsName = sqlDbmsName;
+ string dbmsName = (char*) sqlDbmsName;
- if (string.find("Oracle") < 0) {
+ if (dbmsName.find("Oracle") < 0) {
boolUseGetGeneratedKeys = false;
} else {
boolUseGetGeneratedKeys = true;
}
SQLSMALLINT autoCommit;
- if (SQLGetConnectAttr(connection, SQL_ATTR_AUTOCOMMIT, &autoCommit, sizeof(autoCommit), &strLen) getAutoCommit() == SQL_AUTOCOMMIT_ON) {
+ if (SQLGetConnectAttr(connection, SQL_ATTR_AUTOCOMMIT, &autoCommit, sizeof(autoCommit), &strLen2) == SQL_AUTOCOMMIT_ON) {
//throw new RuntimeException("AutoCommit must be off");
}
@@ -49,7 +51,7 @@
ConnectionImpl::~ConnectionImpl(void) {
}
-Connection* ConnectionImpl::getODBCConnection(void) {
+HDBC* ConnectionImpl::getODBCConnection(void) {
return connection;
}
@@ -75,13 +77,13 @@
this.logger.debug("Rolling back Transaction");
}*/
- SQLPrepare(SQL_HANDLE_DBC, connection, SQL_ROLLBACK);
+ SQLTransact(environment, connection, SQL_ROLLBACK);
}
}
-HSTMT* ConnectionImpl::prepareStatement(string queryString, string* returnKeys) {
+HSTMT* ConnectionImpl::prepareStatement(string queryString, string* returnKeys, int keysCount) {
/*if (this.logger.isDebugEnabled()) {
this.logger.debug("Preparing Statement: " + queryString);
@@ -89,15 +91,15 @@
HSTMT statement;
SQLAllocStmt( connection, &statement);
- if (useGetGeneratedKeys) {
- SQLPrepare(statement, queryString, SQL_NTS);
- } else if (returnKeys.length > 0) {
- SQLPrepare(statement, queryString, SQL_NTS);
+ if (boolUseGetGeneratedKeys) {
+ SQLPrepare(statement, (SQLCHAR*) queryString.c_str(), SQL_NTS);
+ } else if (keysCount > 0) {
+ SQLPrepare(statement, (SQLCHAR*) queryString.c_str(), SQL_NTS);
} else {
- SQLPrepare(statement, queryString, SQL_NTS);
+ SQLPrepare(statement, (SQLCHAR*) queryString.c_str(), SQL_NTS);
}
- return statement;
+ return &statement;
}
@@ -110,11 +112,11 @@
HSTMT statement;
SQLAllocStmt( connection, &statement);
- SQLSetStmtAttr(connection, SQL_ATTR_CONCURRENCY, SQL_CONCUR_READ_ONLY, NULL);
- SQLSetStmtAttr(connection, SQL_ATTR_CURSOR_SENSITIVITY, SQL_INSENSITIVE, NULL);
- SQLPrepare(statement, queryString, SQL_NTS);
+ SQLSetStmtAttr(connection, SQL_ATTR_CONCURRENCY, (SQLPOINTER) SQL_CONCUR_READ_ONLY, NULL);
+ SQLSetStmtAttr(connection, SQL_ATTR_CURSOR_SENSITIVITY, (SQLPOINTER) SQL_INSENSITIVE, NULL);
+ SQLPrepare(statement, (SQLCHAR*) queryString.c_str(), SQL_NTS);
- return statement;
+ return &statement;
}
@@ -125,9 +127,9 @@
HSTMT* ConnectionImpl::prepareCall(string queryString) {
HSTMT statement;
SQLAllocStmt( connection, &statement);
- SQLPrepare(statement, queryString, SQL_NTS);
+ SQLPrepare(statement, (SQLCHAR*) queryString.c_str(), SQL_NTS);
- return statement;
+ return &statement;
}
Modified: incubator/tuscany/cpp/das/runtime/core/src/ConnectionImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ConnectionImpl.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ConnectionImpl.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ConnectionImpl.h Wed Feb 7 00:06:55 2007
@@ -33,21 +33,22 @@
private:
HDBC* connection;
+ HENV* environment;
bool managingTransaction;
bool boolUseGetGeneratedKeys;
public:
- ConnectionImpl(HDBC* connection);
+ ConnectionImpl(HENV* aEnvironment, HDBC* aConnection);
virtual ~ConnectionImpl(void);
HDBC* getODBCConnection(void);
void cleanUp(void);
void errorCleanUp(void);
- PreparedStatement* prepareStatement(string queryString, string* returnKeys, int keysCount);
- PreparedStatement* preparePagedStatement(string queryString);
+ HSTMT* prepareStatement(string queryString, string* returnKeys, int keysCount);
+ HSTMT* preparePagedStatement(string queryString);
void setManageTransactions(int aManageTransactions);
- CallableStatement* prepareCall(string queryString);
+ HSTMT* prepareCall(string queryString);
bool useGetGeneratedKeys(void);
};
-#endif //CONNECTION_IMPL_H
\ No newline at end of file
+#endif //CONNECTION_IMPL_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/CreateOperation.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/CreateOperation.cpp?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/CreateOperation.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/CreateOperation.cpp Wed Feb 7 00:06:55 2007
@@ -18,10 +18,8 @@
*/
#include "CreateOperation.h"
-CreateOperation::CreateOperation(InsertCommandImpl* command, DataObject* changedObject, string id) {
- super(command, changedObject);
- propagatedID = id;
-
+CreateOperation::CreateOperation(InsertCommandImpl* command, DataObject* changedObject, string id) : ChangeOperation(command, changedObject) {
+ propagatedID = id;
}
CreateOperation::~CreateOperation() {
Modified: incubator/tuscany/cpp/das/runtime/core/src/DAS.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/DAS.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/DAS.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/DAS.h Wed Feb 7 00:06:55 2007
@@ -20,23 +20,27 @@
#define D_A_S_H
#include "DASFactory.h"
-#include "DASFactoryImpl.h"
#include "Command.h"
#include "commonj/sdo/DataObject.h"
using namespace commonj::sdo;
-virtual class DAS {
+class DAS {
+
+ private:
+ static DASFactory* FACTORY;
public:
- DASFactory FACTORY = new DASFactoryImpl();
+ static DASFactory* getFACTORY(void);
- void applyChanges(DataObject* root);
- Command* getCommand(char* name);
- void releaseResources(void);
- Command* createCommand(string sql);
+ DAS(void);
+ virtual ~DAS(void);
+ virtual void applyChanges(DataObject* root);
+ virtual Command* getCommand(char* name);
+ virtual void releaseResources(void);
+ virtual Command* createCommand(string sql);
};
-#endif //D_A_S_H
\ No newline at end of file
+#endif //D_A_S_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/DASFactory.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/DASFactory.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/DASFactory.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/DASFactory.h Wed Feb 7 00:06:55 2007
@@ -19,19 +19,26 @@
#ifndef D_A_S_FACTORY_H
#define D_A_S_FACTORY_H
+#include <windows.h>
#include <sql.h>
+#include <string>
#include "Config.h"
+#include "DAS.h"
+
+using namespace std;
virtual class DASFactory {
public:
- DAS* createDAS(string configStream);
- DAS* createDAS(string configStream, HDBC* connection);
- DAS* createDAS(Config* config);
- DAS* createDAS(Config* config, HDBC* connection);
- DAS* createDAS(HDBC* connection);
+ DASFactory(void);
+ virtual ~DASFactory(void);
+ DASFactory* createDAS(string configStream);
+ DASFactory* createDAS(string configStream, HDBC* connection);
+ DASFactory* createDAS(Config* config);
+ DASFactory* createDAS(Config* config, HDBC* connection);
+ DASFactory* createDAS(HDBC* connection);
};
-#endif //D_A_S_FACTORY_H
\ No newline at end of file
+#endif //D_A_S_FACTORY_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/DASFactoryImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/DASFactoryImpl.cpp?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/DASFactoryImpl.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/DASFactoryImpl.cpp Wed Feb 7 00:06:55 2007
@@ -18,22 +18,26 @@
*/
#include "DASFactoryImpl.h"
-DAS* DASFactoryImpl::createDAS(InputStream* configStream) {
- return DASImpl(configStream);
-}
+DASFactoryImpl::DASFactoryImpl(void) {}
+
+DASFactoryImpl::~DASFactoryImpl(void) {}
+
+//DAS* DASFactoryImpl::createDAS(InputStream* configStream) {
+// return DASImpl(configStream);
+//}
DAS* DASFactoryImpl::createDAS(Config* config) {
- return DASImpl(config);
+ return new DASImpl(config);
}
-DAS* DASFactoryImpl::createDAS(InputStream* configStream, HDBC* connection) {
- return DASImpl(configStream, connection);
-}
+//DAS* DASFactoryImpl::createDAS(InputStream* configStream, HDBC* connection) {
+// return DASImpl(configStream, connection);
+//}
-DAS* DASFactoryImpl::createDAS(Config* config, Connection* connection) {
- return DASImpl(config, connection);
+DAS* DASFactoryImpl::createDAS(Config* config, HDBC* connection) {
+ return new DASImpl(config, connection);
}
DAS* DASFactoryImpl::createDAS(HDBC* connection) {
- return DASImpl(connection);
-}
\ No newline at end of file
+ return new DASImpl(connection);
+}
Modified: incubator/tuscany/cpp/das/runtime/core/src/DASFactoryImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/DASFactoryImpl.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/DASFactoryImpl.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/DASFactoryImpl.h Wed Feb 7 00:06:55 2007
@@ -19,22 +19,26 @@
#ifndef D_A_S_FACTORY_IMPL_H
#define D_A_S_FACTORY_IMPL_H
+#include <windows.h>
#include <sql.h>
+#include <sqlext.h>
#include "DAS.h"
#include "DASImpl.h"
#include "Config.h"
-#include "Connection.h"
+//#include "Connection.h"
class DASFactoryImpl : public DASFactory {
public:
- DAS* createDAS(InputStream* configStream);
+ DASFactoryImpl(void);
+ virtual ~DASFactoryImpl(void);
+ //DAS* createDAS(InputStream* configStream);
DAS* createDAS(Config* config);
- DAS* createDAS(InputStream* configStream, HDBC* connection);
- DAS* createDAS(Config* config, Connection* connection);
+ //DAS* createDAS(InputStream* configStream, HDBC* connection);
+ DAS* createDAS(Config* config, HDBC* connection);
DAS* createDAS(HDBC* connection);
};
-#endif //D_A_S_FACTORY_IMPL_H
\ No newline at end of file
+#endif //D_A_S_FACTORY_IMPL_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/DASImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/DASImpl.cpp?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/DASImpl.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/DASImpl.cpp Wed Feb 7 00:06:55 2007
@@ -18,74 +18,79 @@
*/
#include "DASImpl.h"
-DASImpl::DASImpl(InputStream* stream) {
- this(ConfigUtil.loadConfig(stream));
-}
+//DASImpl::DASImpl(InputStream* stream) {
+// //this(ConfigUtil.loadConfig(stream));
+//}
DASImpl::DASImpl(Config* inConfig) {
+ init(inConfig);
+
+}
+
+
+DASImpl::DASImpl(Config* inConfig, HDBC* inConnection) {
+ init(inConfig);
+ setConnection(inConnection);
+}
+
+//DASImpl::DASImpl(InputStream* configStream, HDBC* inConnection) {
+// this(ConfigUtil.loadConfig(configStream), inConnection);
+//}
+
+DASImpl::DASImpl(HDBC* inConnection) {
+ init(ConfigFactory::INSTANCE->createConfig());
+ setConnection(inConnection);
+
+}
+
+DASImpl::~DASImpl() {
+}
+
+
+void DASImpl::init(Config* inConfig) {
Config* cfg = inConfig;
if (cfg == NULL) {
- cfg = ConfigFactory.INSTANCE.createConfig();
+ cfg = ConfigFactory::INSTANCE->createConfig();
}
- configWrapper = MappingWrapper(cfg);
+ configWrapper = new MappingWrapper(cfg);
- list<Command*>* commandList = configWrapper.getConfig().getCommand();
- list<Command*>::iterator i;
+ list<config::Command*>* commandList = configWrapper->getConfig()->getCommand();
+ list<config::Command*>::iterator i;
for (i = commandList->begin() ; i != commandList->end() ; i++) {
- Command* commandConfig = *i;
+ config::Command* commandConfig = *i;
string kind = commandConfig->getKind();
toLower(kind);
- if (strcmp("select", kind)) == 0) {
- commands.insert(make_pair(commandConfig->getName(), ReadCommandImpl(commandConfig->getSQL(),
+ if ("select" == kind) {
+ commands.insert(make_pair(commandConfig->getName(), new ReadCommandImpl(commandConfig->getSQL(),
configWrapper, commandConfig->getResultDescriptor())));
- } else if (strcmp("update", kind)) == 0) {
- commands.insert(commandConfig->getName(), UpdateCommandImpl(commandConfig->getSQL()));
+ } else if ("update" == kind) {
+ commands.insert(make_pair(commandConfig->getName(), new UpdateCommandImpl(commandConfig->getSQL())));
- } else if (strcmp("insert", kind)) == 0) {
+ } else if ("insert" == kind) {
string* stringList = {{0}};
- commands.insert(commandConfig->getName(), InsertCommandImpl(commandConfig->getSQL(), stringList));
+ commands.insert(make_pair(commandConfig->getName(), new InsertCommandImpl(commandConfig->getSQL(), stringList, 0)));
- } else if (strcmp("delete", kind)) == 0) {
- commands.insert(commandConfig->getName(), DeleteCommandImpl(commandConfig->getSQL()));
+ } else if ("delete" == kind) {
+ commands.insert(make_pair(commandConfig->getName(), new DeleteCommandImpl(commandConfig->getSQL())));
- } else if (strcmp("procedure", kind)) == 0) {
- commands.insert(commandConfig->getName(), SPCommandImpl(commandConfig->getSQL(),
- configWrapper, commandConfig->getParameter()));
+ } else if ("procedure" == kind) {
+ commands.insert(make_pair(commandConfig->getName(), new SPCommandImpl(commandConfig->getSQL(),
+ configWrapper, commandConfig->getParameter())));
} else {
//throw new RuntimeException("Invalid kind of command: " + kind);
}
}
-
-}
-
-DASImpl::DASImpl(Config* inConfig, HDBC* inConnection) {
- this(inConfig);
- setConnection(inConnection);
-
-}
-
-DASImpl::DASImpl(InputStream* configStream, HDBC* inConnection) {
- this(ConfigUtil.loadConfig(configStream), inConnection);
-}
-
-DASImpl::DASImpl(HDBC* inConnection) {
- this(ConfigFactory.INSTANCE.createConfig());
- setConnection(inConnection);
-
-}
-
-DASImpl::~DASImpl() {
}
ApplyChangesCommandImpl* DASImpl::getApplyChangesCommand(void) {
- return ApplyChangesCommandImpl(configWrapper, connection);
+ return new ApplyChangesCommandImpl(configWrapper, connection);
}
Command* DASImpl::getCommand(string name) {
@@ -95,8 +100,8 @@
//throw new RuntimeException("CommandGroup has no command named: " + name);
}
- CommandImpl* cmd = (CommandImpl*) *i;
- cmd->setConnection(getConnection(), configWrapper->getConfig());
+ CommandImpl* cmd = (CommandImpl*) i->second;
+ cmd->setConnection(getConnection(), configWrapper->getConfig());
return cmd;
@@ -120,31 +125,23 @@
Config* config = configWrapper->getConfig();
if (config == NULL || config->getConnectionInfo() == NULL
- || config->getConnectionInfo()->getDataSource() == NULL) {
+ || config->getConnectionInfo()->getDataSource() == "") {
//throw new RuntimeException("No connection has been provided and no data source has been specified");
}
- Connection* connection = NULL;
-
- InitialContext* ctx;
-
- //try {
- ctx = InitialContext();
- //} catch (NamingException e) {
- // throw new RuntimeException(e);
- //}
+ HDBC* connection = new HDBC;
-// try {
- DataSource* ds = (DataSource*) ctx->lookup(configWrapper->getConfig()->getConnectionInfo()->getDataSource());
+ //try {
+ char* ds = (char*) configWrapper->getConfig()->getConnectionInfo()->getDataSource().c_str();
// try {
- connection = ds->getConnection();
+ SQLRETURN sqlConnectRes = SQLConnect(*connection, (SQLCHAR*) ds, SQL_NTS, (SQLCHAR*) NULL, SQL_NTS, (SQLCHAR*) NULL, SQL_NTS);
- if (connection == NULL) {
- // throw new RuntimeException("Could not obtain a Connection from DataSource");
- }
+ if (sqlConnectRes != SQL_SUCCESS && sqlConnectRes != SQL_SUCCESS_WITH_INFO) {
+ //throw new RuntimeException("Could not obtain a Connection from DataSource");
+ }
- SQLSetConnectAttr(connection, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF, SQL_NTS);
- setConnection(connection);
+ SQLSetConnectAttr(connection, SQL_ATTR_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF, SQL_NTS);
+ setConnection(connection);
//} catch (SQLException e) {
// throw new RuntimeException(e);
@@ -170,42 +167,41 @@
}
Command* DASImpl::createCommand(string sql, Config* config) {
- return baseCreateCommand(sql, MappingWrapper(config));
+ return baseCreateCommand(sql, new MappingWrapper(config));
}
Command* DASImpl::baseCreateCommand(string inSql, MappingWrapper* config) {
CommandImpl* returnCmd = NULL;
trim(inSql); // Remove leading white space
- char firstChar = toupper(sql[0]);
+ char firstChar = toupper(inSql[0]);
switch (firstChar) {
case 'S':
- returnCmd = ReadCommandImpl(sql, config, NULL);
+ returnCmd = new ReadCommandImpl(inSql, config, NULL);
break;
case 'I':
- string* stringList[0];
- returnCmd = InsertCommandImpl(sql, stringList);
+ returnCmd = new InsertCommandImpl(inSql, NULL, 0);
break;
case 'U':
- returnCmd = UpdateCommandImpl(sql);
+ returnCmd = new UpdateCommandImpl(inSql);
break;
case 'D':
- returnCmd = DeleteCommandImpl(sql);
+ returnCmd = new DeleteCommandImpl(inSql);
break;
case '{':
- returnCmd = SPCommandImpl(sql, config, Collections.EMPTY_LIST);
+ returnCmd = new SPCommandImpl(inSql, config, new list<Parameter*>);
break;
- default:
+ //default:
//throw new RuntimeException("SQL => " + sql + " is not valid");
}
- returnCmd->setConnection(getConnection(), config-:getConfig());
+ returnCmd->setConnection(getConnection(), config->getConfig());
return returnCmd;
}
@@ -216,7 +212,7 @@
int DASImpl::managingConnections(void) {
- if (configWrapper->getConfig()->getConnectionInfo()->getDataSource() == NULL) {
+ if (configWrapper->getConfig()->getConnectionInfo()->getDataSource() == "") {
return 0;
}
@@ -225,7 +221,7 @@
}
void DASImpl::closeConnection(void) {
- if (connection != null) {
+ if (connection != NULL) {
//try {
SQLDisconnect(connection);
@@ -238,43 +234,43 @@
}
-void DASImpl::toLower(string string) {
+void DASImpl::toLower(string str) {
int i;
- int stringSize = strlen(string);
+ int stringSize = str.size();
for (i = 0 ; i < stringSize ; i++) {
- string[i] = tolower(string[i]);
+ str[i] = tolower(str[i]);
}
}
-void DASImpl::trim(string string) {
- int stringSize = strlen(string);
+void DASImpl::trim(string str) {
+ int stringSize = str.size();
int stringBegin = 0;
- int stringEnd = strlen(string) - 1;
- char actual = string[0];
+ int stringEnd = str.size() - 1;
+ char actual = str[0];
while (actual != ' ') {
stringBegin++;
- actual = string[stringBegin];
+ actual = str[stringBegin];
}
- char actual = string[stringEnd];
+ actual = str[stringEnd];
while (actual != ' ') {
stringEnd--;
- actual = string[stringBegin];
+ actual = str[stringBegin];
}
int i;
int j = 0;
for (i = stringBegin ; i <= stringEnd ; i++) {
- string[j] = string[i];
+ str[j] = str[i];
j++;
}
- string[j] = 0;
+ str[j] = 0;
-}
\ No newline at end of file
+}
Modified: incubator/tuscany/cpp/das/runtime/core/src/DASImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/DASImpl.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/DASImpl.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/DASImpl.h Wed Feb 7 00:06:55 2007
@@ -19,26 +19,28 @@
#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 "config/CommandImpl.h"
#include "MappingWrapper.h"
#include "DAS.h"
+#include "Command.h"
#include "CommandImpl.h"
#include "Config.h"
#include "ApplyChangesCommandImpl.h"
-#include "ConfigUtil.h"
+//#include "ConfigUtil.h"
#include "ConfigFactory.h"
#include "ReadCommandImpl.h"
#include "UpdateCommandImpl.h"
#include "InsertCommandImpl.h"
#include "DeleteCommandImpl.h"
#include "SPCommandImpl.h"
-#include "Connection.h"
-#include "DataSource.h"
+//#include "DataSource.h"
#include "commonj/sdo/DataFactory.h"
@@ -56,12 +58,13 @@
void closeConnection(void);
void toLower(string string);
void trim(string string);
+ void init(Config* inConfig);
public:
- DASImpl(InputStream* stream);
+ //DASImpl(InputStream* stream);
DASImpl(Config* inConfig);
DASImpl(Config* inConfig, HDBC* inConnection);
- DASImpl(InputStream* configStream, HDBC* inConnection);
+ //DASImpl(InputStream* configStream, HDBC* inConnection);
DASImpl(HDBC* inConnection);
virtual ~DASImpl(void);
ApplyChangesCommandImpl* getApplyChangesCommand(void);
@@ -77,4 +80,4 @@
};
-#endif //D_A_S_IMPL_H
\ No newline at end of file
+#endif //D_A_S_IMPL_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/DASObject.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/DASObject.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/DASObject.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/DASObject.h Wed Feb 7 00:06:55 2007
@@ -6,17 +6,16 @@
* 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.
+ * under the License.
*/
-
#ifndef DAS_VALUE_H
#define DAS_VALUE_H
@@ -25,7 +24,7 @@
class DASObject {
private:
- DASPointer dasPointer;
+ DASPointer dasPointer;
short dasValueType;
public:
Modified: incubator/tuscany/cpp/das/runtime/core/src/DataObjectMaker.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/DataObjectMaker.cpp?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/DataObjectMaker.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/DataObjectMaker.cpp Wed Feb 7 00:06:55 2007
@@ -25,35 +25,35 @@
DataObjectMaker::~DataObjectMaker(void) {
}
-DataObject& DataObjectMaker::createAndAddDataObject(TableData& tableData, ResultMetadata& resultMetadata) {
+DataObject& DataObjectMaker::createAndAddDataObject(TableData* tableData, ResultMetadata* resultMetadata) {
/*if (this.logger.isDebugEnabled()) {
this.logger.debug("Looking for Type for " + tableData.getTableName());
}*/
- Type& tableClass = findTableTypeByPropertyName(tableData.getTableName());
+ Type* tableClass = findTableTypeByPropertyName(tableData->getTableName());
if (tableClass == NULL) {
//throw new RuntimeException("An SDO Type with name " + tableData.getTableName() + " was not found");
}
- DataObject& obj = DataFactory.INSTANCE.create(tableClass);
+ DataObjectPtr obj = DataFactory::getDataFactory()->create(tableClass);
// Now, check to see if the root data object has a containment reference
// to this EClass. If so, add it to the graph. If not, it will be taken
// care
// of when we process relationships
- list<Property*>& propertiesList = rootObject.getType().getProperties();
+ list<Property*>& propertiesList = rootObject->getType().getProperties();
list<Property*>::iterator i;
for (i = propertiesList.begin() ; i != propertiesList.end() ; i++) {
- if (i->isContainment() && i->getType() == tableClass) {
+ if ((*i)->isContainment() && (*i)->getType().equals(tableClass)) {
- if (i->isMany()) {
- rootObject.getList(*i).insert(obj);
+ if ((*i)->isMany()) {
+ rootObject->getList(**i).insert(obj);
} else {
- rootObject.set(*i, obj);
+ rootObject->setDataObject(**i, obj);
}
}
@@ -64,16 +64,16 @@
list<string>::iterator j;
for (j = columnNames.begin() ; j != columnNames.end() ; j++) {
- Property& p = findProperty(obj.getType(), *j);
+ Property& p = findProperty(obj->getType(), *j);
if (j == NULL) {
//throw new RuntimeException("Type " + obj.getType().getName()
// + " does not contain a property named " + propertyName);
}
- DASObject value = tableData.getColumnData(propertyName);
+ DASObject value = tableData->getColumnData(propertyName);
- obj.set(*j, value);
+ obj->set(*j, value);
}
@@ -81,17 +81,28 @@
}
-Type& DataObjectMaker::findTableTypeByPropertyName(string tableName) {
-}
+const Type& DataObjectMaker::findTableTypeByPropertyName(string tableName) {
+ PropertyList propertyList = rootObject->getType().getProperties();
+ int i;
-Property& findProperty(Type& type, string columnName) {
- list<Property*>& propertiesList = type.getProperties();
- list<Property*>::iterator i;
+ for (i = 0 ; i < propertyList.size() ; i++) {
- for (i = propertiesList.begin() ; i != propertiesList.end() ; i++) {
+ if (tableName == (string) propertyList[i].getType().getName()) {
+ return propertyList[i].getType();
+ }
+
+ }
+
+}
+
+const Property* findProperty(Type& type, string columnName) {
+ PropertyList propertyList = type.getProperties();
+ int i;
+
+ for (i = 0 ; i < propertyList.size() ; i++) {
- if (strcmp(columnName, i->getName()) == 0) {
- return *i;
+ if (columnName == (string) propertyList[i].getName()) {
+ return &propertyList[i];
}
}
@@ -99,4 +110,5 @@
return NULL;
}
+
Modified: incubator/tuscany/cpp/das/runtime/core/src/DataObjectMaker.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/DataObjectMaker.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/DataObjectMaker.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/DataObjectMaker.h Wed Feb 7 00:06:55 2007
@@ -19,13 +19,25 @@
#ifndef DATA_OBJECT_MAKER_H
#define DATA_OBJECT_MAKER_H
+#include <string>
+
+#include "ResultMetadata.h"
+#include "TableData.h"
+
+#include "commonj/sdo/DataObject.h"
+#include "commonj/sdo/Property.h"
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
class DataObjectMaker {
private:
DataObject* rootObject;
- Type* findTableTypeByPropertyName(string tableName);
- Property* findProperty(Type* type, string columnName);
+ const Type& findTableTypeByPropertyName(string tableName);
+ const Property& findProperty(Type* type, string columnName);
public:
DataObjectMaker(DataObject* root);
@@ -34,4 +46,4 @@
};
-#endif //DATA_OBJECT_MAKER_H
\ No newline at end of file
+#endif //DATA_OBJECT_MAKER_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/DatabaseObject.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/DatabaseObject.cpp?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/DatabaseObject.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/DatabaseObject.cpp Wed Feb 7 00:06:55 2007
@@ -19,7 +19,7 @@
#include "DatabaseObject.h"
DatabaseObject::DatabaseObject(Config* model, DataObject* changedObject) {
- mappingWrapper = MappingWrapper(model);
+ mappingWrapper = new MappingWrapper(model);
dataObject = changedObject;
initialize();
@@ -32,7 +32,7 @@
if (mappingWrapper->getConfig() != NULL) {
- list<Relationship*>* listRelationship = mappingWrapper.getConfig().getRelationship();
+ list<Relationship*>* listRelationship = mappingWrapper->getConfig()->getRelationship();
list<Relationship*>::iterator i;
for (i = listRelationship->begin() ; i != listRelationship->end() ; i++) {
@@ -44,11 +44,11 @@
if (r->getForeignKeyTable() == getTypeName()) {
- list<KeyPair*>* pairs = r.getKeyPair();
+ list<KeyPair*>* pairs = r->getKeyPair();
list<KeyPair*>::iterator j;
for (j = pairs->begin() ; j != pairs->end() ; j++) {
- keyMappings.insert(make_pair(*j->getForeignKeyColumn(), r));
+ keyMappings.insert(make_pair((*j)->getForeignKeyColumn(), r));
}
@@ -60,47 +60,48 @@
}
-DASObject* DatabaseObject::get(string parameter) {
+//DASObject* DatabaseObject::get(string parameter) {
+//
+// if (isPartOfPrimaryKey(parameter)) {
+// return dataObject->get(parameter);
+// }
+//
+// Relationship* r = *(keyMappings.find(parameter));
+//
+// if (r == NULL) {
+// return dataObject->get(parameter);
+// }
+//
+// Property* parentRef = getParentReference(r->getPrimaryKeyTable());
+// DataObject* parent = dataObject->getDataObject(parentRef);
+//
+// if (parent == NULL) {
+// return NULL;
+// }
+//
+// string parentKey = getParentKey(r, parameter);
+// return parent->get(parentKey);
+//
+//}
- if (isPartOfPrimaryKey(parameter)) {
- return dataObject->get(parameter);
- }
-
- Relationship* r = *(keyMappings.find(parameter));
-
- if (r == NULL) {
- return dataObject->get(parameter);
- }
-
- Property* parentRef = getParentReference(r->getPrimaryKeyTable());
- DataObject* parent = dataObject->getDataObject(parentRef);
-
- if (parent == NULL) {
- return NULL;
- }
-
- string parentKey = getParentKey(r, parameter);
- return parent->get(parentKey);
-
-}
-
-Property* DatabaseObject::getParentReference(string parentName) {
+const Property& DatabaseObject::getParentReference(string parentName) {
if (parentReference == NULL) {
- list<Property*>* properties = dataObject.getType().getProperties();
- list<Property*>::iterator i;
- for (i = properties->begin() ; i != properties->end() ; i++) {
-
- if ((!*i->getType()->isDataType()) && (ref->getType()->getName() == parentName)) {
- parentReference = *i;
+ PropertyList properties = dataObject->getType().getProperties();
+ int i = 0;
+ for (i = 0 ; i < properties.size() ; i++) {
+ Property& p = properties[i];
+
+ if ((!p.getType().isDataType()) && (p.getType().getName() == parentName)) {
+ parentReference = &p;
}
}
}
- return parentReference;
+ return (const Property&) *parentReference;
}
@@ -115,11 +116,11 @@
}
string DatabaseObject::getTypeName(void) {
- return dataObject->getType()->getName();
+ return dataObject->getType().getName();
}
void DatabaseObject::setPropagatedID(string propagatedID, int id) {
- dataObject->setInt(propagatedID, id);
+ dataObject->setInteger(propagatedID, id);
}
string DatabaseObject::getParentKey(Relationship* r, string parameter) {
@@ -128,8 +129,8 @@
for (i = keyPairs->begin() ; i != keyPairs->end() ; i++) {
- if (*i->getForeignKeyColumn() == parameter) {
- return pair->getPrimaryKeyColumn();
+ if ((*i)->getForeignKeyColumn() == parameter) {
+ return (*i)->getPrimaryKeyColumn();
}
}
@@ -138,22 +139,324 @@
}
-int DatabaseObject::isPartOfPrimaryKey(string parameter) {
+bool DatabaseObject::isPartOfPrimaryKey(string parameter) {
if (mappingWrapper->getConfig() == NULL) {
- return 0;
+ return false;
}
Table* t = mappingWrapper->getTable(getTableName());
if (t == NULL) {
- return 0;
+ return false;
}
Column* c = mappingWrapper->getColumnByPropertyName(t, parameter);
if (c == NULL) {
- return 0;
+ return false;
}
return c->isPrimaryKey();
-}
\ No newline at end of file
+}
+
+bool DatabaseObject::getBoolean(string parameter) {
+ if (isPartOfPrimaryKey(parameter)) {
+ return dataObject->getBoolean(parameter);
+ }
+
+ map<string, Relationship*>::iterator i = keyMappings.find(parameter);
+
+ if (i == keyMappings.end()) {
+ return dataObject->getBoolean(parameter);
+ }
+
+ Relationship* r = i->second;
+ const Property& parentRef = getParentReference(r->getPrimaryKeyTable());
+ DataObjectPtr parent = dataObject->getDataObject(parentRef);
+
+ if (parent == NULL) {
+ return NULL;
+ }
+
+ string parentKey = getParentKey(r, parameter);
+ return parent->getBoolean(parentKey);
+
+}
+
+long DatabaseObject::getInteger(string parameter) {
+ if (isPartOfPrimaryKey(parameter)) {
+ return dataObject->getInteger(parameter);
+ }
+
+ map<string, Relationship*>::iterator i = keyMappings.find(parameter);
+
+ if (i == keyMappings.end()) {
+ return dataObject->getInteger(parameter);
+ }
+
+ Relationship* r = i->second;
+ const Property& parentRef = getParentReference(r->getPrimaryKeyTable());
+ DataObjectPtr parent = dataObject->getDataObject(parentRef);
+
+ if (parent == NULL) {
+ return NULL;
+ }
+
+ string parentKey = getParentKey(r, parameter);
+ return parent->getInteger(parentKey);
+
+}
+
+char DatabaseObject::getByte(string parameter) {
+ if (isPartOfPrimaryKey(parameter)) {
+ return dataObject->getByte(parameter);
+ }
+
+ map<string, Relationship*>::iterator i = keyMappings.find(parameter);
+
+ if (i == keyMappings.end()) {
+ return dataObject->getByte(parameter);
+ }
+
+ Relationship* r = i->second;
+ const Property& parentRef = getParentReference(r->getPrimaryKeyTable());
+ DataObjectPtr parent = dataObject->getDataObject(parentRef);
+
+ if (parent == NULL) {
+ return NULL;
+ }
+
+ string parentKey = getParentKey(r, parameter);
+ return parent->getByte(parentKey);
+
+}
+
+wchar_t DatabaseObject::getCharacter(string parameter) {
+ if (isPartOfPrimaryKey(parameter)) {
+ return dataObject->getCharacter(parameter);
+ }
+
+ map<string, Relationship*>::iterator i = keyMappings.find(parameter);
+
+ if (i == keyMappings.end()) {
+ return dataObject->getCharacter(parameter);
+ }
+
+ Relationship* r = i->second;
+ const Property& parentRef = getParentReference(r->getPrimaryKeyTable());
+ DataObjectPtr parent = dataObject->getDataObject(parentRef);
+
+ if (parent == NULL) {
+ return NULL;
+ }
+
+ string parentKey = getParentKey(r, parameter);
+ return parent->getCharacter(parentKey);
+
+}
+
+char* DatabaseObject::getBytes(string parameter, int* bytesLength) {
+ if (isPartOfPrimaryKey(parameter)) {
+ unsigned int length = dataObject->getLength(parameter);
+ char* buff = new char[length];
+ *bytesLength = dataObject->getBytes(parameter, buff, length);
+
+ return buff;
+
+ }
+
+ map<string, Relationship*>::iterator i = keyMappings.find(parameter);
+
+ if (i == keyMappings.end()) {
+ unsigned int length = dataObject->getLength(parameter);
+ char* buff = new char[length];
+ *bytesLength = dataObject->getBytes(parameter, buff, length);
+
+ return buff;
+
+ }
+
+ Relationship* r = i->second;
+ const Property& parentRef = getParentReference(r->getPrimaryKeyTable());
+ DataObjectPtr parent = dataObject->getDataObject(parentRef);
+
+ if (parent == NULL) {
+ return NULL;
+ }
+
+ string parentKey = getParentKey(r, parameter);
+
+
+ unsigned int length = parent->getLength(parentKey);
+ char* buff = new char[length];
+ *bytesLength = parent->getBytes(parentKey, buff, length);
+
+ return buff;
+
+}
+
+wstring DatabaseObject::getString(string parameter) {
+ if (isPartOfPrimaryKey(parameter)) {
+ unsigned int length = dataObject->getLength(parameter);
+ wchar_t* wstr = new wchar_t[length + 1];
+ unsigned int copied = dataObject->getString(parameter, wstr, length);
+ wstr[copied - 1] = NULL;
+ wstring str = wstr;
+ delete [] wstr;
+
+ return str;
+
+ }
+
+ map<string, Relationship*>::iterator i = keyMappings.find(parameter);
+
+ if (i == keyMappings.end()) {
+ unsigned int length = dataObject->getLength(parameter);
+ wchar_t* wstr = new wchar_t[length];
+ dataObject->getString(parameter, wstr, length);
+ wstring str = (wstring) wstr;
+ delete [] wstr;
+
+ return str;
+
+ }
+
+ Relationship* r = i->second;
+ const Property& parentRef = getParentReference(r->getPrimaryKeyTable());
+ DataObjectPtr parent = dataObject->getDataObject(parentRef);
+
+ if (parent == NULL) {
+ return NULL;
+ }
+
+ string parentKey = getParentKey(r, parameter);
+
+ unsigned int length = parent->getLength(parentKey);
+ wchar_t* wstr = new wchar_t[length];
+ parent->getString(parentKey, wstr, length);
+ wstring str = (wstring) wstr;
+ delete [] wstr;
+
+ return str;
+
+}
+
+const SDODate DatabaseObject::getDate(string parameter) {
+ if (isPartOfPrimaryKey(parameter)) {
+ return dataObject->getDate(parameter);
+ }
+
+ map<string, Relationship*>::iterator i = keyMappings.find(parameter);
+
+ if (i == keyMappings.end()) {
+ return dataObject->getDate(parameter);
+ }
+
+ Relationship* r = i->second;
+ const Property& parentRef = getParentReference(r->getPrimaryKeyTable());
+ DataObjectPtr parent = dataObject->getDataObject(parentRef);
+
+ if (parent == NULL) {
+ return NULL;
+ }
+
+ string parentKey = getParentKey(r, parameter);
+ return parent->getDate(parentKey);
+
+}
+
+long double DatabaseObject::getDouble(string parameter) {
+ if (isPartOfPrimaryKey(parameter)) {
+ return dataObject->getDouble(parameter);
+ }
+
+ map<string, Relationship*>::iterator i = keyMappings.find(parameter);
+
+ if (i == keyMappings.end()) {
+ return dataObject->getDouble(parameter);
+ }
+
+ Relationship* r = i->second;
+ const Property& parentRef = getParentReference(r->getPrimaryKeyTable());
+ DataObjectPtr parent = dataObject->getDataObject(parentRef);
+
+ if (parent == NULL) {
+ return NULL;
+ }
+
+ string parentKey = getParentKey(r, parameter);
+ return parent->getDouble(parentKey);
+
+}
+
+float DatabaseObject::getFloat(string parameter) {
+ if (isPartOfPrimaryKey(parameter)) {
+ return dataObject->getFloat(parameter);
+ }
+
+ map<string, Relationship*>::iterator i = keyMappings.find(parameter);
+
+ if (i == keyMappings.end()) {
+ return dataObject->getFloat(parameter);
+ }
+
+ Relationship* r = i->second;
+ const Property& parentRef = getParentReference(r->getPrimaryKeyTable());
+ DataObjectPtr parent = dataObject->getDataObject(parentRef);
+
+ if (parent == NULL) {
+ return NULL;
+ }
+
+ string parentKey = getParentKey(r, parameter);
+ return parent->getFloat(parentKey);
+
+}
+
+int64_t DatabaseObject::getLong(string parameter) {
+ if (isPartOfPrimaryKey(parameter)) {
+ return dataObject->getLong(parameter);
+ }
+
+ map<string, Relationship*>::iterator i = keyMappings.find(parameter);
+
+ if (i == keyMappings.end()) {
+ return dataObject->getLong(parameter);
+ }
+
+ Relationship* r = i->second;
+ const Property& parentRef = getParentReference(r->getPrimaryKeyTable());
+ DataObjectPtr parent = dataObject->getDataObject(parentRef);
+
+ if (parent == NULL) {
+ return NULL;
+ }
+
+ string parentKey = getParentKey(r, parameter);
+ return parent->getLong(parentKey);
+
+}
+
+short DatabaseObject::getShort(string parameter) {
+ if (isPartOfPrimaryKey(parameter)) {
+ return dataObject->getShort(parameter);
+ }
+
+ map<string, Relationship*>::iterator i = keyMappings.find(parameter);
+
+ if (i == keyMappings.end()) {
+ return dataObject->getShort(parameter);
+ }
+
+ Relationship* r = i->second;
+ const Property& parentRef = getParentReference(r->getPrimaryKeyTable());
+ DataObjectPtr parent = dataObject->getDataObject(parentRef);
+
+ if (parent == NULL) {
+ return NULL;
+ }
+
+ string parentKey = getParentKey(r, parameter);
+ return parent->getShort(parentKey);
+
+}
Modified: incubator/tuscany/cpp/das/runtime/core/src/DatabaseObject.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/DatabaseObject.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/DatabaseObject.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/DatabaseObject.h Wed Feb 7 00:06:55 2007
@@ -31,7 +31,8 @@
#include "Column.h"
#include "commonj/sdo/Property.h"
-#include "commonj/sdo/DataFactory.h"
+#include "commonj/sdo/PropertyList.h"
+#include "commonj/sdo/DataObject.h"
using namespace commonj::sdo;
using namespace std;
@@ -45,18 +46,28 @@
map<string, Relationship*> keyMappings;
string getParentKey(Relationship* r, string parameter);
- int isPartOfPrimaryKey(string parameter);
+ bool isPartOfPrimaryKey(string parameter);
void initialize(void);
public:
DatabaseObject(Config* model, DataObject* changedObject);
virtual ~DatabaseObject(void);
- DASObject* get(string parameter);
- Property* getParentReference(string parentName);
+ bool getBoolean(string parameter);
+ long getInteger(string parameter);
+ char getByte(string parameter);
+ wchar_t getCharacter(string parameter);
+ char* getBytes(string parameter, int* bytesLength);
+ wstring getString(string parameter);
+ const SDODate getDate(string parameter);
+ long double getDouble(string parameter);
+ float getFloat(string parameter);
+ int64_t getLong(string parameter);
+ short getShort(string parameter);
+ const Property& getParentReference(string parentName);
string getTableName(void);
string getTypeName(void);
void setPropagatedID(string propagatedID, int id);
};
-#endif //DATABASE_OBJECT_H
\ No newline at end of file
+#endif //DATABASE_OBJECT_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/Delete.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/Delete.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/Delete.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/Delete.h Wed Feb 7 00:06:55 2007
@@ -19,6 +19,10 @@
#ifndef DELETE_H
#define DELETE_H
+#include <string>
+
+using namespace std;
+
virtual class Delete {
/**
* Returns the value of the '<em><b>Sql</b></em>' attribute.
@@ -71,4 +75,4 @@
}; // Delete
-#endif //DELETE_H
\ No newline at end of file
+#endif //DELETE_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/GraphBuilderMetadata.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/GraphBuilderMetadata.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/GraphBuilderMetadata.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/GraphBuilderMetadata.h Wed Feb 7 00:06:55 2007
@@ -19,6 +19,16 @@
#ifndef GRAPH_BUILDER_METADATA_H
#define GRAPH_BUILDER_METADATA_H
+#include <string>
+#include <list>
+
+#include "MappingWrapper.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
class GraphBuilderMetadata {
private:
@@ -26,7 +36,7 @@
list<ResultSet*> resultSets;
string typeURI;
Type* rootType;
- TypeHelper* typeHelper;
+ //TypeHelper* typeHelper;
void createDynamicTypes(void);
string getDefaultURI();
@@ -49,4 +59,4 @@
-#endif //GRAPH_BUILDER_METADATA_H
\ No newline at end of file
+#endif //GRAPH_BUILDER_METADATA_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/InsertCommandImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/InsertCommandImpl.cpp?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/InsertCommandImpl.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/InsertCommandImpl.cpp Wed Feb 7 00:06:55 2007
@@ -18,7 +18,7 @@
*/
#include "InsertCommandImpl.h"
-InsertCommandImpl::InsertCommandImpl(string sqlString, string* generatedKeys) {
+InsertCommandImpl::InsertCommandImpl(string sqlString, string* generatedKeys, int keysCount);
super(sqlString);
keys = generatedKeys;
@@ -54,4 +54,4 @@
int InsertCommandImpl::getGeneratedKey(void) {
return statement.getGeneratedKey();
-}
\ No newline at end of file
+}
Modified: incubator/tuscany/cpp/das/runtime/core/src/KeyPair.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/KeyPair.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/KeyPair.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/KeyPair.h Wed Feb 7 00:06:55 2007
@@ -20,6 +20,7 @@
#define KEY_PAIR_H
virtual class KeyPair {
+ public:
/**
* Returns the value of the '<em><b>Primary Key Column</b></em>' attribute.
* <!-- begin-user-doc -->
@@ -71,4 +72,4 @@
}; // KeyPair
-#endif //KEY_PAIR_H
\ No newline at end of file
+#endif //KEY_PAIR_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/MappingWrapper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/MappingWrapper.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/MappingWrapper.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/MappingWrapper.h Wed Feb 7 00:06:55 2007
@@ -27,8 +27,11 @@
#include "Column.h"
#include "Config.h"
#include "Relationship.h"
-#include "Command.h"
+#include "config/Command.h"
+#include "commonj/sdo/Property.h"
+
+using namespace commonj::sdo;
using namespace std;
class MappingWrapper {
@@ -73,7 +76,7 @@
void addDeleteStatement(Table* table, string statement, string parameters);
void addCreateStatement(Table* table, string statement, string parameters);
void addConnectionInfo(string dataSourceName, bool managedtx);
- Command* addCommand(string name, string sql, string kind);
+ config::Command* addCommand(string name, string sql, string kind);
void addImpliedPrimaryKey(string tableName, string columnName);
};
Modified: incubator/tuscany/cpp/das/runtime/core/src/Parameter.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/Parameter.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/Parameter.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/Parameter.h Wed Feb 7 00:06:55 2007
@@ -19,6 +19,10 @@
#ifndef PARAMETER_H
#define PARAMETER_H
+#include <string>
+
+using namespace std;
+
virtual class Parameter {
/**
* Returns the value of the '<em><b>Column Type</b></em>' attribute.
@@ -95,4 +99,4 @@
}; // Parameter
-#endif //PARAMETER_H
\ No newline at end of file
+#endif //PARAMETER_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/ReadCommandImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ReadCommandImpl.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ReadCommandImpl.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ReadCommandImpl.h Wed Feb 7 00:06:55 2007
@@ -27,11 +27,10 @@
#include "MappingWrapper.h"
#include "ResultDescriptor.h"
#include "GraphBuilderMetadata.h"
-#include "DataGraph.h"
-#include "SDOUtil.h"
-#include "ResultSetProcessor.h"
#include "commonj/sdo/DataFactory.h"
+//#include "commonj/sdo/SDOUtils.h"
+#include "commonj/sdo/DataGraph.h"
using namespace commonj::sdo;
using namespace std;
@@ -58,4 +57,4 @@
};
-#endif //READ_COMMAND_IMPL_H
\ No newline at end of file
+#endif //READ_COMMAND_IMPL_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/ResultDescriptor.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ResultDescriptor.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ResultDescriptor.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ResultDescriptor.h Wed Feb 7 00:06:55 2007
@@ -19,7 +19,14 @@
#ifndef RESULT_DESCRIPTOR_H
#define RESULT_DESCRIPTOR_H
+#include <string>
+
+using namespace std;
+
virtual class ResultDescriptor {
+
+ public:
+
/**
* Returns the value of the '<em><b>Column Name</b></em>' attribute.
* <!-- begin-user-doc -->
@@ -95,4 +102,4 @@
}; // ResultDescriptor
-#endif //RESULT_DESCRIPTOR_H
\ No newline at end of file
+#endif //RESULT_DESCRIPTOR_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/ResultMetadata.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ResultMetadata.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ResultMetadata.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ResultMetadata.h Wed Feb 7 00:06:55 2007
@@ -19,20 +19,34 @@
#ifndef RESULT_METADATA_H
#define RESULT_METADATA_H
+#include <map>
+#include <string>
+
+#include "ResultSet.h"
+#include "DASImpl.h"
+#include "ResultSetShape.h"
+#include "MappingWrapper.h"
+#include "Converter.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
class ResultMetadata {
private:
map<string, list<string>*> tableToPropertyMap;
list<string> typeNames;
list<string> propertyNames;
- ResultSet* resultSet
+ ResultSet* resultSet;
ResultSetShape* resultSetShape;
MappingWrapper* configWrapper;
Converter** converters;
int convertersCount;
Converter* loadConverter(string converterName);
- void DASImpl::toLower(string string);
+ void toLower(string string);
public:
ResultMetadata(ResultSet* rs, MappingWrapper* cfgWrapper, ResultSetShape* shape);
@@ -56,4 +70,4 @@
};
-#endif //RESULT_METADATA_H
\ No newline at end of file
+#endif //RESULT_METADATA_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/ResultSetShape.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/ResultSetShape.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/ResultSetShape.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/ResultSetShape.h Wed Feb 7 00:06:55 2007
@@ -20,6 +20,7 @@
#define RESULT_SET_SHAPE_H
#include <vector>
+#include <windows.h>
#include <sql.h>
#include "ResultSetMetaData.h"
@@ -27,6 +28,9 @@
//#include "ResultSetTypeMap.h"
//#include "TypeHelper.h"
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
using namespace std;
class ResultSetShape {
@@ -53,4 +57,4 @@
};
-#endif //RESULT_SET_SHAPE_H
\ No newline at end of file
+#endif //RESULT_SET_SHAPE_H
Modified: incubator/tuscany/cpp/das/runtime/core/src/SPCommandImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/SPCommandImpl.h?view=diff&rev=504457&r1=504456&r2=504457
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/SPCommandImpl.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/SPCommandImpl.h Wed Feb 7 00:06:55 2007
@@ -25,11 +25,11 @@
#include "ReadCommandImpl.h"
#include "MappingWrapper.h"
#include "Parameter.h"
-#include "TypeHelper.h"
-#include "Type.h"
+//#include "TypeHelper.h"
#include "Parameter.h"
#include "commonj/sdo/DataFactory.h"
+#include "commonj/sdo/Type.h"
using namespace commonj::sdo;
using namespace std;
@@ -47,4 +47,4 @@
};
-#endif //S_P_COMMAND_IMPL_H
\ No newline at end of file
+#endif //S_P_COMMAND_IMPL_H
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org