Package com.founder.fix.bpmn2extensions.sqlmappingconfig.impl

Source Code of com.founder.fix.bpmn2extensions.sqlmappingconfig.impl.SqlMappingConfigImpl

/**
*/
package com.founder.fix.bpmn2extensions.sqlmappingconfig.impl;

import com.founder.fix.bpmn2extensions.sqlmappingconfig.DataBaseTableConfig;
import com.founder.fix.bpmn2extensions.sqlmappingconfig.SqlMapping;
import com.founder.fix.bpmn2extensions.sqlmappingconfig.SqlMappingConfig;
import com.founder.fix.bpmn2extensions.sqlmappingconfig.SqlmappingconfigPackage;

import java.util.Collection;

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.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Sql Mapping Config</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
*   <li>{@link com.founder.fix.bpmn2extensions.sqlmappingconfig.impl.SqlMappingConfigImpl#getDataBaseTableConfig <em>Data Base Table Config</em>}</li>
*   <li>{@link com.founder.fix.bpmn2extensions.sqlmappingconfig.impl.SqlMappingConfigImpl#getSqlMapping <em>Sql Mapping</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class SqlMappingConfigImpl extends EObjectImpl implements SqlMappingConfig {
  /**
   * The cached value of the '{@link #getDataBaseTableConfig() <em>Data Base Table Config</em>}' containment reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDataBaseTableConfig()
   * @generated
   * @ordered
   */
  protected DataBaseTableConfig dataBaseTableConfig;

  /**
   * The cached value of the '{@link #getSqlMapping() <em>Sql Mapping</em>}' containment reference list.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getSqlMapping()
   * @generated
   * @ordered
   */
  protected EList<SqlMapping> sqlMapping;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected SqlMappingConfigImpl() {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass() {
    return SqlmappingconfigPackage.Literals.SQL_MAPPING_CONFIG;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public DataBaseTableConfig getDataBaseTableConfig() {
    return dataBaseTableConfig;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetDataBaseTableConfig(DataBaseTableConfig newDataBaseTableConfig, NotificationChain msgs) {
    DataBaseTableConfig oldDataBaseTableConfig = dataBaseTableConfig;
    dataBaseTableConfig = newDataBaseTableConfig;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SqlmappingconfigPackage.SQL_MAPPING_CONFIG__DATA_BASE_TABLE_CONFIG, oldDataBaseTableConfig, newDataBaseTableConfig);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setDataBaseTableConfig(DataBaseTableConfig newDataBaseTableConfig) {
    if (newDataBaseTableConfig != dataBaseTableConfig) {
      NotificationChain msgs = null;
      if (dataBaseTableConfig != null)
        msgs = ((InternalEObject)dataBaseTableConfig).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - SqlmappingconfigPackage.SQL_MAPPING_CONFIG__DATA_BASE_TABLE_CONFIG, null, msgs);
      if (newDataBaseTableConfig != null)
        msgs = ((InternalEObject)newDataBaseTableConfig).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - SqlmappingconfigPackage.SQL_MAPPING_CONFIG__DATA_BASE_TABLE_CONFIG, null, msgs);
      msgs = basicSetDataBaseTableConfig(newDataBaseTableConfig, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, SqlmappingconfigPackage.SQL_MAPPING_CONFIG__DATA_BASE_TABLE_CONFIG, newDataBaseTableConfig, newDataBaseTableConfig));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public EList<SqlMapping> getSqlMapping() {
    if (sqlMapping == null) {
      sqlMapping = new EObjectContainmentEList<SqlMapping>(SqlMapping.class, this, SqlmappingconfigPackage.SQL_MAPPING_CONFIG__SQL_MAPPING);
    }
    return sqlMapping;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
    switch (featureID) {
      case SqlmappingconfigPackage.SQL_MAPPING_CONFIG__DATA_BASE_TABLE_CONFIG:
        return basicSetDataBaseTableConfig(null, msgs);
      case SqlmappingconfigPackage.SQL_MAPPING_CONFIG__SQL_MAPPING:
        return ((InternalEList<?>)getSqlMapping()).basicRemove(otherEnd, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType) {
    switch (featureID) {
      case SqlmappingconfigPackage.SQL_MAPPING_CONFIG__DATA_BASE_TABLE_CONFIG:
        return getDataBaseTableConfig();
      case SqlmappingconfigPackage.SQL_MAPPING_CONFIG__SQL_MAPPING:
        return getSqlMapping();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @SuppressWarnings("unchecked")
  @Override
  public void eSet(int featureID, Object newValue) {
    switch (featureID) {
      case SqlmappingconfigPackage.SQL_MAPPING_CONFIG__DATA_BASE_TABLE_CONFIG:
        setDataBaseTableConfig((DataBaseTableConfig)newValue);
        return;
      case SqlmappingconfigPackage.SQL_MAPPING_CONFIG__SQL_MAPPING:
        getSqlMapping().clear();
        getSqlMapping().addAll((Collection<? extends SqlMapping>)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID) {
    switch (featureID) {
      case SqlmappingconfigPackage.SQL_MAPPING_CONFIG__DATA_BASE_TABLE_CONFIG:
        setDataBaseTableConfig((DataBaseTableConfig)null);
        return;
      case SqlmappingconfigPackage.SQL_MAPPING_CONFIG__SQL_MAPPING:
        getSqlMapping().clear();
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID) {
    switch (featureID) {
      case SqlmappingconfigPackage.SQL_MAPPING_CONFIG__DATA_BASE_TABLE_CONFIG:
        return dataBaseTableConfig != null;
      case SqlmappingconfigPackage.SQL_MAPPING_CONFIG__SQL_MAPPING:
        return sqlMapping != null && !sqlMapping.isEmpty();
    }
    return super.eIsSet(featureID);
  }

} //SqlMappingConfigImpl
TOP

Related Classes of com.founder.fix.bpmn2extensions.sqlmappingconfig.impl.SqlMappingConfigImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.