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/08 05:59:56 UTC
svn commit: r504781 [2/2] - /incubator/tuscany/cpp/das/runtime/core/src/
Added: incubator/tuscany/cpp/das/runtime/core/src/TableData.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/TableData.h?view=auto&rev=504781
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/TableData.h (added)
+++ incubator/tuscany/cpp/das/runtime/core/src/TableData.h Wed Feb 7 20:59:55 2007
@@ -0,0 +1,98 @@
+/*
+ * 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 <string>
+#include <map>
+#include <list>
+
+#include "DASObject.h"
+
+using namespace std;
+
+class TableData {
+
+ private:
+ map<string, DASObject*> columnData;
+ list<DASObject*> primaryKey;
+ string name;
+ bool boolHasValidPrimaryKey;
+
+ public:
+ TableData(string tableName);
+ ~TableData(void);
+ void addData(string columnName, bool isPrimaryKeyColumn, DASObject* data);
+ DASObject* getColumnData(string columnName);
+ string getTableName(void);
+ list<DASObject*>* getPrimaryKeyValues(void);
+ bool hasValidPrimaryKey(void);
+
+};
+
+#endif //TABLE_DATA_H
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#ifndef TABLE_DATA_H
+#define TABLE_DATA_H
+
+#include <string>
+#include <map>
+#include <list>
+
+#include "DASObject.h"
+
+using namespace std;
+
+class TableData {
+
+ private:
+ map<string, DASObject*> columnData;
+ list<DASObject*> primaryKey;
+ string name;
+ bool boolHasValidPrimaryKey;
+
+ public:
+ TableData(string tableName);
+ ~TableData(void);
+ void addData(string columnName, bool isPrimaryKeyColumn, DASObject* data);
+ DASObject* getColumnData(string columnName);
+ string getTableName(void);
+ list<DASObject*>* getPrimaryKeyValues(void);
+ bool hasValidPrimaryKey(void);
+
+};
+
+#endif //TABLE_DATA_H
Added: incubator/tuscany/cpp/das/runtime/core/src/TableImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/TableImpl.cpp?view=auto&rev=504781
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/TableImpl.cpp (added)
+++ incubator/tuscany/cpp/das/runtime/core/src/TableImpl.cpp Wed Feb 7 20:59:55 2007
@@ -0,0 +1,514 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include "TableImpl.h"
+
+TableImpl::TableImpl(void) {
+ list<Column*>* column = NULL;
+ Create* create = NULL;
+ Update* update = NULL;
+ Delete* delet = NULL;
+ string tableName = TABLE_NAME_DEFAULT_;
+ string typeName = TYPE_NAME_DEFAULT_;
+
+}
+
+TableImpl::~TableImpl(void) {
+}
+
+Type* TableImpl::getType(void) {
+ return ((ConfigFactoryImpl*) ConfigFactory::INSTANCE).getTable();
+}
+
+list<Column*>* TableImpl::getColumn(void) {
+
+ if (column == NULL) {
+ //column = createPropertyList(ListKind.CONTAINMENT, Column.class, COLUMN);
+ }
+
+ return column;
+
+}
+
+Create* TableImpl::getCreate(void) {
+ return create;
+}
+
+//ChangeContext* TableImpl::basicSetCreate(Create* newCreate, ChangeContext* changeContext) {
+// Create* oldCreate = create;
+// create = newCreate;
+//
+// return changeContext;
+//
+//}
+
+void TableImpl::setCreate(Create* newCreate) {
+ if (newCreate != create) {
+ ChangeContext* changeContext = NULL;
+
+ if (create != NULL) {
+ changeContext = inverseRemove(create, this, OPPOSITE_FEATURE_BASE - CREATE, NULL, changeContext);
+ }
+
+ if (newCreate != NULL) {
+ changeContext = inverseAdd(newCreate, this, OPPOSITE_FEATURE_BASE - CREATE, NULL, changeContext);
+ }
+
+ changeContext = basicSetCreate(newCreate, changeContext);
+
+ if (changeContext != NULL) {
+ //dispatch(changeContext);
+ }
+
+ }
+
+}
+
+Update* TableImpl::getUpdate(void) {
+ return update;
+}
+
+//ChangeContext* TableImpl::basicSetUpdate(Update* newUpdate, ChangeContext* changeContext) {
+// Update* oldUpdate = update;
+// update = newUpdate;
+//
+// return changeContext;
+//
+//}
+
+void TableImpl::setUpdate(Update* newUpdate) {
+ if (newUpdate != update) {
+ ChangeContext* changeContext = NULL;
+
+ if (update != NULL) {
+ changeContext = inverseRemove(update, this, OPPOSITE_FEATURE_BASE - UPDATE, NULL, changeContext);
+ }
+
+ if (newUpdate != null) {
+ changeContext = inverseAdd(newUpdate, this, OPPOSITE_FEATURE_BASE - UPDATE, NULL, changeContext);
+ }
+
+ changeContext = basicSetUpdate(newUpdate, changeContext);
+
+ if (changeContext != NULL) {
+ //dispatch(changeContext);
+ }
+
+ }
+
+}
+
+Delete* TableImpl::getDelete(void) {
+ return delete;
+}
+
+//ChangeContext* TableImpl::basicSetDelete(Delete* newDelete, ChangeContext* changeContext) {
+// Delete* oldDelete = delet;
+// delet = newDelete;
+//
+// return changeContext;
+//
+//}
+
+void TableImpl::setDelete(Delete* newDelete) {
+ if (newDelete != delet) {
+ ChangeContext* changeContext = NULL;
+
+ if (delete != null) {
+ changeContext = inverseRemove(delet, this, OPPOSITE_FEATURE_BASE - DELETE, NULL, changeContext);
+ }
+
+ if (newDelete != NULL) {
+ changeContext = inverseAdd(newDelete, this, OPPOSITE_FEATURE_BASE - DELETE, NULL, changeContext);
+ }
+
+ changeContext = basicSetDelete(newDelete, changeContext);
+
+ if (changeContext != NULL) {
+ dispatch(changeContext);
+ }
+
+ }
+
+}
+
+string TableImpl::getTableName(void) {
+ return tableName;
+}
+
+void TableImpl::setTableName(string newTableName) {
+ tableName = newTableName;
+}
+
+string TableImpl::getTypeName(void) {
+ return typeName;
+}
+
+void TableImpl::setTypeName(string newTypeName) {
+ typeName = newTypeName;
+}
+
+//ChangeContext* TableImpl::inverseRemove(DASObject* otherEnd, int propertyIndex, ChangeContext* changeContext) {}
+
+DASObject* TableImpl::get(int propertyIndex, bool resolve) {
+ /*switch (propertyIndex)
+ {
+ case COLUMN:
+ return getColumn();
+ case CREATE:
+ return getCreate();
+ case UPDATE:
+ return getUpdate();
+ case DELETE:
+ return getDelete();
+ case TABLE_NAME:
+ return getTableName();
+ case TYPE_NAME:
+ return getTypeName();
+ }
+ return super.get(propertyIndex, resolve);*/
+}
+
+void TableImpl::set(int propertyIndex, DASObject* newValue) {
+ /*switch (propertyIndex)
+ {
+ case COLUMN:
+ getColumn().clear();
+ getColumn().addAll((Collection)newValue);
+ return;
+ case CREATE:
+ setCreate((Create)newValue);
+ return;
+ case UPDATE:
+ setUpdate((Update)newValue);
+ return;
+ case DELETE:
+ setDelete((Delete)newValue);
+ return;
+ case TABLE_NAME:
+ setTableName((String)newValue);
+ return;
+ case TYPE_NAME:
+ setTypeName((String)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);*/
+}
+
+void TableImpl::unset(int propertyIndex) {
+ /*switch (propertyIndex)
+ {
+ case COLUMN:
+ getColumn().clear();
+ return;
+ case CREATE:
+ setCreate((Create)null);
+ return;
+ case UPDATE:
+ setUpdate((Update)null);
+ return;
+ case DELETE:
+ setDelete((Delete)null);
+ return;
+ case TABLE_NAME:
+ setTableName(TABLE_NAME_DEFAULT_);
+ return;
+ case TYPE_NAME:
+ setTypeName(TYPE_NAME_DEFAULT_);
+ return;
+ }
+ super.unset(propertyIndex);*/
+}
+
+bool TableImpl::isSet(int propertyIndex) {
+ /*switch (propertyIndex)
+ {
+ case COLUMN:
+ return column != null && !column.isEmpty();
+ case CREATE:
+ return create != null;
+ case UPDATE:
+ return update != null;
+ case DELETE:
+ return delete != null;
+ case TABLE_NAME:
+ return TABLE_NAME_DEFAULT_ == null ? tableName != null : !TABLE_NAME_DEFAULT_.equals(tableName);
+ case TYPE_NAME:
+ return TYPE_NAME_DEFAULT_ == null ? typeName != null : !TYPE_NAME_DEFAULT_.equals(typeName);
+ }
+ return super.isSet(propertyIndex);*/
+}
+
+//string TableImpl::toString(void) {}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include "TableImpl.h"
+
+TableImpl::TableImpl(void) {
+ list<Column*>* column = NULL;
+ Create* create = NULL;
+ Update* update = NULL;
+ Delete* delet = NULL;
+ string tableName = TABLE_NAME_DEFAULT_;
+ string typeName = TYPE_NAME_DEFAULT_;
+
+}
+
+TableImpl::~TableImpl(void) {
+}
+
+Type* TableImpl::getType(void) {
+ return ((ConfigFactoryImpl*) ConfigFactory::INSTANCE).getTable();
+}
+
+list<Column*>* TableImpl::getColumn(void) {
+
+ if (column == NULL) {
+ //column = createPropertyList(ListKind.CONTAINMENT, Column.class, COLUMN);
+ }
+
+ return column;
+
+}
+
+Create* TableImpl::getCreate(void) {
+ return create;
+}
+
+//ChangeContext* TableImpl::basicSetCreate(Create* newCreate, ChangeContext* changeContext) {
+// Create* oldCreate = create;
+// create = newCreate;
+//
+// return changeContext;
+//
+//}
+
+void TableImpl::setCreate(Create* newCreate) {
+ if (newCreate != create) {
+ ChangeContext* changeContext = NULL;
+
+ if (create != NULL) {
+ changeContext = inverseRemove(create, this, OPPOSITE_FEATURE_BASE - CREATE, NULL, changeContext);
+ }
+
+ if (newCreate != NULL) {
+ changeContext = inverseAdd(newCreate, this, OPPOSITE_FEATURE_BASE - CREATE, NULL, changeContext);
+ }
+
+ changeContext = basicSetCreate(newCreate, changeContext);
+
+ if (changeContext != NULL) {
+ //dispatch(changeContext);
+ }
+
+ }
+
+}
+
+Update* TableImpl::getUpdate(void) {
+ return update;
+}
+
+//ChangeContext* TableImpl::basicSetUpdate(Update* newUpdate, ChangeContext* changeContext) {
+// Update* oldUpdate = update;
+// update = newUpdate;
+//
+// return changeContext;
+//
+//}
+
+void TableImpl::setUpdate(Update* newUpdate) {
+ if (newUpdate != update) {
+ ChangeContext* changeContext = NULL;
+
+ if (update != NULL) {
+ changeContext = inverseRemove(update, this, OPPOSITE_FEATURE_BASE - UPDATE, NULL, changeContext);
+ }
+
+ if (newUpdate != null) {
+ changeContext = inverseAdd(newUpdate, this, OPPOSITE_FEATURE_BASE - UPDATE, NULL, changeContext);
+ }
+
+ changeContext = basicSetUpdate(newUpdate, changeContext);
+
+ if (changeContext != NULL) {
+ //dispatch(changeContext);
+ }
+
+ }
+
+}
+
+Delete* TableImpl::getDelete(void) {
+ return delete;
+}
+
+//ChangeContext* TableImpl::basicSetDelete(Delete* newDelete, ChangeContext* changeContext) {
+// Delete* oldDelete = delet;
+// delet = newDelete;
+//
+// return changeContext;
+//
+//}
+
+void TableImpl::setDelete(Delete* newDelete) {
+ if (newDelete != delet) {
+ ChangeContext* changeContext = NULL;
+
+ if (delete != null) {
+ changeContext = inverseRemove(delet, this, OPPOSITE_FEATURE_BASE - DELETE, NULL, changeContext);
+ }
+
+ if (newDelete != NULL) {
+ changeContext = inverseAdd(newDelete, this, OPPOSITE_FEATURE_BASE - DELETE, NULL, changeContext);
+ }
+
+ changeContext = basicSetDelete(newDelete, changeContext);
+
+ if (changeContext != NULL) {
+ dispatch(changeContext);
+ }
+
+ }
+
+}
+
+string TableImpl::getTableName(void) {
+ return tableName;
+}
+
+void TableImpl::setTableName(string newTableName) {
+ tableName = newTableName;
+}
+
+string TableImpl::getTypeName(void) {
+ return typeName;
+}
+
+void TableImpl::setTypeName(string newTypeName) {
+ typeName = newTypeName;
+}
+
+//ChangeContext* TableImpl::inverseRemove(DASObject* otherEnd, int propertyIndex, ChangeContext* changeContext) {}
+
+DASObject* TableImpl::get(int propertyIndex, bool resolve) {
+ /*switch (propertyIndex)
+ {
+ case COLUMN:
+ return getColumn();
+ case CREATE:
+ return getCreate();
+ case UPDATE:
+ return getUpdate();
+ case DELETE:
+ return getDelete();
+ case TABLE_NAME:
+ return getTableName();
+ case TYPE_NAME:
+ return getTypeName();
+ }
+ return super.get(propertyIndex, resolve);*/
+}
+
+void TableImpl::set(int propertyIndex, DASObject* newValue) {
+ /*switch (propertyIndex)
+ {
+ case COLUMN:
+ getColumn().clear();
+ getColumn().addAll((Collection)newValue);
+ return;
+ case CREATE:
+ setCreate((Create)newValue);
+ return;
+ case UPDATE:
+ setUpdate((Update)newValue);
+ return;
+ case DELETE:
+ setDelete((Delete)newValue);
+ return;
+ case TABLE_NAME:
+ setTableName((String)newValue);
+ return;
+ case TYPE_NAME:
+ setTypeName((String)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);*/
+}
+
+void TableImpl::unset(int propertyIndex) {
+ /*switch (propertyIndex)
+ {
+ case COLUMN:
+ getColumn().clear();
+ return;
+ case CREATE:
+ setCreate((Create)null);
+ return;
+ case UPDATE:
+ setUpdate((Update)null);
+ return;
+ case DELETE:
+ setDelete((Delete)null);
+ return;
+ case TABLE_NAME:
+ setTableName(TABLE_NAME_DEFAULT_);
+ return;
+ case TYPE_NAME:
+ setTypeName(TYPE_NAME_DEFAULT_);
+ return;
+ }
+ super.unset(propertyIndex);*/
+}
+
+bool TableImpl::isSet(int propertyIndex) {
+ /*switch (propertyIndex)
+ {
+ case COLUMN:
+ return column != null && !column.isEmpty();
+ case CREATE:
+ return create != null;
+ case UPDATE:
+ return update != null;
+ case DELETE:
+ return delete != null;
+ case TABLE_NAME:
+ return TABLE_NAME_DEFAULT_ == null ? tableName != null : !TABLE_NAME_DEFAULT_.equals(tableName);
+ case TYPE_NAME:
+ return TYPE_NAME_DEFAULT_ == null ? typeName != null : !TYPE_NAME_DEFAULT_.equals(typeName);
+ }
+ return super.isSet(propertyIndex);*/
+}
+
+//string TableImpl::toString(void) {}
Added: incubator/tuscany/cpp/das/runtime/core/src/TableImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/TableImpl.h?view=auto&rev=504781
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/TableImpl.h (added)
+++ incubator/tuscany/cpp/das/runtime/core/src/TableImpl.h Wed Feb 7 20:59:55 2007
@@ -0,0 +1,160 @@
+/*
+ * 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_IMPL_H
+#define TABLE_IMPL_H
+
+#include <string>
+
+#include "Table.h"
+#include "DASObject.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
+class TableImpl : /*public DataObjectBase,*/ public Table {
+
+ protected:
+ const static string TABLE_NAME_DEFAULT_;
+ const static string TYPE_NAME_DEFAULT_;
+
+ list<Column*>* column;
+ Create* create;
+ Update* update;
+ Delete* delet;
+ string tableName;
+ string typeName;
+
+ public:
+ const static int COLUMN = 0;
+ const static int CREATE = 1;
+ const static int UPDATE = 2;
+ const static int DELET = 3;
+ const static int TABLE_NAME = 4;
+ const static int TYPE_NAME = 5;
+ const static int SDO_PROPERTY_COUNT = 6;
+
+ TableImpl(void);
+ virtual ~TableImpl(void);
+ Type* getType(void);
+ list<Column*>* getColumn(void);
+ Create* getCreate(void);
+ //ChangeContext* basicSetCreate(Create* newCreate, ChangeContext* changeContext);
+ void setCreate(Create* newCreate);
+ Update* getUpdate(void);
+ //ChangeContext* basicSetUpdate(Update* newUpdate, ChangeContext* changeContext);
+ void setUpdate(Update* newUpdate);
+ Delete* getDelete(void);
+ //ChangeContext* basicSetDelete(Delete* newDelete, ChangeContext* changeContext);
+ void setDelete(Delete* newDelete);
+ string getTableName(void);
+ void setTableName(string newTableName);
+ string getTypeName(void);
+ void setTypeName(string newTypeName);
+ //ChangeContext* inverseRemove(DASObject* otherEnd, int propertyIndex, ChangeContext* changeContext);
+ DASObject* get(int propertyIndex, bool resolve);
+ void set(int propertyIndex, DASObject* newValue);
+ void unset(int propertyIndex);
+ bool isSet(int propertyIndex);
+ //string toString(void);
+
+};
+
+#endif //TABLE_IMPL_H
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#ifndef TABLE_IMPL_H
+#define TABLE_IMPL_H
+
+#include <string>
+
+#include "Table.h"
+#include "DASObject.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
+class TableImpl : /*public DataObjectBase,*/ public Table {
+
+ protected:
+ const static string TABLE_NAME_DEFAULT_;
+ const static string TYPE_NAME_DEFAULT_;
+
+ list<Column*>* column;
+ Create* create;
+ Update* update;
+ Delete* delet;
+ string tableName;
+ string typeName;
+
+ public:
+ const static int COLUMN = 0;
+ const static int CREATE = 1;
+ const static int UPDATE = 2;
+ const static int DELET = 3;
+ const static int TABLE_NAME = 4;
+ const static int TYPE_NAME = 5;
+ const static int SDO_PROPERTY_COUNT = 6;
+
+ TableImpl(void);
+ virtual ~TableImpl(void);
+ Type* getType(void);
+ list<Column*>* getColumn(void);
+ Create* getCreate(void);
+ //ChangeContext* basicSetCreate(Create* newCreate, ChangeContext* changeContext);
+ void setCreate(Create* newCreate);
+ Update* getUpdate(void);
+ //ChangeContext* basicSetUpdate(Update* newUpdate, ChangeContext* changeContext);
+ void setUpdate(Update* newUpdate);
+ Delete* getDelete(void);
+ //ChangeContext* basicSetDelete(Delete* newDelete, ChangeContext* changeContext);
+ void setDelete(Delete* newDelete);
+ string getTableName(void);
+ void setTableName(string newTableName);
+ string getTypeName(void);
+ void setTypeName(string newTypeName);
+ //ChangeContext* inverseRemove(DASObject* otherEnd, int propertyIndex, ChangeContext* changeContext);
+ DASObject* get(int propertyIndex, bool resolve);
+ void set(int propertyIndex, DASObject* newValue);
+ void unset(int propertyIndex);
+ bool isSet(int propertyIndex);
+ //string toString(void);
+
+};
+
+#endif //TABLE_IMPL_H
Added: incubator/tuscany/cpp/das/runtime/core/src/UpdateImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/UpdateImpl.cpp?view=auto&rev=504781
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/UpdateImpl.cpp (added)
+++ incubator/tuscany/cpp/das/runtime/core/src/UpdateImpl.cpp Wed Feb 7 20:59:55 2007
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include "TableImpl.h"
+
+UpdateImpl::UpdateImpl(void) {
+ sql = SQL_DEFAULT_;
+ parameters = PARAMETERS_DEFAULT_;
+
+}
+
+UpdateImpl::~UpdateImpl(void) {
+}
+
+Type* UpdateImpl::getType(void) {
+ return ((ConfigFactoryImpl*) ConfigFactory::INSTANCE).getUpdate();
+}
+
+string UpdateImpl::getSql(void) {
+ return sql;
+}
+
+void UpdateImpl::setSql(string newSql) {
+ sql = newSql;
+}
+
+string UpdateImpl::getParameters(void) {
+ return parameters;
+}
+
+void UpdateImpl::setParameters(string newParameters) {
+ parameters = newParameters;
+}
+
+DASObject* UpdateImpl::get(int propertyIndex, bool resolve) {
+ /*switch (propertyIndex)
+ {
+ case SQL:
+ return getSql();
+ case PARAMETERS:
+ return getParameters();
+ }
+ return super.get(propertyIndex, resolve);*/
+}
+
+void UpdateImpl::set(int propertyIndex, DASObject* newValue) {
+ /*switch (propertyIndex)
+ {
+ case SQL:
+ setSql((String)newValue);
+ return;
+ case PARAMETERS:
+ setParameters((String)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);*/
+}
+
+void UpdateImpl::unset(int propertyIndex) {
+ /*switch (propertyIndex)
+ {
+ case SQL:
+ setSql(SQL_DEFAULT_);
+ return;
+ case PARAMETERS:
+ setParameters(PARAMETERS_DEFAULT_);
+ return;
+ }
+ super.unset(propertyIndex);*/
+}
+
+bool UpdateImpl::isSet(int propertyIndex) {
+ /*switch (propertyIndex)
+ {
+ case SQL:
+ return SQL_DEFAULT_ == null ? sql != null : !SQL_DEFAULT_.equals(sql);
+ case PARAMETERS:
+ return PARAMETERS_DEFAULT_ == null ? parameters != null : !PARAMETERS_DEFAULT_.equals(parameters);
+ }
+ return super.isSet(propertyIndex);*/
+}
+
+//string UpdateImpl::toString(void) {}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#include "TableImpl.h"
+
+UpdateImpl::UpdateImpl(void) {
+ sql = SQL_DEFAULT_;
+ parameters = PARAMETERS_DEFAULT_;
+
+}
+
+UpdateImpl::~UpdateImpl(void) {
+}
+
+Type* UpdateImpl::getType(void) {
+ return ((ConfigFactoryImpl*) ConfigFactory::INSTANCE).getUpdate();
+}
+
+string UpdateImpl::getSql(void) {
+ return sql;
+}
+
+void UpdateImpl::setSql(string newSql) {
+ sql = newSql;
+}
+
+string UpdateImpl::getParameters(void) {
+ return parameters;
+}
+
+void UpdateImpl::setParameters(string newParameters) {
+ parameters = newParameters;
+}
+
+DASObject* UpdateImpl::get(int propertyIndex, bool resolve) {
+ /*switch (propertyIndex)
+ {
+ case SQL:
+ return getSql();
+ case PARAMETERS:
+ return getParameters();
+ }
+ return super.get(propertyIndex, resolve);*/
+}
+
+void UpdateImpl::set(int propertyIndex, DASObject* newValue) {
+ /*switch (propertyIndex)
+ {
+ case SQL:
+ setSql((String)newValue);
+ return;
+ case PARAMETERS:
+ setParameters((String)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);*/
+}
+
+void UpdateImpl::unset(int propertyIndex) {
+ /*switch (propertyIndex)
+ {
+ case SQL:
+ setSql(SQL_DEFAULT_);
+ return;
+ case PARAMETERS:
+ setParameters(PARAMETERS_DEFAULT_);
+ return;
+ }
+ super.unset(propertyIndex);*/
+}
+
+bool UpdateImpl::isSet(int propertyIndex) {
+ /*switch (propertyIndex)
+ {
+ case SQL:
+ return SQL_DEFAULT_ == null ? sql != null : !SQL_DEFAULT_.equals(sql);
+ case PARAMETERS:
+ return PARAMETERS_DEFAULT_ == null ? parameters != null : !PARAMETERS_DEFAULT_.equals(parameters);
+ }
+ return super.isSet(propertyIndex);*/
+}
+
+//string UpdateImpl::toString(void) {}
Added: incubator/tuscany/cpp/das/runtime/core/src/UpdateImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/UpdateImpl.h?view=auto&rev=504781
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/UpdateImpl.h (added)
+++ incubator/tuscany/cpp/das/runtime/core/src/UpdateImpl.h Wed Feb 7 20:59:55 2007
@@ -0,0 +1,122 @@
+/*
+ * 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 UPDATE_IMPL_H
+#define UPDATE_IMPL_H
+
+#include <string>
+
+#include "Update.h"
+#include "DASObject.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
+class UpdateImpl : /*public DataObjectBase,*/ public Update {
+
+ protected:
+ const static string SQL_DEFAULT_;
+ const static string PARAMETERS_DEFAULT_;
+
+ string sql;
+ string parameters;
+
+ public:
+ const static int SQL = 0;
+ const static int PARAMETERS = 1;
+ const static int SDO_PROPERTY_COUNT = 2;
+
+ UpdateImpl(void);
+ virtual ~UpdateImpl(void);
+ Type* getType(void);
+ string getSql(void);
+ void setSql(string newSql);
+ string getParameters(void);
+ void setParameters(string newParameters);
+ DASObject* get(int propertyIndex, bool resolve);
+ void set(int propertyIndex, DASObject* newValue);
+ void unset(int propertyIndex);
+ bool isSet(int propertyIndex);
+ //string toString(void);
+
+};
+
+#endif //TABLE_IMPL_H
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#ifndef UPDATE_IMPL_H
+#define UPDATE_IMPL_H
+
+#include <string>
+
+#include "Update.h"
+#include "DASObject.h"
+
+#include "commonj/sdo/Type.h"
+
+using namespace commonj::sdo;
+using namespace std;
+
+class UpdateImpl : /*public DataObjectBase,*/ public Update {
+
+ protected:
+ const static string SQL_DEFAULT_;
+ const static string PARAMETERS_DEFAULT_;
+
+ string sql;
+ string parameters;
+
+ public:
+ const static int SQL = 0;
+ const static int PARAMETERS = 1;
+ const static int SDO_PROPERTY_COUNT = 2;
+
+ UpdateImpl(void);
+ virtual ~UpdateImpl(void);
+ Type* getType(void);
+ string getSql(void);
+ void setSql(string newSql);
+ string getParameters(void);
+ void setParameters(string newParameters);
+ DASObject* get(int propertyIndex, bool resolve);
+ void set(int propertyIndex, DASObject* newValue);
+ void unset(int propertyIndex);
+ bool isSet(int propertyIndex);
+ //string toString(void);
+
+};
+
+#endif //TABLE_IMPL_H
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org