diff options
Diffstat (limited to 'core/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/pannotation/impl/ForeignKeyImpl.java')
-rwxr-xr-x | core/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/pannotation/impl/ForeignKeyImpl.java | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/core/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/pannotation/impl/ForeignKeyImpl.java b/core/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/pannotation/impl/ForeignKeyImpl.java new file mode 100755 index 000000000..6b23eb0fe --- /dev/null +++ b/core/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/pannotation/impl/ForeignKeyImpl.java @@ -0,0 +1,160 @@ +/** + * <copyright> + * </copyright> + * + * $Id: ForeignKeyImpl.java,v 1.2 2007/11/14 16:37:54 mtaal Exp $ + */ +package org.eclipse.emf.teneo.annotations.pannotation.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.teneo.annotations.pannotation.ForeignKey; +import org.eclipse.emf.teneo.annotations.pannotation.PannotationPackage; + +/** + * <!-- begin-user-doc --> An implementation of the model object '<em><b>Foreign Key</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.teneo.annotations.pannotation.impl.ForeignKeyImpl#getName <em>Name</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class ForeignKeyImpl extends PAnnotationImpl implements ForeignKey { + /** + * 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; + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + protected ForeignKeyImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return PannotationPackage.Literals.FOREIGN_KEY; + } + + /** + * <!-- 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, PannotationPackage.FOREIGN_KEY__NAME, oldName, name)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case PannotationPackage.FOREIGN_KEY__NAME: + return getName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case PannotationPackage.FOREIGN_KEY__NAME: + setName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case PannotationPackage.FOREIGN_KEY__NAME: + setName(NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case PannotationPackage.FOREIGN_KEY__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(')'); + return result.toString(); + } + + /** Return the class name of the annotation */ + @Override + public String getAnnotationClassName() { + // note: this annotation should really be in the hbannotation model! + return "org.hibernate.annotations." + this.eClass().getName(); + } + +} // ForeignKeyImpl |