You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by kw...@apache.org on 2006/02/07 21:39:54 UTC
svn commit: r375688 [6/6] - in
/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config:
./ impl/ wrapper/
Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/RelationshipImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/RelationshipImpl.java?rev=375688&r1=375687&r2=375688&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/RelationshipImpl.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/RelationshipImpl.java Tue Feb 7 12:39:51 2006
@@ -1,37 +1,30 @@
/**
-*
-* Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
-*
-* Licensed 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.
-*/
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
package org.apache.tuscany.das.rdb.config.impl;
import java.util.Collection;
+import java.util.List;
-import org.apache.tuscany.das.rdb.config.Config;
-import org.apache.tuscany.das.rdb.config.ConfigPackage;
import org.apache.tuscany.das.rdb.config.KeyPair;
import org.apache.tuscany.das.rdb.config.Relationship;
+
+import org.apache.tuscany.sdo.impl.DataObjectImpl;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
+
import org.eclipse.emf.common.util.EList;
+
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
+
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
@@ -41,436 +34,464 @@
* <p>
* The following features are implemented:
* <ul>
- * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getName <em>Name</em>}</li>
- * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getPrimaryKeyTable <em>Primary Key Table</em>}</li>
+ * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getKeyPair <em>Key Pair</em>}</li>
+ * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getConfig <em>Config</em>}</li>
* <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getForeignKeyTable <em>Foreign Key Table</em>}</li>
* <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#isMany <em>Many</em>}</li>
- * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getConfig <em>Config</em>}</li>
- * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getKeyPair <em>Key Pair</em>}</li>
+ * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getName <em>Name</em>}</li>
+ * <li>{@link org.apache.tuscany.das.rdb.config.impl.RelationshipImpl#getPrimaryKeyTable <em>Primary Key Table</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public class RelationshipImpl extends EObjectImpl implements Relationship {
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPrimaryKeyTable() <em>Primary Key Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKeyTable()
- * @generated
- * @ordered
- */
- protected static final String PRIMARY_KEY_TABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPrimaryKeyTable() <em>Primary Key Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKeyTable()
- * @generated
- * @ordered
- */
- protected String primaryKeyTable = PRIMARY_KEY_TABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getForeignKeyTable() <em>Foreign Key Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getForeignKeyTable()
- * @generated
- * @ordered
- */
- protected static final String FOREIGN_KEY_TABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getForeignKeyTable() <em>Foreign Key Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getForeignKeyTable()
- * @generated
- * @ordered
- */
- protected String foreignKeyTable = FOREIGN_KEY_TABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isMany() <em>Many</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isMany()
- * @generated
- * @ordered
- */
- protected static final boolean MANY_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isMany() <em>Many</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isMany()
- * @generated
- * @ordered
- */
- protected boolean many = MANY_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getKeyPair() <em>Key Pair</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getKeyPair()
- * @generated
- * @ordered
- */
- protected EList keyPair = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected RelationshipImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return ConfigPackage.eINSTANCE.getRelationship();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.RELATIONSHIP__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getPrimaryKeyTable() {
- return primaryKeyTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setPrimaryKeyTable(String newPrimaryKeyTable) {
- String oldPrimaryKeyTable = primaryKeyTable;
- primaryKeyTable = newPrimaryKeyTable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.RELATIONSHIP__PRIMARY_KEY_TABLE, oldPrimaryKeyTable, primaryKeyTable));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getForeignKeyTable() {
- return foreignKeyTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setForeignKeyTable(String newForeignKeyTable) {
- String oldForeignKeyTable = foreignKeyTable;
- foreignKeyTable = newForeignKeyTable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.RELATIONSHIP__FOREIGN_KEY_TABLE, oldForeignKeyTable, foreignKeyTable));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean isMany() {
- return many;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setMany(boolean newMany) {
- boolean oldMany = many;
- many = newMany;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.RELATIONSHIP__MANY, oldMany, many));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Config getConfig() {
- if (eContainerFeatureID != ConfigPackage.RELATIONSHIP__CONFIG) return null;
- return (Config)eContainer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setConfig(Config newConfig) {
- if (newConfig != eContainer || (eContainerFeatureID != ConfigPackage.RELATIONSHIP__CONFIG && newConfig != null)) {
- if (EcoreUtil.isAncestor(this, newConfig))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
- NotificationChain msgs = null;
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newConfig != null)
- msgs = ((InternalEObject)newConfig).eInverseAdd(this, ConfigPackage.CONFIG__RELATIONSHIP, Config.class, msgs);
- msgs = eBasicSetContainer((InternalEObject)newConfig, ConfigPackage.RELATIONSHIP__CONFIG, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.RELATIONSHIP__CONFIG, newConfig, newConfig));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getKeyPair() {
- if (keyPair == null) {
- keyPair = new EObjectContainmentWithInverseEList(KeyPair.class, this, ConfigPackage.RELATIONSHIP__KEY_PAIR, ConfigPackage.KEY_PAIR__RELATIONSHIP);
- }
- return keyPair;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case ConfigPackage.RELATIONSHIP__CONFIG:
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, ConfigPackage.RELATIONSHIP__CONFIG, msgs);
- case ConfigPackage.RELATIONSHIP__KEY_PAIR:
- return ((InternalEList)getKeyPair()).basicAdd(otherEnd, msgs);
- default:
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case ConfigPackage.RELATIONSHIP__CONFIG:
- return eBasicSetContainer(null, ConfigPackage.RELATIONSHIP__CONFIG, msgs);
- case ConfigPackage.RELATIONSHIP__KEY_PAIR:
- return ((InternalEList)getKeyPair()).basicRemove(otherEnd, msgs);
- default:
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID >= 0) {
- switch (eContainerFeatureID) {
- case ConfigPackage.RELATIONSHIP__CONFIG:
- return eContainer.eInverseRemove(this, ConfigPackage.CONFIG__RELATIONSHIP, Config.class, msgs);
- default:
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.RELATIONSHIP__NAME:
- return getName();
- case ConfigPackage.RELATIONSHIP__PRIMARY_KEY_TABLE:
- return getPrimaryKeyTable();
- case ConfigPackage.RELATIONSHIP__FOREIGN_KEY_TABLE:
- return getForeignKeyTable();
- case ConfigPackage.RELATIONSHIP__MANY:
- return isMany() ? Boolean.TRUE : Boolean.FALSE;
- case ConfigPackage.RELATIONSHIP__CONFIG:
- return getConfig();
- case ConfigPackage.RELATIONSHIP__KEY_PAIR:
- return getKeyPair();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.RELATIONSHIP__NAME:
- setName((String)newValue);
- return;
- case ConfigPackage.RELATIONSHIP__PRIMARY_KEY_TABLE:
- setPrimaryKeyTable((String)newValue);
- return;
- case ConfigPackage.RELATIONSHIP__FOREIGN_KEY_TABLE:
- setForeignKeyTable((String)newValue);
- return;
- case ConfigPackage.RELATIONSHIP__MANY:
- setMany(((Boolean)newValue).booleanValue());
- return;
- case ConfigPackage.RELATIONSHIP__CONFIG:
- setConfig((Config)newValue);
- return;
- case ConfigPackage.RELATIONSHIP__KEY_PAIR:
- getKeyPair().clear();
- getKeyPair().addAll((Collection)newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.RELATIONSHIP__NAME:
- setName(NAME_EDEFAULT);
- return;
- case ConfigPackage.RELATIONSHIP__PRIMARY_KEY_TABLE:
- setPrimaryKeyTable(PRIMARY_KEY_TABLE_EDEFAULT);
- return;
- case ConfigPackage.RELATIONSHIP__FOREIGN_KEY_TABLE:
- setForeignKeyTable(FOREIGN_KEY_TABLE_EDEFAULT);
- return;
- case ConfigPackage.RELATIONSHIP__MANY:
- setMany(MANY_EDEFAULT);
- return;
- case ConfigPackage.RELATIONSHIP__CONFIG:
- setConfig((Config)null);
- return;
- case ConfigPackage.RELATIONSHIP__KEY_PAIR:
- getKeyPair().clear();
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.RELATIONSHIP__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case ConfigPackage.RELATIONSHIP__PRIMARY_KEY_TABLE:
- return PRIMARY_KEY_TABLE_EDEFAULT == null ? primaryKeyTable != null : !PRIMARY_KEY_TABLE_EDEFAULT.equals(primaryKeyTable);
- case ConfigPackage.RELATIONSHIP__FOREIGN_KEY_TABLE:
- return FOREIGN_KEY_TABLE_EDEFAULT == null ? foreignKeyTable != null : !FOREIGN_KEY_TABLE_EDEFAULT.equals(foreignKeyTable);
- case ConfigPackage.RELATIONSHIP__MANY:
- return many != MANY_EDEFAULT;
- case ConfigPackage.RELATIONSHIP__CONFIG:
- return getConfig() != null;
- case ConfigPackage.RELATIONSHIP__KEY_PAIR:
- return keyPair != null && !keyPair.isEmpty();
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", primaryKeyTable: ");
- result.append(primaryKeyTable);
- result.append(", foreignKeyTable: ");
- result.append(foreignKeyTable);
- result.append(", many: ");
- result.append(many);
- result.append(')');
- return result.toString();
- }
+public class RelationshipImpl extends DataObjectImpl implements Relationship
+{
+ /**
+ * The cached value of the '{@link #getKeyPair() <em>Key Pair</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getKeyPair()
+ * @generated
+ * @ordered
+ */
+ protected EList keyPair = null;
+
+ /**
+ * The default value of the '{@link #getConfig() <em>Config</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getConfig()
+ * @generated
+ * @ordered
+ */
+ protected static final String CONFIG_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getConfig() <em>Config</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getConfig()
+ * @generated
+ * @ordered
+ */
+ protected String config = CONFIG_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getForeignKeyTable() <em>Foreign Key Table</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getForeignKeyTable()
+ * @generated
+ * @ordered
+ */
+ protected static final String FOREIGN_KEY_TABLE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getForeignKeyTable() <em>Foreign Key Table</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getForeignKeyTable()
+ * @generated
+ * @ordered
+ */
+ protected String foreignKeyTable = FOREIGN_KEY_TABLE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #isMany() <em>Many</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isMany()
+ * @generated
+ * @ordered
+ */
+ protected static final boolean MANY_EDEFAULT = false;
+
+ /**
+ * The cached value of the '{@link #isMany() <em>Many</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #isMany()
+ * @generated
+ * @ordered
+ */
+ protected boolean many = MANY_EDEFAULT;
+
+ /**
+ * This is true if the Many attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean manyESet = false;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getPrimaryKeyTable() <em>Primary Key Table</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrimaryKeyTable()
+ * @generated
+ * @ordered
+ */
+ protected static final String PRIMARY_KEY_TABLE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPrimaryKeyTable() <em>Primary Key Table</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPrimaryKeyTable()
+ * @generated
+ * @ordered
+ */
+ protected String primaryKeyTable = PRIMARY_KEY_TABLE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected RelationshipImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return ConfigPackageImpl.Literals.RELATIONSHIP;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getKeyPair()
+ {
+ if (keyPair == null)
+ {
+ keyPair = new EObjectContainmentEList(KeyPair.class, this, ConfigPackageImpl.RELATIONSHIP__KEY_PAIR);
+ }
+ return keyPair;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getConfig()
+ {
+ return config;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setConfig(String newConfig)
+ {
+ String oldConfig = config;
+ config = newConfig;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__CONFIG, oldConfig, config));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getForeignKeyTable()
+ {
+ return foreignKeyTable;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setForeignKeyTable(String newForeignKeyTable)
+ {
+ String oldForeignKeyTable = foreignKeyTable;
+ foreignKeyTable = newForeignKeyTable;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE, oldForeignKeyTable, foreignKeyTable));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isMany()
+ {
+ return many;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setMany(boolean newMany)
+ {
+ boolean oldMany = many;
+ many = newMany;
+ boolean oldManyESet = manyESet;
+ manyESet = true;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__MANY, oldMany, many, !oldManyESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetMany()
+ {
+ boolean oldMany = many;
+ boolean oldManyESet = manyESet;
+ many = MANY_EDEFAULT;
+ manyESet = false;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.UNSET, ConfigPackageImpl.RELATIONSHIP__MANY, oldMany, MANY_EDEFAULT, oldManyESet));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetMany()
+ {
+ return manyESet;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getPrimaryKeyTable()
+ {
+ return primaryKeyTable;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPrimaryKeyTable(String newPrimaryKeyTable)
+ {
+ String oldPrimaryKeyTable = primaryKeyTable;
+ primaryKeyTable = newPrimaryKeyTable;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE, oldPrimaryKeyTable, primaryKeyTable));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR:
+ return ((InternalEList)getKeyPair()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR:
+ return getKeyPair();
+ case ConfigPackageImpl.RELATIONSHIP__CONFIG:
+ return getConfig();
+ case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE:
+ return getForeignKeyTable();
+ case ConfigPackageImpl.RELATIONSHIP__MANY:
+ return isMany() ? Boolean.TRUE : Boolean.FALSE;
+ case ConfigPackageImpl.RELATIONSHIP__NAME:
+ return getName();
+ case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE:
+ return getPrimaryKeyTable();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR:
+ getKeyPair().clear();
+ getKeyPair().addAll((Collection)newValue);
+ return;
+ case ConfigPackageImpl.RELATIONSHIP__CONFIG:
+ setConfig((String)newValue);
+ return;
+ case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE:
+ setForeignKeyTable((String)newValue);
+ return;
+ case ConfigPackageImpl.RELATIONSHIP__MANY:
+ setMany(((Boolean)newValue).booleanValue());
+ return;
+ case ConfigPackageImpl.RELATIONSHIP__NAME:
+ setName((String)newValue);
+ return;
+ case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE:
+ setPrimaryKeyTable((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR:
+ getKeyPair().clear();
+ return;
+ case ConfigPackageImpl.RELATIONSHIP__CONFIG:
+ setConfig(CONFIG_EDEFAULT);
+ return;
+ case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE:
+ setForeignKeyTable(FOREIGN_KEY_TABLE_EDEFAULT);
+ return;
+ case ConfigPackageImpl.RELATIONSHIP__MANY:
+ unsetMany();
+ return;
+ case ConfigPackageImpl.RELATIONSHIP__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE:
+ setPrimaryKeyTable(PRIMARY_KEY_TABLE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.RELATIONSHIP__KEY_PAIR:
+ return keyPair != null && !keyPair.isEmpty();
+ case ConfigPackageImpl.RELATIONSHIP__CONFIG:
+ return CONFIG_EDEFAULT == null ? config != null : !CONFIG_EDEFAULT.equals(config);
+ case ConfigPackageImpl.RELATIONSHIP__FOREIGN_KEY_TABLE:
+ return FOREIGN_KEY_TABLE_EDEFAULT == null ? foreignKeyTable != null : !FOREIGN_KEY_TABLE_EDEFAULT.equals(foreignKeyTable);
+ case ConfigPackageImpl.RELATIONSHIP__MANY:
+ return isSetMany();
+ case ConfigPackageImpl.RELATIONSHIP__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case ConfigPackageImpl.RELATIONSHIP__PRIMARY_KEY_TABLE:
+ return PRIMARY_KEY_TABLE_EDEFAULT == null ? primaryKeyTable != null : !PRIMARY_KEY_TABLE_EDEFAULT.equals(primaryKeyTable);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (config: ");
+ result.append(config);
+ result.append(", foreignKeyTable: ");
+ result.append(foreignKeyTable);
+ result.append(", many: ");
+ if (manyESet) result.append(many); else result.append("<unset>");
+ result.append(", name: ");
+ result.append(name);
+ result.append(", primaryKeyTable: ");
+ result.append(primaryKeyTable);
+ result.append(')');
+ return result.toString();
+ }
-}
+} //RelationshipImpl
Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ResultDescriptorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ResultDescriptorImpl.java?rev=375688&r1=375687&r2=375688&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ResultDescriptorImpl.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/ResultDescriptorImpl.java Tue Feb 7 12:39:51 2006
@@ -6,21 +6,15 @@
*/
package org.apache.tuscany.das.rdb.config.impl;
-import org.apache.tuscany.das.rdb.config.Command;
-import org.apache.tuscany.das.rdb.config.ConfigPackage;
import org.apache.tuscany.das.rdb.config.ResultDescriptor;
+import org.apache.tuscany.sdo.impl.DataObjectImpl;
+
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-
-import org.eclipse.emf.ecore.util.EcoreUtil;
/**
* <!-- begin-user-doc -->
@@ -30,397 +24,376 @@
* The following features are implemented:
* <ul>
* <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getColumnName <em>Column Name</em>}</li>
- * <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getTableName <em>Table Name</em>}</li>
- * <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getType <em>Type</em>}</li>
- * <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getConverter <em>Converter</em>}</li>
+ * <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getColumnType <em>Column Type</em>}</li>
* <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getCommand <em>Command</em>}</li>
+ * <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getConverter <em>Converter</em>}</li>
+ * <li>{@link org.apache.tuscany.das.rdb.config.impl.ResultDescriptorImpl#getTableName <em>Table Name</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public class ResultDescriptorImpl extends EObjectImpl implements ResultDescriptor {
- /**
- * The default value of the '{@link #getColumnName() <em>Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnName()
- * @generated
- * @ordered
- */
- protected static final String COLUMN_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getColumnName() <em>Column Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnName()
- * @generated
- * @ordered
- */
- protected String columnName = COLUMN_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTableName() <em>Table Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTableName()
- * @generated
- * @ordered
- */
- protected static final String TABLE_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTableName() <em>Table Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTableName()
- * @generated
- * @ordered
- */
- protected String tableName = TABLE_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected static final String TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected String type = TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getConverter() <em>Converter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected static final String CONVERTER_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getConverter() <em>Converter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected String converter = CONVERTER_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ResultDescriptorImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return ConfigPackage.eINSTANCE.getResultDescriptor();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getColumnName() {
- return columnName;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setColumnName(String newColumnName) {
- String oldColumnName = columnName;
- columnName = newColumnName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.RESULT_DESCRIPTOR__COLUMN_NAME, oldColumnName, columnName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getTableName() {
- return tableName;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setTableName(String newTableName) {
- String oldTableName = tableName;
- tableName = newTableName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.RESULT_DESCRIPTOR__TABLE_NAME, oldTableName, tableName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getType() {
- return type;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setType(String newType) {
- String oldType = type;
- type = newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.RESULT_DESCRIPTOR__TYPE, oldType, type));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getConverter() {
- return converter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setConverter(String newConverter) {
- String oldConverter = converter;
- converter = newConverter;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.RESULT_DESCRIPTOR__CONVERTER, oldConverter, converter));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Command getCommand() {
- if (eContainerFeatureID != ConfigPackage.RESULT_DESCRIPTOR__COMMAND) return null;
- return (Command)eContainer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setCommand(Command newCommand) {
- if (newCommand != eContainer || (eContainerFeatureID != ConfigPackage.RESULT_DESCRIPTOR__COMMAND && newCommand != null)) {
- if (EcoreUtil.isAncestor(this, newCommand))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
- NotificationChain msgs = null;
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newCommand != null)
- msgs = ((InternalEObject)newCommand).eInverseAdd(this, ConfigPackage.COMMAND__RESULT_DESCRIPTOR, Command.class, msgs);
- msgs = eBasicSetContainer((InternalEObject)newCommand, ConfigPackage.RESULT_DESCRIPTOR__COMMAND, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.RESULT_DESCRIPTOR__COMMAND, newCommand, newCommand));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case ConfigPackage.RESULT_DESCRIPTOR__COMMAND:
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, ConfigPackage.RESULT_DESCRIPTOR__COMMAND, msgs);
- default:
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case ConfigPackage.RESULT_DESCRIPTOR__COMMAND:
- return eBasicSetContainer(null, ConfigPackage.RESULT_DESCRIPTOR__COMMAND, msgs);
- default:
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID >= 0) {
- switch (eContainerFeatureID) {
- case ConfigPackage.RESULT_DESCRIPTOR__COMMAND:
- return eContainer.eInverseRemove(this, ConfigPackage.COMMAND__RESULT_DESCRIPTOR, Command.class, msgs);
- default:
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.RESULT_DESCRIPTOR__COLUMN_NAME:
- return getColumnName();
- case ConfigPackage.RESULT_DESCRIPTOR__TABLE_NAME:
- return getTableName();
- case ConfigPackage.RESULT_DESCRIPTOR__TYPE:
- return getType();
- case ConfigPackage.RESULT_DESCRIPTOR__CONVERTER:
- return getConverter();
- case ConfigPackage.RESULT_DESCRIPTOR__COMMAND:
- return getCommand();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.RESULT_DESCRIPTOR__COLUMN_NAME:
- setColumnName((String)newValue);
- return;
- case ConfigPackage.RESULT_DESCRIPTOR__TABLE_NAME:
- setTableName((String)newValue);
- return;
- case ConfigPackage.RESULT_DESCRIPTOR__TYPE:
- setType((String)newValue);
- return;
- case ConfigPackage.RESULT_DESCRIPTOR__CONVERTER:
- setConverter((String)newValue);
- return;
- case ConfigPackage.RESULT_DESCRIPTOR__COMMAND:
- setCommand((Command)newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.RESULT_DESCRIPTOR__COLUMN_NAME:
- setColumnName(COLUMN_NAME_EDEFAULT);
- return;
- case ConfigPackage.RESULT_DESCRIPTOR__TABLE_NAME:
- setTableName(TABLE_NAME_EDEFAULT);
- return;
- case ConfigPackage.RESULT_DESCRIPTOR__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case ConfigPackage.RESULT_DESCRIPTOR__CONVERTER:
- setConverter(CONVERTER_EDEFAULT);
- return;
- case ConfigPackage.RESULT_DESCRIPTOR__COMMAND:
- setCommand((Command)null);
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.RESULT_DESCRIPTOR__COLUMN_NAME:
- return COLUMN_NAME_EDEFAULT == null ? columnName != null : !COLUMN_NAME_EDEFAULT.equals(columnName);
- case ConfigPackage.RESULT_DESCRIPTOR__TABLE_NAME:
- return TABLE_NAME_EDEFAULT == null ? tableName != null : !TABLE_NAME_EDEFAULT.equals(tableName);
- case ConfigPackage.RESULT_DESCRIPTOR__TYPE:
- return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
- case ConfigPackage.RESULT_DESCRIPTOR__CONVERTER:
- return CONVERTER_EDEFAULT == null ? converter != null : !CONVERTER_EDEFAULT.equals(converter);
- case ConfigPackage.RESULT_DESCRIPTOR__COMMAND:
- return getCommand() != null;
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (columnName: ");
- result.append(columnName);
- result.append(", tableName: ");
- result.append(tableName);
- result.append(", type: ");
- result.append(type);
- result.append(", converter: ");
- result.append(converter);
- result.append(')');
- return result.toString();
- }
+public class ResultDescriptorImpl extends DataObjectImpl implements ResultDescriptor
+{
+ /**
+ * The default value of the '{@link #getColumnName() <em>Column Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getColumnName()
+ * @generated
+ * @ordered
+ */
+ protected static final String COLUMN_NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getColumnName() <em>Column Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getColumnName()
+ * @generated
+ * @ordered
+ */
+ protected String columnName = COLUMN_NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getColumnType() <em>Column Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getColumnType()
+ * @generated
+ * @ordered
+ */
+ protected static final String COLUMN_TYPE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getColumnType() <em>Column Type</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getColumnType()
+ * @generated
+ * @ordered
+ */
+ protected String columnType = COLUMN_TYPE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getCommand() <em>Command</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCommand()
+ * @generated
+ * @ordered
+ */
+ protected static final String COMMAND_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getCommand() <em>Command</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCommand()
+ * @generated
+ * @ordered
+ */
+ protected String command = COMMAND_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getConverter() <em>Converter</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getConverter()
+ * @generated
+ * @ordered
+ */
+ protected static final String CONVERTER_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getConverter() <em>Converter</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getConverter()
+ * @generated
+ * @ordered
+ */
+ protected String converter = CONVERTER_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getTableName() <em>Table Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTableName()
+ * @generated
+ * @ordered
+ */
+ protected static final String TABLE_NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getTableName() <em>Table Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getTableName()
+ * @generated
+ * @ordered
+ */
+ protected String tableName = TABLE_NAME_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected ResultDescriptorImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return ConfigPackageImpl.Literals.RESULT_DESCRIPTOR;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getColumnName()
+ {
+ return columnName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setColumnName(String newColumnName)
+ {
+ String oldColumnName = columnName;
+ columnName = newColumnName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME, oldColumnName, columnName));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getColumnType()
+ {
+ return columnType;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setColumnType(String newColumnType)
+ {
+ String oldColumnType = columnType;
+ columnType = newColumnType;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE, oldColumnType, columnType));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getCommand()
+ {
+ return command;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCommand(String newCommand)
+ {
+ String oldCommand = command;
+ command = newCommand;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND, oldCommand, command));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getConverter()
+ {
+ return converter;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setConverter(String newConverter)
+ {
+ String oldConverter = converter;
+ converter = newConverter;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER, oldConverter, converter));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getTableName()
+ {
+ return tableName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setTableName(String newTableName)
+ {
+ String oldTableName = tableName;
+ tableName = newTableName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME, oldTableName, tableName));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME:
+ return getColumnName();
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE:
+ return getColumnType();
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND:
+ return getCommand();
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER:
+ return getConverter();
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME:
+ return getTableName();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME:
+ setColumnName((String)newValue);
+ return;
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE:
+ setColumnType((String)newValue);
+ return;
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND:
+ setCommand((String)newValue);
+ return;
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER:
+ setConverter((String)newValue);
+ return;
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME:
+ setTableName((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME:
+ setColumnName(COLUMN_NAME_EDEFAULT);
+ return;
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE:
+ setColumnType(COLUMN_TYPE_EDEFAULT);
+ return;
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND:
+ setCommand(COMMAND_EDEFAULT);
+ return;
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER:
+ setConverter(CONVERTER_EDEFAULT);
+ return;
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME:
+ setTableName(TABLE_NAME_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_NAME:
+ return COLUMN_NAME_EDEFAULT == null ? columnName != null : !COLUMN_NAME_EDEFAULT.equals(columnName);
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COLUMN_TYPE:
+ return COLUMN_TYPE_EDEFAULT == null ? columnType != null : !COLUMN_TYPE_EDEFAULT.equals(columnType);
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__COMMAND:
+ return COMMAND_EDEFAULT == null ? command != null : !COMMAND_EDEFAULT.equals(command);
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__CONVERTER:
+ return CONVERTER_EDEFAULT == null ? converter != null : !CONVERTER_EDEFAULT.equals(converter);
+ case ConfigPackageImpl.RESULT_DESCRIPTOR__TABLE_NAME:
+ return TABLE_NAME_EDEFAULT == null ? tableName != null : !TABLE_NAME_EDEFAULT.equals(tableName);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (columnName: ");
+ result.append(columnName);
+ result.append(", columnType: ");
+ result.append(columnType);
+ result.append(", command: ");
+ result.append(command);
+ result.append(", converter: ");
+ result.append(converter);
+ result.append(", tableName: ");
+ result.append(tableName);
+ result.append(')');
+ return result.toString();
+ }
} //ResultDescriptorImpl
Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/TableImpl.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/TableImpl.java?rev=375688&r1=375687&r2=375688&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/TableImpl.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/impl/TableImpl.java Tue Feb 7 12:39:51 2006
@@ -1,37 +1,30 @@
/**
-*
-* Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
-*
-* Licensed 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.
-*/
+ * <copyright>
+ * </copyright>
+ *
+ * $Id$
+ */
package org.apache.tuscany.das.rdb.config.impl;
import java.util.Collection;
+import java.util.List;
import org.apache.tuscany.das.rdb.config.Column;
-import org.apache.tuscany.das.rdb.config.Config;
-import org.apache.tuscany.das.rdb.config.ConfigPackage;
import org.apache.tuscany.das.rdb.config.Table;
+
+import org.apache.tuscany.sdo.impl.DataObjectImpl;
+
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
+
import org.eclipse.emf.common.util.EList;
+
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
+
import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
-import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
@@ -41,490 +34,484 @@
* <p>
* The following features are implemented:
* <ul>
+ * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getColumn <em>Column</em>}</li>
+ * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getConfig <em>Config</em>}</li>
+ * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getCreate <em>Create</em>}</li>
+ * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getDelete <em>Delete</em>}</li>
* <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getName <em>Name</em>}</li>
* <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getPropertyName <em>Property Name</em>}</li>
- * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getCreate <em>Create</em>}</li>
* <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getUpdate <em>Update</em>}</li>
- * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getDelete <em>Delete</em>}</li>
- * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getConfig <em>Config</em>}</li>
- * <li>{@link org.apache.tuscany.das.rdb.config.impl.TableImpl#getColumn <em>Column</em>}</li>
* </ul>
* </p>
*
* @generated
*/
-public class TableImpl extends EObjectImpl implements Table {
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPropertyName()
- * @generated
- * @ordered
- */
- protected static final String PROPERTY_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPropertyName()
- * @generated
- * @ordered
- */
- protected String propertyName = PROPERTY_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCreate() <em>Create</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreate()
- * @generated
- * @ordered
- */
- protected static final String CREATE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreate() <em>Create</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreate()
- * @generated
- * @ordered
- */
- protected String create = CREATE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getUpdate() <em>Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdate()
- * @generated
- * @ordered
- */
- protected static final String UPDATE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getUpdate() <em>Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdate()
- * @generated
- * @ordered
- */
- protected String update = UPDATE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDelete() <em>Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDelete()
- * @generated
- * @ordered
- */
- protected static final String DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDelete() <em>Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDelete()
- * @generated
- * @ordered
- */
- protected String delete = DELETE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumn()
- * @generated
- * @ordered
- */
- protected EList column = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected TableImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected EClass eStaticClass() {
- return ConfigPackage.eINSTANCE.getTable();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.TABLE__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getPropertyName() {
- return propertyName;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setPropertyName(String newPropertyName) {
- String oldPropertyName = propertyName;
- propertyName = newPropertyName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.TABLE__PROPERTY_NAME, oldPropertyName, propertyName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getCreate() {
- return create;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setCreate(String newCreate) {
- String oldCreate = create;
- create = newCreate;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.TABLE__CREATE, oldCreate, create));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getUpdate() {
- return update;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setUpdate(String newUpdate) {
- String oldUpdate = update;
- update = newUpdate;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.TABLE__UPDATE, oldUpdate, update));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getDelete() {
- return delete;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setDelete(String newDelete) {
- String oldDelete = delete;
- delete = newDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.TABLE__DELETE, oldDelete, delete));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Config getConfig() {
- if (eContainerFeatureID != ConfigPackage.TABLE__CONFIG) return null;
- return (Config)eContainer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setConfig(Config newConfig) {
- if (newConfig != eContainer || (eContainerFeatureID != ConfigPackage.TABLE__CONFIG && newConfig != null)) {
- if (EcoreUtil.isAncestor(this, newConfig))
- throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
- NotificationChain msgs = null;
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- if (newConfig != null)
- msgs = ((InternalEObject)newConfig).eInverseAdd(this, ConfigPackage.CONFIG__TABLE, Config.class, msgs);
- msgs = eBasicSetContainer((InternalEObject)newConfig, ConfigPackage.TABLE__CONFIG, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackage.TABLE__CONFIG, newConfig, newConfig));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EList getColumn() {
- if (column == null) {
- column = new EObjectContainmentWithInverseEList(Column.class, this, ConfigPackage.TABLE__COLUMN, ConfigPackage.COLUMN__TABLE);
- }
- return column;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case ConfigPackage.TABLE__CONFIG:
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, ConfigPackage.TABLE__CONFIG, msgs);
- case ConfigPackage.TABLE__COLUMN:
- return ((InternalEList)getColumn()).basicAdd(otherEnd, msgs);
- default:
- return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
- }
- }
- if (eContainer != null)
- msgs = eBasicRemoveFromContainer(msgs);
- return eBasicSetContainer(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) {
- if (featureID >= 0) {
- switch (eDerivedStructuralFeatureID(featureID, baseClass)) {
- case ConfigPackage.TABLE__CONFIG:
- return eBasicSetContainer(null, ConfigPackage.TABLE__CONFIG, msgs);
- case ConfigPackage.TABLE__COLUMN:
- return ((InternalEList)getColumn()).basicRemove(otherEnd, msgs);
- default:
- return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
- }
- }
- return eBasicSetContainer(null, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs) {
- if (eContainerFeatureID >= 0) {
- switch (eContainerFeatureID) {
- case ConfigPackage.TABLE__CONFIG:
- return eContainer.eInverseRemove(this, ConfigPackage.CONFIG__TABLE, Config.class, msgs);
- default:
- return eDynamicBasicRemoveFromContainer(msgs);
- }
- }
- return eContainer.eInverseRemove(this, EOPPOSITE_FEATURE_BASE - eContainerFeatureID, null, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Object eGet(EStructuralFeature eFeature, boolean resolve) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.TABLE__NAME:
- return getName();
- case ConfigPackage.TABLE__PROPERTY_NAME:
- return getPropertyName();
- case ConfigPackage.TABLE__CREATE:
- return getCreate();
- case ConfigPackage.TABLE__UPDATE:
- return getUpdate();
- case ConfigPackage.TABLE__DELETE:
- return getDelete();
- case ConfigPackage.TABLE__CONFIG:
- return getConfig();
- case ConfigPackage.TABLE__COLUMN:
- return getColumn();
- }
- return eDynamicGet(eFeature, resolve);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eSet(EStructuralFeature eFeature, Object newValue) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.TABLE__NAME:
- setName((String)newValue);
- return;
- case ConfigPackage.TABLE__PROPERTY_NAME:
- setPropertyName((String)newValue);
- return;
- case ConfigPackage.TABLE__CREATE:
- setCreate((String)newValue);
- return;
- case ConfigPackage.TABLE__UPDATE:
- setUpdate((String)newValue);
- return;
- case ConfigPackage.TABLE__DELETE:
- setDelete((String)newValue);
- return;
- case ConfigPackage.TABLE__CONFIG:
- setConfig((Config)newValue);
- return;
- case ConfigPackage.TABLE__COLUMN:
- getColumn().clear();
- getColumn().addAll((Collection)newValue);
- return;
- }
- eDynamicSet(eFeature, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void eUnset(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.TABLE__NAME:
- setName(NAME_EDEFAULT);
- return;
- case ConfigPackage.TABLE__PROPERTY_NAME:
- setPropertyName(PROPERTY_NAME_EDEFAULT);
- return;
- case ConfigPackage.TABLE__CREATE:
- setCreate(CREATE_EDEFAULT);
- return;
- case ConfigPackage.TABLE__UPDATE:
- setUpdate(UPDATE_EDEFAULT);
- return;
- case ConfigPackage.TABLE__DELETE:
- setDelete(DELETE_EDEFAULT);
- return;
- case ConfigPackage.TABLE__CONFIG:
- setConfig((Config)null);
- return;
- case ConfigPackage.TABLE__COLUMN:
- getColumn().clear();
- return;
- }
- eDynamicUnset(eFeature);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public boolean eIsSet(EStructuralFeature eFeature) {
- switch (eDerivedStructuralFeatureID(eFeature)) {
- case ConfigPackage.TABLE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case ConfigPackage.TABLE__PROPERTY_NAME:
- return PROPERTY_NAME_EDEFAULT == null ? propertyName != null : !PROPERTY_NAME_EDEFAULT.equals(propertyName);
- case ConfigPackage.TABLE__CREATE:
- return CREATE_EDEFAULT == null ? create != null : !CREATE_EDEFAULT.equals(create);
- case ConfigPackage.TABLE__UPDATE:
- return UPDATE_EDEFAULT == null ? update != null : !UPDATE_EDEFAULT.equals(update);
- case ConfigPackage.TABLE__DELETE:
- return DELETE_EDEFAULT == null ? delete != null : !DELETE_EDEFAULT.equals(delete);
- case ConfigPackage.TABLE__CONFIG:
- return getConfig() != null;
- case ConfigPackage.TABLE__COLUMN:
- return column != null && !column.isEmpty();
- }
- return eDynamicIsSet(eFeature);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", propertyName: ");
- result.append(propertyName);
- result.append(", create: ");
- result.append(create);
- result.append(", update: ");
- result.append(update);
- result.append(", delete: ");
- result.append(delete);
- result.append(')');
- return result.toString();
- }
+public class TableImpl extends DataObjectImpl implements Table
+{
+ /**
+ * The cached value of the '{@link #getColumn() <em>Column</em>}' containment reference list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getColumn()
+ * @generated
+ * @ordered
+ */
+ protected EList column = null;
+
+ /**
+ * The default value of the '{@link #getConfig() <em>Config</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getConfig()
+ * @generated
+ * @ordered
+ */
+ protected static final String CONFIG_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getConfig() <em>Config</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getConfig()
+ * @generated
+ * @ordered
+ */
+ protected String config = CONFIG_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getCreate() <em>Create</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCreate()
+ * @generated
+ * @ordered
+ */
+ protected static final String CREATE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getCreate() <em>Create</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getCreate()
+ * @generated
+ * @ordered
+ */
+ protected String create = CREATE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getDelete() <em>Delete</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDelete()
+ * @generated
+ * @ordered
+ */
+ protected static final String DELETE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getDelete() <em>Delete</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getDelete()
+ * @generated
+ * @ordered
+ */
+ protected String delete = DELETE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected static final String NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getName()
+ * @generated
+ * @ordered
+ */
+ protected String name = NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPropertyName()
+ * @generated
+ * @ordered
+ */
+ protected static final String PROPERTY_NAME_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getPropertyName() <em>Property Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getPropertyName()
+ * @generated
+ * @ordered
+ */
+ protected String propertyName = PROPERTY_NAME_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getUpdate() <em>Update</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUpdate()
+ * @generated
+ * @ordered
+ */
+ protected static final String UPDATE_EDEFAULT = null;
+
+ /**
+ * The cached value of the '{@link #getUpdate() <em>Update</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getUpdate()
+ * @generated
+ * @ordered
+ */
+ protected String update = UPDATE_EDEFAULT;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected TableImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected EClass eStaticClass()
+ {
+ return ConfigPackageImpl.Literals.TABLE;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public List getColumn()
+ {
+ if (column == null)
+ {
+ column = new EObjectContainmentEList(Column.class, this, ConfigPackageImpl.TABLE__COLUMN);
+ }
+ return column;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getConfig()
+ {
+ return config;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setConfig(String newConfig)
+ {
+ String oldConfig = config;
+ config = newConfig;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__CONFIG, oldConfig, config));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getCreate()
+ {
+ return create;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setCreate(String newCreate)
+ {
+ String oldCreate = create;
+ create = newCreate;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__CREATE, oldCreate, create));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getDelete()
+ {
+ return delete;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setDelete(String newDelete)
+ {
+ String oldDelete = delete;
+ delete = newDelete;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__DELETE, oldDelete, delete));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setName(String newName)
+ {
+ String oldName = name;
+ name = newName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__NAME, oldName, name));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getPropertyName()
+ {
+ return propertyName;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setPropertyName(String newPropertyName)
+ {
+ String oldPropertyName = propertyName;
+ propertyName = newPropertyName;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__PROPERTY_NAME, oldPropertyName, propertyName));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getUpdate()
+ {
+ return update;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setUpdate(String newUpdate)
+ {
+ String oldUpdate = update;
+ update = newUpdate;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ConfigPackageImpl.TABLE__UPDATE, oldUpdate, update));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.TABLE__COLUMN:
+ return ((InternalEList)getColumn()).basicRemove(otherEnd, msgs);
+ }
+ return super.eInverseRemove(otherEnd, featureID, msgs);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object eGet(int featureID, boolean resolve, boolean coreType)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.TABLE__COLUMN:
+ return getColumn();
+ case ConfigPackageImpl.TABLE__CONFIG:
+ return getConfig();
+ case ConfigPackageImpl.TABLE__CREATE:
+ return getCreate();
+ case ConfigPackageImpl.TABLE__DELETE:
+ return getDelete();
+ case ConfigPackageImpl.TABLE__NAME:
+ return getName();
+ case ConfigPackageImpl.TABLE__PROPERTY_NAME:
+ return getPropertyName();
+ case ConfigPackageImpl.TABLE__UPDATE:
+ return getUpdate();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eSet(int featureID, Object newValue)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.TABLE__COLUMN:
+ getColumn().clear();
+ getColumn().addAll((Collection)newValue);
+ return;
+ case ConfigPackageImpl.TABLE__CONFIG:
+ setConfig((String)newValue);
+ return;
+ case ConfigPackageImpl.TABLE__CREATE:
+ setCreate((String)newValue);
+ return;
+ case ConfigPackageImpl.TABLE__DELETE:
+ setDelete((String)newValue);
+ return;
+ case ConfigPackageImpl.TABLE__NAME:
+ setName((String)newValue);
+ return;
+ case ConfigPackageImpl.TABLE__PROPERTY_NAME:
+ setPropertyName((String)newValue);
+ return;
+ case ConfigPackageImpl.TABLE__UPDATE:
+ setUpdate((String)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void eUnset(int featureID)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.TABLE__COLUMN:
+ getColumn().clear();
+ return;
+ case ConfigPackageImpl.TABLE__CONFIG:
+ setConfig(CONFIG_EDEFAULT);
+ return;
+ case ConfigPackageImpl.TABLE__CREATE:
+ setCreate(CREATE_EDEFAULT);
+ return;
+ case ConfigPackageImpl.TABLE__DELETE:
+ setDelete(DELETE_EDEFAULT);
+ return;
+ case ConfigPackageImpl.TABLE__NAME:
+ setName(NAME_EDEFAULT);
+ return;
+ case ConfigPackageImpl.TABLE__PROPERTY_NAME:
+ setPropertyName(PROPERTY_NAME_EDEFAULT);
+ return;
+ case ConfigPackageImpl.TABLE__UPDATE:
+ setUpdate(UPDATE_EDEFAULT);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean eIsSet(int featureID)
+ {
+ switch (featureID)
+ {
+ case ConfigPackageImpl.TABLE__COLUMN:
+ return column != null && !column.isEmpty();
+ case ConfigPackageImpl.TABLE__CONFIG:
+ return CONFIG_EDEFAULT == null ? config != null : !CONFIG_EDEFAULT.equals(config);
+ case ConfigPackageImpl.TABLE__CREATE:
+ return CREATE_EDEFAULT == null ? create != null : !CREATE_EDEFAULT.equals(create);
+ case ConfigPackageImpl.TABLE__DELETE:
+ return DELETE_EDEFAULT == null ? delete != null : !DELETE_EDEFAULT.equals(delete);
+ case ConfigPackageImpl.TABLE__NAME:
+ return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
+ case ConfigPackageImpl.TABLE__PROPERTY_NAME:
+ return PROPERTY_NAME_EDEFAULT == null ? propertyName != null : !PROPERTY_NAME_EDEFAULT.equals(propertyName);
+ case ConfigPackageImpl.TABLE__UPDATE:
+ return UPDATE_EDEFAULT == null ? update != null : !UPDATE_EDEFAULT.equals(update);
+ }
+ return super.eIsSet(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (eIsProxy()) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (config: ");
+ result.append(config);
+ result.append(", create: ");
+ result.append(create);
+ result.append(", delete: ");
+ result.append(delete);
+ result.append(", name: ");
+ result.append(name);
+ result.append(", propertyName: ");
+ result.append(propertyName);
+ result.append(", update: ");
+ result.append(update);
+ result.append(')');
+ return result.toString();
+ }
-}
+} //TableImpl
Modified: incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java
URL: http://svn.apache.org/viewcvs/incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java?rev=375688&r1=375687&r2=375688&view=diff
==============================================================================
--- incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java (original)
+++ incubator/tuscany/java/das/rdb/src/main/java/org/apache/tuscany/das/rdb/config/wrapper/MappingWrapper.java Tue Feb 7 12:39:51 2006
@@ -29,12 +29,13 @@
import org.apache.tuscany.das.rdb.config.KeyPair;
import org.apache.tuscany.das.rdb.config.Relationship;
import org.apache.tuscany.das.rdb.config.Table;
+import org.apache.tuscany.das.rdb.config.impl.ConfigFactoryImpl;
import org.apache.tuscany.das.rdb.util.DebugUtil;
public class MappingWrapper {
- private static final ConfigFactory factory = ConfigFactory.eINSTANCE;
+ private static final ConfigFactory factory = ConfigFactoryImpl.eINSTANCE;
private static final boolean debug = false;
@@ -237,7 +238,7 @@
private Table findOrCreateTable(String tableName) {
Table table = getTable(tableName);
if (table == null) {
- table = ConfigFactory.eINSTANCE.createTable();
+ table = ConfigFactoryImpl.eINSTANCE.createTable();
table.setName(tableName);
config.getTable().add(table);
}
@@ -253,7 +254,7 @@
return c;
}
- Column c = ConfigFactory.eINSTANCE.createColumn();
+ Column c = ConfigFactoryImpl.eINSTANCE.createColumn();
c.setName(name);
t.getColumn().add(c);
return c;