/******************************************************************************* * Copyright (c) 2007, 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.core.resource.orm; import java.util.ArrayList; import java.util.Collection; import java.util.List; 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.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject; import org.eclipse.jpt.core.resource.xml.JpaEObject; import org.eclipse.jpt.utility.internal.CollectionTools; /** * * A representation of the model object 'Entity Mappings'. * * Provisional API: This interface is part of an interim API that is still * under development and expected to change significantly before reaching * stability. It is available at this early stage to solicit feedback from * pioneering adopters on the understanding that any code that uses this API * will almost certainly be broken (repeatedly) as the API evolves. * * *

* The following features are supported: *

*

* * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings() * @model kind="class" * @extends JpaEObject * @generated */ public class XmlEntityMappings extends AbstractJpaEObject implements JpaEObject { /** * The default value of the '{@link #getVersion() Version}' attribute. * * * @see #getVersion() * @generated * @ordered */ protected static final String VERSION_EDEFAULT = "1.0"; /** * The cached value of the '{@link #getVersion() Version}' attribute. * * * @see #getVersion() * @generated * @ordered */ protected String version = VERSION_EDEFAULT; /** * This is true if the Version attribute has been set. * * * @generated * @ordered */ protected boolean versionESet; /** * The default value of the '{@link #getDescription() Description}' attribute. * * * @see #getDescription() * @generated * @ordered */ protected static final String DESCRIPTION_EDEFAULT = null; /** * The cached value of the '{@link #getDescription() Description}' attribute. * * * @see #getDescription() * @generated * @ordered */ protected String description = DESCRIPTION_EDEFAULT; /** * The cached value of the '{@link #getPersistenceUnitMetadata() Persistence Unit Metadata}' containment reference. * * * @see #getPersistenceUnitMetadata() * @generated * @ordered */ protected XmlPersistenceUnitMetadata persistenceUnitMetadata; /** * The default value of the '{@link #getPackage() Package}' attribute. * * * @see #getPackage() * @generated * @ordered */ protected static final String PACKAGE_EDEFAULT = null; /** * The cached value of the '{@link #getPackage() Package}' attribute. * * * @see #getPackage() * @generated * @ordered */ protected String package_ = PACKAGE_EDEFAULT; /** * The default value of the '{@link #getSchema() Schema}' attribute. * * * @see #getSchema() * @generated * @ordered */ protected static final String SCHEMA_EDEFAULT = null; /** * The cached value of the '{@link #getSchema() Schema}' attribute. * * * @see #getSchema() * @generated * @ordered */ protected String schema = SCHEMA_EDEFAULT; /** * The default value of the '{@link #getCatalog() Catalog}' attribute. * * * @see #getCatalog() * @generated * @ordered */ protected static final String CATALOG_EDEFAULT = null; /** * The cached value of the '{@link #getCatalog() Catalog}' attribute. * * * @see #getCatalog() * @generated * @ordered */ protected String catalog = CATALOG_EDEFAULT; /** * changed this to null and removed the generated flag so emf won't generate over it * we don't want a default for enums, just null if the tag does not exist */ protected static final AccessType ACCESS_EDEFAULT = null; /** * The cached value of the '{@link #getAccess() Access}' attribute. * * * @see #getAccess() * @generated * @ordered */ protected AccessType access = ACCESS_EDEFAULT; /** * The cached value of the '{@link #getSequenceGenerators() Sequence Generators}' containment reference list. * * * @see #getSequenceGenerators() * @generated * @ordered */ protected EList sequenceGenerators; /** * The cached value of the '{@link #getTableGenerators() Table Generators}' containment reference list. * * * @see #getTableGenerators() * @generated * @ordered */ protected EList tableGenerators; /** * The cached value of the '{@link #getNamedQueries() Named Queries}' containment reference list. * * * @see #getNamedQueries() * @generated * @ordered */ protected EList namedQueries; /** * The cached value of the '{@link #getNamedNativeQueries() Named Native Queries}' containment reference list. * * * @see #getNamedNativeQueries() * @generated * @ordered */ protected EList namedNativeQueries; /** * The cached value of the '{@link #getSqlResultSetMappings() Sql Result Set Mappings}' containment reference list. * * * @see #getSqlResultSetMappings() * @generated * @ordered */ protected EList sqlResultSetMappings; /** * The cached value of the '{@link #getMappedSuperclasses() Mapped Superclasses}' containment reference list. * * * @see #getMappedSuperclasses() * @generated * @ordered */ protected EList mappedSuperclasses; /** * The cached value of the '{@link #getEntities() Entities}' containment reference list. * * * @see #getEntities() * @generated * @ordered */ protected EList entities; /** * The cached value of the '{@link #getEmbeddables() Embeddables}' containment reference list. * * * @see #getEmbeddables() * @generated * @ordered */ protected EList embeddables; /** * * * @generated */ protected XmlEntityMappings() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return OrmPackage.Literals.XML_ENTITY_MAPPINGS; } /** * Returns the value of the 'Version' attribute. * The default value is "1.0". * *

* If the meaning of the 'Version' attribute isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Version' attribute. * @see #isSetVersion() * @see #unsetVersion() * @see #setVersion(String) * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Version() * @model default="1.0" unsettable="true" dataType="org.eclipse.jpt.core.resource.orm.VersionType" required="true" * @generated */ public String getVersion() { return version; } /** * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion Version}' attribute. * * * @param value the new value of the 'Version' attribute. * @see #isSetVersion() * @see #unsetVersion() * @see #getVersion() * @generated */ public void setVersion(String newVersion) { String oldVersion = version; version = newVersion; boolean oldVersionESet = versionESet; versionESet = true; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__VERSION, oldVersion, version, !oldVersionESet)); } /** * Unsets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion Version}' attribute. * * * @see #isSetVersion() * @see #getVersion() * @see #setVersion(String) * @generated */ public void unsetVersion() { String oldVersion = version; boolean oldVersionESet = versionESet; version = VERSION_EDEFAULT; versionESet = false; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.UNSET, OrmPackage.XML_ENTITY_MAPPINGS__VERSION, oldVersion, VERSION_EDEFAULT, oldVersionESet)); } /** * Returns whether the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getVersion Version}' attribute is set. * * * @return whether the value of the 'Version' attribute is set. * @see #unsetVersion() * @see #getVersion() * @see #setVersion(String) * @generated */ public boolean isSetVersion() { return versionESet; } /** * Returns the value of the 'Description' attribute. * *

* If the meaning of the 'Description' attribute isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Description' attribute. * @see #setDescription(String) * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Description() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ public String getDescription() { return description; } /** * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getDescription Description}' attribute. * * * @param value the new value of the 'Description' attribute. * @see #getDescription() * @generated */ public void setDescription(String newDescription) { String oldDescription = description; description = newDescription; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION, oldDescription, description)); } /** * Returns the value of the 'Persistence Unit Metadata' containment reference. * *

* If the meaning of the 'XmlPersistence Unit Metadata' containment reference isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Persistence Unit Metadata' containment reference. * @see #setPersistenceUnitMetadata(XmlPersistenceUnitMetadata) * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_PersistenceUnitMetadata() * @model containment="true" * @generated */ public XmlPersistenceUnitMetadata getPersistenceUnitMetadata() { return persistenceUnitMetadata; } /** * * * @generated */ public NotificationChain basicSetPersistenceUnitMetadata(XmlPersistenceUnitMetadata newPersistenceUnitMetadata, NotificationChain msgs) { XmlPersistenceUnitMetadata oldPersistenceUnitMetadata = persistenceUnitMetadata; persistenceUnitMetadata = newPersistenceUnitMetadata; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, oldPersistenceUnitMetadata, newPersistenceUnitMetadata); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPersistenceUnitMetadata Persistence Unit Metadata}' containment reference. * * * @param value the new value of the 'Persistence Unit Metadata' containment reference. * @see #getPersistenceUnitMetadata() * @generated */ public void setPersistenceUnitMetadata(XmlPersistenceUnitMetadata newPersistenceUnitMetadata) { if (newPersistenceUnitMetadata != persistenceUnitMetadata) { NotificationChain msgs = null; if (persistenceUnitMetadata != null) msgs = ((InternalEObject)persistenceUnitMetadata).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, null, msgs); if (newPersistenceUnitMetadata != null) msgs = ((InternalEObject)newPersistenceUnitMetadata).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, null, msgs); msgs = basicSetPersistenceUnitMetadata(newPersistenceUnitMetadata, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA, newPersistenceUnitMetadata, newPersistenceUnitMetadata)); } /** * Returns the value of the 'Package' attribute. * *

