| /******************************************************************************* |
| * Copyright (c) 2009 Oracle. All rights reserved. |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v1.0, which accompanies this distribution |
| * and is available at http://www.eclipse.org/legal/epl-v10.html. |
| * |
| * Contributors: |
| * Oracle - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.jpt.eclipselink.core.v2_0.resource.orm; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EStructuralFeature; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.jpt.core.internal.resource.xml.translators.SimpleTranslator; |
| import org.eclipse.jpt.core.jpa2.resource.orm.Orm2_0Package; |
| import org.eclipse.wst.common.internal.emf.resource.Translator; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * A representation of the model object '<em><b>Xml Entity</b></em>'. |
| * <!-- end-user-doc --> |
| * |
| * |
| * @see org.eclipse.jpt.eclipselink.core.v2_0.resource.orm.EclipseLink2_0OrmPackage#getXmlEntity() |
| * @model kind="class" |
| * @generated |
| */ |
| public class XmlEntity extends org.eclipse.jpt.eclipselink.core.v1_1.resource.orm.XmlEntity |
| { |
| /** |
| * The default value of the '{@link #getCacheable() <em>Cacheable</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCacheable() |
| * @generated |
| * @ordered |
| */ |
| protected static final Boolean CACHEABLE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getCacheable() <em>Cacheable</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCacheable() |
| * @generated |
| * @ordered |
| */ |
| protected Boolean cacheable = CACHEABLE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected XmlEntity() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return EclipseLink2_0OrmPackage.Literals.XML_ENTITY; |
| } |
| |
| /** |
| * Returns the value of the '<em><b>Cacheable</b></em>' attribute. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of the '<em>Cacheable</em>' attribute isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @return the value of the '<em>Cacheable</em>' attribute. |
| * @see #setCacheable(Boolean) |
| * @see org.eclipse.jpt.eclipselink.core.v2_0.resource.orm.EclipseLink2_0OrmPackage#getXmlEntity_Cacheable() |
| * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject" |
| * @generated |
| */ |
| public Boolean getCacheable() |
| { |
| return cacheable; |
| } |
| |
| /** |
| * Sets the value of the '{@link org.eclipse.jpt.eclipselink.core.v2_0.resource.orm.XmlEntity#getCacheable <em>Cacheable</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @param value the new value of the '<em>Cacheable</em>' attribute. |
| * @see #getCacheable() |
| * @generated |
| */ |
| public void setCacheable(Boolean newCacheable) |
| { |
| Boolean oldCacheable = cacheable; |
| cacheable = newCacheable; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, EclipseLink2_0OrmPackage.XML_ENTITY__CACHEABLE, oldCacheable, cacheable)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case EclipseLink2_0OrmPackage.XML_ENTITY__CACHEABLE: |
| return getCacheable(); |
| } |
| 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 EclipseLink2_0OrmPackage.XML_ENTITY__CACHEABLE: |
| setCacheable((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case EclipseLink2_0OrmPackage.XML_ENTITY__CACHEABLE: |
| setCacheable(CACHEABLE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case EclipseLink2_0OrmPackage.XML_ENTITY__CACHEABLE: |
| return CACHEABLE_EDEFAULT == null ? cacheable != null : !CACHEABLE_EDEFAULT.equals(cacheable); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) |
| { |
| if (baseClass == org.eclipse.jpt.core.jpa2.resource.orm.XmlEntity.class) |
| { |
| switch (derivedFeatureID) |
| { |
| case EclipseLink2_0OrmPackage.XML_ENTITY__CACHEABLE: return Orm2_0Package.XML_ENTITY__CACHEABLE; |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) |
| { |
| if (baseClass == org.eclipse.jpt.core.jpa2.resource.orm.XmlEntity.class) |
| { |
| switch (baseFeatureID) |
| { |
| case Orm2_0Package.XML_ENTITY__CACHEABLE: return EclipseLink2_0OrmPackage.XML_ENTITY__CACHEABLE; |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() |
| { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (cacheable: "); |
| result.append(cacheable); |
| result.append(')'); |
| return result.toString(); |
| } |
| // ********** translators ********** |
| |
| public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) { |
| return new SimpleTranslator( |
| elementName, |
| structuralFeature, |
| EclipseLink2_0OrmPackage.eINSTANCE.getXmlEntity(), |
| buildTranslatorChildren()); |
| } |
| |
| private static Translator[] buildTranslatorChildren() { |
| return new Translator[] { |
| buildNameTranslator(), |
| buildClassTranslator(), |
| buildAccessTranslator(), |
| buildCacheableTranslator(), |
| buildMetadataCompleteTranslator(), |
| buildReadOnlyTranslator(), |
| buildExistenceCheckingTranslator(), |
| buildExcludeDefaultMappingsTranslator(), |
| buildDescriptionTranslator(), |
| buildCustomizerTranslator(), |
| buildChangeTrackingTranslator(), |
| buildTableTranslator(), |
| buildSecondaryTableTranslator(), |
| buildPrimaryKeyJoinColumnTranslator(), |
| buildIdClassTranslator(), |
| buildPrimaryKeyTranslator(), |
| buildInheritanceTranslator(), |
| buildDiscriminatorValueTranslator(), |
| buildDiscriminatorColumnTranslator(), |
| buildOptimisticLockingTranslator(), |
| buildCacheTranslator(), |
| buildConverterTranslator(), |
| buildTypeConverterTranslator(), |
| buildObjectTypeConverterTranslator(), |
| buildStructConverterTranslator(), |
| buildCopyPolicyTranslator(), |
| buildInstantiationCoypPolicyTranslator(), |
| buildCloneCopyPolicyTranslator(), |
| buildSequenceGeneratorTranslator(), |
| buildTableGeneratorTranslator(), |
| buildNamedQueryTranslator(), |
| buildNamedNativeQueryTranslator(), |
| buildNamedStoredProcedureQueryTranslator(), |
| buildSqlResultSetMappingTranslator(), |
| buildExcludeDefaultListenersTranslator(), |
| buildExcludeSuperclassListenersTranslator(), |
| buildEntityListenersTranslator(), |
| buildPrePersistTranslator(), |
| buildPostPersistTranslator(), |
| buildPreRemoveTranslator(), |
| buildPostRemoveTranslator(), |
| buildPreUpdateTranslator(), |
| buildPostUpdateTranslator(), |
| buildPostLoadTranslator(), |
| buildPropertyTranslator(), |
| buildAttributeOverrideTranslator(), |
| buildAssociationOverrideTranslator(), |
| Attributes.buildTranslator() |
| }; |
| } |
| |
| protected static Translator buildCacheableTranslator() { |
| return new Translator(EclipseLink2_0.CACHEABLE, Orm2_0Package.eINSTANCE.getXmlEntity_Cacheable(), Translator.DOM_ATTRIBUTE); |
| } |
| |
| } // XmlEntity |