1 /*******************************************************************************
2 * Copyright (c) 2013 hangum.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the GNU Lesser Public License v2.1
5 * which accompanies this distribution, and is available at
6 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
9 * hangum - initial API and implementation
10 ******************************************************************************/
13 package com
.hangum
.tadpole
.rdb
.model
.impl
;
15 import com
.hangum
.tadpole
.rdb
.model
.RdbPackage
;
16 import com
.hangum
.tadpole
.rdb
.model
.Table
;
17 import com
.hangum
.tadpole
.rdb
.model
.View
;
19 import org
.eclipse
.emf
.common
.notify
.Notification
;
21 import org
.eclipse
.emf
.ecore
.EClass
;
22 import org
.eclipse
.emf
.ecore
.InternalEObject
;
24 import org
.eclipse
.emf
.ecore
.impl
.ENotificationImpl
;
27 * <!-- begin-user-doc -->
28 * An implementation of the model object '<em><b>View</b></em>'.
29 * <!-- end-user-doc -->
31 * The following features are implemented:
34 * <li>{@link com.hangum.tadpole.rdb.model.impl.ViewImpl#getTableName <em>Table Name</em>}</li>
39 public class ViewImpl
extends TableImpl
implements View
{
41 * The cached value of the '{@link #getTableName() <em>Table Name</em>}' reference.
42 * <!-- begin-user-doc -->
43 * <!-- end-user-doc -->
44 * @see #getTableName()
48 protected Table tableName
;
51 * <!-- begin-user-doc -->
52 * <!-- end-user-doc -->
55 protected ViewImpl() {
60 * <!-- begin-user-doc -->
61 * <!-- end-user-doc -->
65 protected EClass
eStaticClass() {
66 return RdbPackage
.Literals
.VIEW
;
70 * <!-- begin-user-doc -->
71 * <!-- end-user-doc -->
74 public Table
getTableName() {
75 if (tableName
!= null && tableName
.eIsProxy()) {
76 InternalEObject oldTableName
= (InternalEObject
)tableName
;
77 tableName
= (Table
)eResolveProxy(oldTableName
);
78 if (tableName
!= oldTableName
) {
79 if (eNotificationRequired())
80 eNotify(new ENotificationImpl(this, Notification
.RESOLVE
, RdbPackage
.VIEW__TABLE_NAME
, oldTableName
, tableName
));
87 * <!-- begin-user-doc -->
88 * <!-- end-user-doc -->
91 public Table
basicGetTableName() {
96 * <!-- begin-user-doc -->
97 * <!-- end-user-doc -->
100 public void setTableName(Table newTableName
) {
101 Table oldTableName
= tableName
;
102 tableName
= newTableName
;
103 if (eNotificationRequired())
104 eNotify(new ENotificationImpl(this, Notification
.SET
, RdbPackage
.VIEW__TABLE_NAME
, oldTableName
, tableName
));
108 * <!-- begin-user-doc -->
109 * <!-- end-user-doc -->
113 public Object
eGet(int featureID
, boolean resolve
, boolean coreType
) {
115 case RdbPackage
.VIEW__TABLE_NAME
:
116 if (resolve
) return getTableName();
117 return basicGetTableName();
119 return super.eGet(featureID
, resolve
, coreType
);
123 * <!-- begin-user-doc -->
124 * <!-- end-user-doc -->
128 public void eSet(int featureID
, Object newValue
) {
130 case RdbPackage
.VIEW__TABLE_NAME
:
131 setTableName((Table
)newValue
);
134 super.eSet(featureID
, newValue
);
138 * <!-- begin-user-doc -->
139 * <!-- end-user-doc -->
143 public void eUnset(int featureID
) {
145 case RdbPackage
.VIEW__TABLE_NAME
:
146 setTableName((Table
)null);
149 super.eUnset(featureID
);
153 * <!-- begin-user-doc -->
154 * <!-- end-user-doc -->
158 public boolean eIsSet(int featureID
) {
160 case RdbPackage
.VIEW__TABLE_NAME
:
161 return tableName
!= null;
163 return super.eIsSet(featureID
);