* If the meaning of the 'Package' attribute isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Package' attribute. * @see #setPackage(String) * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Package() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ public String getPackage() { return package_; } /** * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getPackage Package}' attribute. * * * @param value the new value of the 'Package' attribute. * @see #getPackage() * @generated */ public void setPackage(String newPackage) { String oldPackage = package_; package_ = newPackage; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE, oldPackage, package_)); } /** * Returns the value of the 'Schema' attribute. * *

* If the meaning of the 'Schema' attribute isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Schema' attribute. * @see #setSchema(String) * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Schema() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ public String getSchema() { return schema; } /** * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getSchema Schema}' attribute. * * * @param value the new value of the 'Schema' attribute. * @see #getSchema() * @generated */ public void setSchema(String newSchema) { String oldSchema = schema; schema = newSchema; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA, oldSchema, schema)); } /** * Returns the value of the 'Catalog' attribute. * *

* If the meaning of the 'Catalog' attribute isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Catalog' attribute. * @see #setCatalog(String) * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Catalog() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ public String getCatalog() { return catalog; } /** * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getCatalog Catalog}' attribute. * * * @param value the new value of the 'Catalog' attribute. * @see #getCatalog() * @generated */ public void setCatalog(String newCatalog) { String oldCatalog = catalog; catalog = newCatalog; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__CATALOG, oldCatalog, catalog)); } /** * Returns the value of the 'Access' attribute. * The default value is "PROPERTY". * The literals are from the enumeration {@link org.eclipse.jpt.core.resource.orm.AccessType}. * *

