/**
* <copyright>
* </copyright>
*
* $Id$
*/
package orgomg.cwm.resource.relational.impl;
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.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import orgomg.cwm.foundation.datatypes.QueryExpression;
import orgomg.cwm.resource.relational.QueryColumnSet;
import orgomg.cwm.resource.relational.RelationalPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Query Column Set</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link orgomg.cwm.resource.relational.impl.QueryColumnSetImpl#getQuery <em>Query</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class QueryColumnSetImpl extends ColumnSetImpl implements QueryColumnSet {
/**
* The cached value of the '{@link #getQuery() <em>Query</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getQuery()
* @generated
* @ordered
*/
protected QueryExpression query;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected QueryColumnSetImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return RelationalPackage.Literals.QUERY_COLUMN_SET;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public QueryExpression getQuery() {
return query;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetQuery(QueryExpression newQuery, NotificationChain msgs) {
QueryExpression oldQuery = query;
query = newQuery;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RelationalPackage.QUERY_COLUMN_SET__QUERY, oldQuery, newQuery);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setQuery(QueryExpression newQuery) {
if (newQuery != query) {
NotificationChain msgs = null;
if (query != null)
msgs = ((InternalEObject)query).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RelationalPackage.QUERY_COLUMN_SET__QUERY, null, msgs);
if (newQuery != null)
msgs = ((InternalEObject)newQuery).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - RelationalPackage.QUERY_COLUMN_SET__QUERY, null, msgs);
msgs = basicSetQuery(newQuery, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, RelationalPackage.QUERY_COLUMN_SET__QUERY, newQuery, newQuery));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RelationalPackage.QUERY_COLUMN_SET__QUERY:
return basicSetQuery(null, 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 RelationalPackage.QUERY_COLUMN_SET__QUERY:
return getQuery();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RelationalPackage.QUERY_COLUMN_SET__QUERY:
setQuery((QueryExpression)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RelationalPackage.QUERY_COLUMN_SET__QUERY:
setQuery((QueryExpression)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RelationalPackage.QUERY_COLUMN_SET__QUERY:
return query != null;
}
return super.eIsSet(featureID);
}
} //QueryColumnSetImpl