summaryrefslogtreecommitdiffstats
path: root/sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl
diff options
context:
space:
mode:
Diffstat (limited to 'sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl')
-rw-r--r--sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/AccountImpl.java256
-rw-r--r--sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/CustomerFactoryImpl.java296
-rw-r--r--sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/CustomerImpl.java419
3 files changed, 971 insertions, 0 deletions
diff --git a/sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/AccountImpl.java b/sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/AccountImpl.java
new file mode 100644
index 0000000000..a5d03e0b25
--- /dev/null
+++ b/sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/AccountImpl.java
@@ -0,0 +1,256 @@
+/**
+ *
+ * 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.
+ */
+package com.example.customer.impl;
+
+import com.example.customer.Account;
+import com.example.customer.CustomerFactory;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Account</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.customer.impl.AccountImpl#getAccountNum <em>Account Num</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class AccountImpl extends DataObjectBase implements Account
+{
+
+ public final static int ACCOUNT_NUM = 0;
+
+ public final static int SDO_PROPERTY_COUNT = 1;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Account Num</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ACCOUNT_NUM = 0;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 1;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_ACCOUNT_NUM: return ACCOUNT_NUM;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The default value of the '{@link #getAccountNum() <em>Account Num</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAccountNum()
+ * @generated
+ * @ordered
+ */
+ protected static final int ACCOUNT_NUM_DEFAULT_ = 0;
+
+ /**
+ * The cached value of the '{@link #getAccountNum() <em>Account Num</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAccountNum()
+ * @generated
+ * @ordered
+ */
+ protected int accountNum = ACCOUNT_NUM_DEFAULT_;
+
+ /**
+ * This is true if the Account Num attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean accountNum_set_ = false;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public AccountImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getStaticType()
+ {
+ return ((CustomerFactoryImpl)CustomerFactory.INSTANCE).getAccount();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public int getAccountNum()
+ {
+ return accountNum;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setAccountNum(int newAccountNum)
+ {
+ int oldAccountNum = accountNum;
+ accountNum = newAccountNum;
+ boolean oldAccountNum_set_ = accountNum_set_;
+ accountNum_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, INTERNAL_ACCOUNT_NUM, oldAccountNum, accountNum, !oldAccountNum_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetAccountNum()
+ {
+ int oldAccountNum = accountNum;
+ boolean oldAccountNum_set_ = accountNum_set_;
+ accountNum = ACCOUNT_NUM_DEFAULT_;
+ accountNum_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, INTERNAL_ACCOUNT_NUM, oldAccountNum, ACCOUNT_NUM_DEFAULT_, oldAccountNum_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetAccountNum()
+ {
+ return accountNum_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case ACCOUNT_NUM:
+ return new Integer(getAccountNum());
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case ACCOUNT_NUM:
+ setAccountNum(((Integer)newValue).intValue());
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ACCOUNT_NUM:
+ unsetAccountNum();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ACCOUNT_NUM:
+ return isSetAccountNum();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (accountNum: ");
+ if (accountNum_set_) result.append(accountNum); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //AccountImpl
diff --git a/sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/CustomerFactoryImpl.java b/sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/CustomerFactoryImpl.java
new file mode 100644
index 0000000000..271b273348
--- /dev/null
+++ b/sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/CustomerFactoryImpl.java
@@ -0,0 +1,296 @@
+/**
+ *
+ * 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.
+ */
+package com.example.customer.impl;
+
+import commonj.sdo.helper.HelperContext;
+import org.apache.tuscany.sdo.helper.TypeHelperImpl;
+
+import com.example.customer.*;
+
+import commonj.sdo.DataObject;
+import commonj.sdo.Property;
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.FactoryBase;
+
+import org.apache.tuscany.sdo.model.ModelFactory;
+
+import org.apache.tuscany.sdo.model.impl.ModelFactoryImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Factory</b>.
+ * Generator information:
+ * patternVersion=1.2; -prefix Customer
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public class CustomerFactoryImpl extends FactoryBase implements CustomerFactory
+{
+
+ /**
+ * The package namespace URI.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_URI = "http://example.com/customer";
+
+ /**
+ * The package namespace name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String NAMESPACE_PREFIX = "stn_1";
+
+ /**
+ * The version of the generator pattern used to generate this class.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final String PATTERN_VERSION = "1.2";
+
+ public static final int ACCOUNT = 1;
+ public static final int CUSTOMER = 2;
+
+ /**
+ * Creates an instance of the factory.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CustomerFactoryImpl()
+ {
+ super(NAMESPACE_URI, NAMESPACE_PREFIX, "com.example.customer");
+ }
+
+ /**
+ * Registers the Factory instance so that it is available within the supplied scope.
+ * @argument scope a HelperContext instance that will make the types supported by this Factory available.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void register(HelperContext scope)
+ {
+ if(scope == null) {
+ throw new IllegalArgumentException("Scope can not be null");
+ }
+
+ //Register dependent packages with provided scope
+ ModelFactory.INSTANCE.register(scope);
+
+ // Initialize this package
+ TypeHelperImpl th = (TypeHelperImpl)scope.getTypeHelper();
+ th.getExtendedMetaData().putPackage(NAMESPACE_URI, this);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public DataObject create(int typeNumber)
+ {
+ switch (typeNumber)
+ {
+ case ACCOUNT: return (DataObject)createAccount();
+ case CUSTOMER: return (DataObject)createCustomer();
+ default:
+ return super.create(typeNumber);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Account createAccount()
+ {
+ AccountImpl account = new AccountImpl();
+ return account;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Customer createCustomer()
+ {
+ CustomerImpl customer = new CustomerImpl();
+ return customer;
+ }
+
+ // Following creates and initializes SDO metadata for the supported types.
+ protected Type accountType = null;
+
+ public Type getAccount()
+ {
+ return accountType;
+ }
+
+ protected Type customerType = null;
+
+ public Type getCustomer()
+ {
+ return customerType;
+ }
+
+
+ private static CustomerFactoryImpl instance = null;
+ public static CustomerFactoryImpl init()
+ {
+ if (instance != null ) return instance;
+ instance = new CustomerFactoryImpl();
+
+ // Initialize dependent packages
+ ModelFactory ModelFactoryInstance = ModelFactory.INSTANCE;
+
+ // Create package meta-data objects
+ instance.createMetaData();
+
+ // Initialize created meta-data
+ instance.initializeMetaData();
+
+ // Mark meta-data to indicate it can't be changed
+ //theCustomerFactoryImpl.freeze(); //FB do we need to freeze / should we freeze ????
+
+ return instance;
+ }
+
+ private boolean isCreated = false;
+
+ public void createMetaData()
+ {
+ if (isCreated) return;
+ isCreated = true;
+
+ // Create types and their properties
+ accountType = createType(false, ACCOUNT);
+ createProperty(true, accountType,AccountImpl.INTERNAL_ACCOUNT_NUM);
+ customerType = createType(false, CUSTOMER);
+ createProperty(false, customerType,CustomerImpl.INTERNAL_ACCOUNT);
+ createProperty(true, customerType,CustomerImpl.INTERNAL_FIRST_NAME);
+ }
+
+ private boolean isInitialized = false;
+
+ public void initializeMetaData()
+ {
+ if (isInitialized) return;
+ isInitialized = true;
+
+ // Obtain other dependent packages
+ ModelFactoryImpl theModelPackageImpl = (ModelFactoryImpl)ModelFactory.INSTANCE;
+ Property property = null;
+
+ // Add supertypes to types
+
+ // Initialize types and properties
+ initializeType(accountType, Account.class, "Account", false);
+ property = getLocalProperty(accountType, 0);
+ initializeProperty(property, theModelPackageImpl.getInt(), "accountNum", "0", 0, 1, Account.class, false, true, false);
+
+ initializeType(customerType, Customer.class, "Customer", false);
+ property = getLocalProperty(customerType, 0);
+ initializeProperty(property, this.getAccount(), "account", null, 1, 1, Customer.class, false, true, false, true , null);
+
+ property = getLocalProperty(customerType, 1);
+ initializeProperty(property, theModelPackageImpl.getString(), "firstName", null, 0, 1, Customer.class, false, true, false);
+
+ createXSDMetaData(theModelPackageImpl);
+ }
+
+ protected void createXSDMetaData(ModelFactoryImpl theModelPackageImpl)
+ {
+ super.initXSD();
+
+ Property property = null;
+
+
+ addXSDMapping
+ (accountType,
+ new String[]
+ {
+ "name", "Account",
+ "kind", "empty"
+ });
+
+ addXSDMapping
+ (getProperty(accountType, AccountImpl.INTERNAL_ACCOUNT_NUM),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "accountNum",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (customerType,
+ new String[]
+ {
+ "name", "Customer",
+ "kind", "elementOnly"
+ });
+
+ addXSDMapping
+ (getProperty(customerType, CustomerImpl.INTERNAL_ACCOUNT),
+ new String[]
+ {
+ "kind", "element",
+ "name", "account",
+ "namespace", "##targetNamespace"
+ });
+
+ addXSDMapping
+ (getProperty(customerType, CustomerImpl.INTERNAL_FIRST_NAME),
+ new String[]
+ {
+ "kind", "attribute",
+ "name", "firstName",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("account",
+ this.getAccount(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "account",
+ "namespace", "##targetNamespace"
+ });
+
+ property = createGlobalProperty
+ ("customer",
+ this.getCustomer(),
+ new String[]
+ {
+ "kind", "element",
+ "name", "customer",
+ "namespace", "##targetNamespace"
+ });
+
+ }
+
+} //CustomerFactoryImpl
diff --git a/sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/CustomerImpl.java b/sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/CustomerImpl.java
new file mode 100644
index 0000000000..c3838b760d
--- /dev/null
+++ b/sdo-java/branches/sdo-1.0-incubating/tools/src/test/java/com/example/customer/impl/CustomerImpl.java
@@ -0,0 +1,419 @@
+/**
+ *
+ * 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.
+ */
+package com.example.customer.impl;
+
+import com.example.customer.Account;
+import com.example.customer.Customer;
+import com.example.customer.CustomerFactory;
+
+import commonj.sdo.Type;
+
+import org.apache.tuscany.sdo.impl.DataObjectBase;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Customer</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link com.example.customer.impl.CustomerImpl#getAccount <em>Account</em>}</li>
+ * <li>{@link com.example.customer.impl.CustomerImpl#getFirstName <em>First Name</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public class CustomerImpl extends DataObjectBase implements Customer
+{
+
+ public final static int ACCOUNT = 0;
+
+ public final static int FIRST_NAME = 1;
+
+ public final static int SDO_PROPERTY_COUNT = 2;
+
+ public final static int EXTENDED_PROPERTY_COUNT = 0;
+
+
+ /**
+ * The internal feature id for the '<em><b>Account</b></em>' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_ACCOUNT = 0;
+
+ /**
+ * The internal feature id for the '<em><b>First Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_FIRST_NAME = 1;
+
+ /**
+ * The number of properties for this type.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ public final static int INTERNAL_PROPERTY_COUNT = 2;
+
+ protected int internalConvertIndex(int internalIndex)
+ {
+ switch (internalIndex)
+ {
+ case INTERNAL_ACCOUNT: return ACCOUNT;
+ case INTERNAL_FIRST_NAME: return FIRST_NAME;
+ }
+ return super.internalConvertIndex(internalIndex);
+ }
+
+
+ /**
+ * The cached value of the '{@link #getAccount() <em>Account</em>}' containment reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getAccount()
+ * @generated
+ * @ordered
+ */
+
+ protected Account account = null;
+
+ /**
+ * This is true if the Account containment reference has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean account_set_ = false;
+
+ /**
+ * The default value of the '{@link #getFirstName() <em>First Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFirstName()
+ * @generated
+ * @ordered
+ */
+ protected static final String FIRST_NAME_DEFAULT_ = null;
+
+ /**
+ * The cached value of the '{@link #getFirstName() <em>First Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getFirstName()
+ * @generated
+ * @ordered
+ */
+ protected String firstName = FIRST_NAME_DEFAULT_;
+
+ /**
+ * This is true if the First Name attribute has been set.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ protected boolean firstName_set_ = false;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public CustomerImpl()
+ {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Type getStaticType()
+ {
+ return ((CustomerFactoryImpl)CustomerFactory.INSTANCE).getCustomer();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Account getAccount()
+ {
+ return account;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicSetAccount(Account newAccount, ChangeContext changeContext)
+ {
+ Account oldAccount = account;
+ account = newAccount;
+ boolean oldAccount_set_ = account_set_;
+ account_set_ = true;
+ if (isNotifying())
+ {
+ addNotification(this, ChangeKind.SET, INTERNAL_ACCOUNT, oldAccount, newAccount, !oldAccount_set_, changeContext);
+ }
+ return changeContext;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setAccount(Account newAccount)
+ {
+ if (newAccount != account)
+ {
+ ChangeContext changeContext = null;
+ if (account != null)
+ changeContext = inverseRemove(account, this, OPPOSITE_FEATURE_BASE - INTERNAL_ACCOUNT, null, changeContext);
+ if (newAccount != null)
+ changeContext = inverseAdd(newAccount, this, OPPOSITE_FEATURE_BASE - INTERNAL_ACCOUNT, null, changeContext);
+ changeContext = basicSetAccount(newAccount, changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ else
+ {
+ boolean oldAccount_set_ = account_set_;
+ account_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, INTERNAL_ACCOUNT, newAccount, newAccount, !oldAccount_set_);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext basicUnsetAccount(ChangeContext changeContext)
+ {
+ Account oldAccount = account;
+ account = null;
+ boolean oldAccount_set_ = account_set_;
+ account_set_ = false;
+ if (isNotifying())
+ {
+ addNotification(this, ChangeKind.UNSET, INTERNAL_ACCOUNT, oldAccount, null, !oldAccount_set_, changeContext);
+ }
+ return changeContext;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetAccount()
+ {
+ if (account != null)
+ {
+ ChangeContext changeContext = null;
+ changeContext = inverseRemove(account, this, EOPPOSITE_FEATURE_BASE - INTERNAL_ACCOUNT, null, changeContext);
+ changeContext = basicUnsetAccount(changeContext);
+ if (changeContext != null) dispatch(changeContext);
+ }
+ else
+ {
+ boolean oldAccount_set_ = account_set_;
+ account_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, INTERNAL_ACCOUNT, null, null, oldAccount_set_);
+ }
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetAccount()
+ {
+ return account_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String getFirstName()
+ {
+ return firstName;
+ }
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setFirstName(String newFirstName)
+ {
+ String oldFirstName = firstName;
+ firstName = newFirstName;
+ boolean oldFirstName_set_ = firstName_set_;
+ firstName_set_ = true;
+ if (isNotifying())
+ notify(ChangeKind.SET, INTERNAL_FIRST_NAME, oldFirstName, firstName, !oldFirstName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unsetFirstName()
+ {
+ String oldFirstName = firstName;
+ boolean oldFirstName_set_ = firstName_set_;
+ firstName = FIRST_NAME_DEFAULT_;
+ firstName_set_ = false;
+ if (isNotifying())
+ notify(ChangeKind.UNSET, INTERNAL_FIRST_NAME, oldFirstName, FIRST_NAME_DEFAULT_, oldFirstName_set_);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSetFirstName()
+ {
+ return firstName_set_;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public ChangeContext inverseRemove(Object otherEnd, int propertyIndex, ChangeContext changeContext)
+ {
+ switch (propertyIndex)
+ {
+ case ACCOUNT:
+ return basicUnsetAccount(changeContext);
+ }
+ return super.inverseRemove(otherEnd, propertyIndex, changeContext);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Object get(int propertyIndex, boolean resolve)
+ {
+ switch (propertyIndex)
+ {
+ case ACCOUNT:
+ return getAccount();
+ case FIRST_NAME:
+ return getFirstName();
+ }
+ return super.get(propertyIndex, resolve);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void set(int propertyIndex, Object newValue)
+ {
+ switch (propertyIndex)
+ {
+ case ACCOUNT:
+ setAccount((Account)newValue);
+ return;
+ case FIRST_NAME:
+ setFirstName((String)newValue);
+ return;
+ }
+ super.set(propertyIndex, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void unset(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ACCOUNT:
+ unsetAccount();
+ return;
+ case FIRST_NAME:
+ unsetFirstName();
+ return;
+ }
+ super.unset(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public boolean isSet(int propertyIndex)
+ {
+ switch (propertyIndex)
+ {
+ case ACCOUNT:
+ return isSetAccount();
+ case FIRST_NAME:
+ return isSetFirstName();
+ }
+ return super.isSet(propertyIndex);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String toString()
+ {
+ if (isProxy(this)) return super.toString();
+
+ StringBuffer result = new StringBuffer(super.toString());
+ result.append(" (firstName: ");
+ if (firstName_set_) result.append(firstName); else result.append("<unset>");
+ result.append(')');
+ return result.toString();
+ }
+
+} //CustomerImpl