* If the meaning of the 'Access' attribute isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Access' attribute. * @see org.eclipse.jpt.core.resource.orm.AccessType * @see #setAccess(AccessType) * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Access() * @model default="PROPERTY" * @generated */ public AccessType getAccess() { return access; } /** * Sets the value of the '{@link org.eclipse.jpt.core.resource.orm.XmlEntityMappings#getAccess Access}' attribute. * * * @param value the new value of the 'Access' attribute. * @see org.eclipse.jpt.core.resource.orm.AccessType * @see #getAccess() * @generated */ public void setAccess(AccessType newAccess) { AccessType oldAccess = access; access = newAccess == null ? ACCESS_EDEFAULT : newAccess; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_ENTITY_MAPPINGS__ACCESS, oldAccess, access)); } /** * Returns the value of the 'Sequence Generators' containment reference list. * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlSequenceGenerator}. * *

* If the meaning of the 'Sequence Generators' containment reference list isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Sequence Generators' containment reference list. * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_SequenceGenerators() * @model containment="true" * @generated */ public EList getSequenceGenerators() { if (sequenceGenerators == null) { sequenceGenerators = new EObjectContainmentEList(XmlSequenceGenerator.class, this, OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS); } return sequenceGenerators; } /** * Returns the value of the 'Table Generators' containment reference list. * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlTableGenerator}. * *

* If the meaning of the 'Table Generators' containment reference list isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Table Generators' containment reference list. * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_TableGenerators() * @model containment="true" * @generated */ public EList getTableGenerators() { if (tableGenerators == null) { tableGenerators = new EObjectContainmentEList(XmlTableGenerator.class, this, OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS); } return tableGenerators; } /** * Returns the value of the 'Named Queries' containment reference list. * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlNamedQuery}. * *

* If the meaning of the 'Named Queries' containment reference list isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Named Queries' containment reference list. * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_NamedQueries() * @model containment="true" * @generated */ public EList getNamedQueries() { if (namedQueries == null) { namedQueries = new EObjectContainmentEList(XmlNamedQuery.class, this, OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES); } return namedQueries; } /** * Returns the value of the 'Named Native Queries' containment reference list. * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlNamedNativeQuery}. * *

* If the meaning of the 'Named Native Queries' containment reference list isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Named Native Queries' containment reference list. * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_NamedNativeQueries() * @model containment="true" * @generated */ public EList getNamedNativeQueries() { if (namedNativeQueries == null) { namedNativeQueries = new EObjectContainmentEList(XmlNamedNativeQuery.class, this, OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES); } return namedNativeQueries; } /** * Returns the value of the 'Sql Result Set Mappings' containment reference list. * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.SqlResultSetMapping}. * *

* If the meaning of the 'Sql Result Set Mappings' containment reference list isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Sql Result Set Mappings' containment reference list. * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_SqlResultSetMappings() * @model containment="true" * @generated */ public EList getSqlResultSetMappings() { if (sqlResultSetMappings == null) { sqlResultSetMappings = new EObjectContainmentEList(SqlResultSetMapping.class, this, OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS); } return sqlResultSetMappings; } /** * Returns the value of the 'Mapped Superclasses' containment reference list. * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlMappedSuperclass}. * *

* If the meaning of the 'Mapped Superclasses' containment reference list isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Mapped Superclasses' containment reference list. * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_MappedSuperclasses() * @model containment="true" * @generated */ public EList getMappedSuperclasses() { if (mappedSuperclasses == null) { mappedSuperclasses = new EObjectContainmentEList(XmlMappedSuperclass.class, this, OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES); } return mappedSuperclasses; } /** * Returns the value of the 'Entities' containment reference list. * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlEntity}. * *

* If the meaning of the 'Entities' containment reference list isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Entities' containment reference list. * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Entities() * @model containment="true" * @generated */ public EList getEntities() { if (entities == null) { entities = new EObjectContainmentEList(XmlEntity.class, this, OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES); } return entities; } /** * Returns the value of the 'Embeddables' containment reference list. * The list contents are of type {@link org.eclipse.jpt.core.resource.orm.XmlEmbeddable}. * *

* If the meaning of the 'Embeddables' containment reference list isn't clear, * there really should be more of a description here... *

* * @return the value of the 'Embeddables' containment reference list. * @see org.eclipse.jpt.core.resource.orm.OrmPackage#getXmlEntityMappings_Embeddables() * @model containment="true" * @generated */ public EList getEmbeddables() { if (embeddables == null) { embeddables = new EObjectContainmentEList(XmlEmbeddable.class, this, OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES); } return embeddables; } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA: return basicSetPersistenceUnitMetadata(null, msgs); case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS: return ((InternalEList)getSequenceGenerators()).basicRemove(otherEnd, msgs); case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS: return ((InternalEList)getTableGenerators()).basicRemove(otherEnd, msgs); case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES: return ((InternalEList)getNamedQueries()).basicRemove(otherEnd, msgs); case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES: return ((InternalEList)getNamedNativeQueries()).basicRemove(otherEnd, msgs); case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS: return ((InternalEList)getSqlResultSetMappings()).basicRemove(otherEnd, msgs); case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES: return ((InternalEList)getMappedSuperclasses()).basicRemove(otherEnd, msgs); case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES: return ((InternalEList)getEntities()).basicRemove(otherEnd, msgs); case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES: return ((InternalEList)getEmbeddables()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case OrmPackage.XML_ENTITY_MAPPINGS__VERSION: return getVersion(); case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION: return getDescription(); case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA: return getPersistenceUnitMetadata(); case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE: return getPackage(); case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA: return getSchema(); case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG: return getCatalog(); case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS: return getAccess(); case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS: return getSequenceGenerators(); case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS: return getTableGenerators(); case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES: return getNamedQueries(); case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES: return getNamedNativeQueries(); case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS: return getSqlResultSetMappings(); case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES: return getMappedSuperclasses(); case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES: return getEntities(); case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES: return getEmbeddables(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case OrmPackage.XML_ENTITY_MAPPINGS__VERSION: setVersion((String)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION: setDescription((String)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA: setPersistenceUnitMetadata((XmlPersistenceUnitMetadata)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE: setPackage((String)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA: setSchema((String)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG: setCatalog((String)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS: setAccess((AccessType)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS: getSequenceGenerators().clear(); getSequenceGenerators().addAll((Collection)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS: getTableGenerators().clear(); getTableGenerators().addAll((Collection)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES: getNamedQueries().clear(); getNamedQueries().addAll((Collection)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES: getNamedNativeQueries().clear(); getNamedNativeQueries().addAll((Collection)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS: getSqlResultSetMappings().clear(); getSqlResultSetMappings().addAll((Collection)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES: getMappedSuperclasses().clear(); getMappedSuperclasses().addAll((Collection)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES: getEntities().clear(); getEntities().addAll((Collection)newValue); return; case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES: getEmbeddables().clear(); getEmbeddables().addAll((Collection)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case OrmPackage.XML_ENTITY_MAPPINGS__VERSION: unsetVersion(); return; case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION: setDescription(DESCRIPTION_EDEFAULT); return; case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA: setPersistenceUnitMetadata((XmlPersistenceUnitMetadata)null); return; case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE: setPackage(PACKAGE_EDEFAULT); return; case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA: setSchema(SCHEMA_EDEFAULT); return; case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG: setCatalog(CATALOG_EDEFAULT); return; case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS: setAccess(ACCESS_EDEFAULT); return; case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS: getSequenceGenerators().clear(); return; case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS: getTableGenerators().clear(); return; case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES: getNamedQueries().clear(); return; case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES: getNamedNativeQueries().clear(); return; case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS: getSqlResultSetMappings().clear(); return; case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES: getMappedSuperclasses().clear(); return; case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES: getEntities().clear(); return; case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES: getEmbeddables().clear(); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case OrmPackage.XML_ENTITY_MAPPINGS__VERSION: return isSetVersion(); case OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION: return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); case OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA: return persistenceUnitMetadata != null; case OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE: return PACKAGE_EDEFAULT == null ? package_ != null : !PACKAGE_EDEFAULT.equals(package_); case OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA: return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema); case OrmPackage.XML_ENTITY_MAPPINGS__CATALOG: return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog); case OrmPackage.XML_ENTITY_MAPPINGS__ACCESS: return access != ACCESS_EDEFAULT; case OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS: return sequenceGenerators != null && !sequenceGenerators.isEmpty(); case OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS: return tableGenerators != null && !tableGenerators.isEmpty(); case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES: return namedQueries != null && !namedQueries.isEmpty(); case OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES: return namedNativeQueries != null && !namedNativeQueries.isEmpty(); case OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS: return sqlResultSetMappings != null && !sqlResultSetMappings.isEmpty(); case OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES: return mappedSuperclasses != null && !mappedSuperclasses.isEmpty(); case OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES: return entities != null && !entities.isEmpty(); case OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES: return embeddables != null && !embeddables.isEmpty(); } return super.eIsSet(featureID); } // **************** overrides ********************************************** /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (version: "); if (versionESet) result.append(version); else result.append(""); result.append(", description: "); result.append(description); result.append(", package: "); result.append(package_); result.append(", schema: "); result.append(schema); result.append(", catalog: "); result.append(catalog); result.append(", access: "); result.append(access); result.append(')'); return result.toString(); } public List getTypeMappings() { // convert lists to arrays to avoid ConcurrentModificationException while adding to result list ArrayList typeMappings = new ArrayList(); CollectionTools.addAll(typeMappings, this.getMappedSuperclasses().toArray(EMPTY_XML_TYPE_MAPPING_ARRAY)); CollectionTools.addAll(typeMappings, this.getEntities().toArray(EMPTY_XML_TYPE_MAPPING_ARRAY)); CollectionTools.addAll(typeMappings, this.getEmbeddables().toArray(EMPTY_XML_TYPE_MAPPING_ARRAY)); return typeMappings; } private static final XmlTypeMapping[] EMPTY_XML_TYPE_MAPPING_ARRAY = new XmlTypeMapping[0]; }