diff options
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/SequenceGeneratorImpl.java')
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/SequenceGeneratorImpl.java | 389 |
1 files changed, 389 insertions, 0 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/SequenceGeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/SequenceGeneratorImpl.java new file mode 100644 index 0000000000..cedfc52039 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/orm/SequenceGeneratorImpl.java @@ -0,0 +1,389 @@ +/******************************************************************************* + * Copyright (c) 2007, 2008 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.internal.resource.orm; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.jpt.core.internal.resource.common.JpaEObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Sequence Generator</b></em>'. + * <!-- end-user-doc --> + * + * + * @see org.eclipse.jpt.core.internal.resource.orm.OrmPackage#getSequenceGeneratorImpl() + * @model kind="class" + * @generated + */ +public class SequenceGeneratorImpl extends JpaEObject implements SequenceGenerator +{ + /** + * 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; + + /** + * The default value of the '{@link #getInitialValue() <em>Initial Value</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getInitialValue() + * @generated + * @ordered + */ + protected static final Integer INITIAL_VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getInitialValue() <em>Initial Value</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getInitialValue() + * @generated + * @ordered + */ + protected Integer initialValue = INITIAL_VALUE_EDEFAULT; + + /** + * The default value of the '{@link #getAllocationSize() <em>Allocation Size</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAllocationSize() + * @generated + * @ordered + */ + protected static final Integer ALLOCATION_SIZE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAllocationSize() <em>Allocation Size</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAllocationSize() + * @generated + * @ordered + */ + protected Integer allocationSize = ALLOCATION_SIZE_EDEFAULT; + + /** + * The default value of the '{@link #getSequenceName() <em>Sequence Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSequenceName() + * @generated + * @ordered + */ + protected static final String SEQUENCE_NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getSequenceName() <em>Sequence Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSequenceName() + * @generated + * @ordered + */ + protected String sequenceName = SEQUENCE_NAME_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected SequenceGeneratorImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return OrmPackage.Literals.SEQUENCE_GENERATOR_IMPL; + } + + /** + * Returns the value of the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Name</em>' attribute. + * @see #setName(String) + * @see org.eclipse.jpt.core.internal.resource.orm.OrmPackage#getGenerator_Name() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" + * @generated + */ + public String getName() + { + return name; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.resource.orm.SequenceGeneratorImpl#getName <em>Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Name</em>' attribute. + * @see #getName() + * @generated + */ + public void setName(String newName) + { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.SEQUENCE_GENERATOR_IMPL__NAME, oldName, name)); + } + + /** + * Returns the value of the '<em><b>Sequence Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Sequence Name</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Sequence Name</em>' attribute. + * @see #setSequenceName(String) + * @see org.eclipse.jpt.core.internal.resource.orm.OrmPackage#getSequenceGenerator_SequenceName() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * @generated + */ + public String getSequenceName() + { + return sequenceName; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.resource.orm.SequenceGeneratorImpl#getSequenceName <em>Sequence Name</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Sequence Name</em>' attribute. + * @see #getSequenceName() + * @generated + */ + public void setSequenceName(String newSequenceName) + { + String oldSequenceName = sequenceName; + sequenceName = newSequenceName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.SEQUENCE_GENERATOR_IMPL__SEQUENCE_NAME, oldSequenceName, sequenceName)); + } + + /** + * Returns the value of the '<em><b>Initial Value</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Initial Value</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Initial Value</em>' attribute. + * @see #setInitialValue(Integer) + * @see org.eclipse.jpt.core.internal.resource.orm.OrmPackage#getGenerator_InitialValue() + * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject" + * @generated + */ + public Integer getInitialValue() + { + return initialValue; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.resource.orm.SequenceGeneratorImpl#getInitialValue <em>Initial Value</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Initial Value</em>' attribute. + * @see #getInitialValue() + * @generated + */ + public void setInitialValue(Integer newInitialValue) + { + Integer oldInitialValue = initialValue; + initialValue = newInitialValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE, oldInitialValue, initialValue)); + } + + /** + * Returns the value of the '<em><b>Allocation Size</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Allocation Size</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Allocation Size</em>' attribute. + * @see #setAllocationSize(Integer) + * @see org.eclipse.jpt.core.internal.resource.orm.OrmPackage#getGenerator_AllocationSize() + * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject" + * @generated + */ + public Integer getAllocationSize() + { + return allocationSize; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.core.internal.resource.orm.SequenceGeneratorImpl#getAllocationSize <em>Allocation Size</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Allocation Size</em>' attribute. + * @see #getAllocationSize() + * @generated + */ + public void setAllocationSize(Integer newAllocationSize) + { + Integer oldAllocationSize = allocationSize; + allocationSize = newAllocationSize; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE, oldAllocationSize, allocationSize)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case OrmPackage.SEQUENCE_GENERATOR_IMPL__NAME: + return getName(); + case OrmPackage.SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE: + return getInitialValue(); + case OrmPackage.SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE: + return getAllocationSize(); + case OrmPackage.SEQUENCE_GENERATOR_IMPL__SEQUENCE_NAME: + return getSequenceName(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case OrmPackage.SEQUENCE_GENERATOR_IMPL__NAME: + setName((String)newValue); + return; + case OrmPackage.SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE: + setInitialValue((Integer)newValue); + return; + case OrmPackage.SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE: + setAllocationSize((Integer)newValue); + return; + case OrmPackage.SEQUENCE_GENERATOR_IMPL__SEQUENCE_NAME: + setSequenceName((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case OrmPackage.SEQUENCE_GENERATOR_IMPL__NAME: + setName(NAME_EDEFAULT); + return; + case OrmPackage.SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE: + setInitialValue(INITIAL_VALUE_EDEFAULT); + return; + case OrmPackage.SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE: + setAllocationSize(ALLOCATION_SIZE_EDEFAULT); + return; + case OrmPackage.SEQUENCE_GENERATOR_IMPL__SEQUENCE_NAME: + setSequenceName(SEQUENCE_NAME_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case OrmPackage.SEQUENCE_GENERATOR_IMPL__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case OrmPackage.SEQUENCE_GENERATOR_IMPL__INITIAL_VALUE: + return INITIAL_VALUE_EDEFAULT == null ? initialValue != null : !INITIAL_VALUE_EDEFAULT.equals(initialValue); + case OrmPackage.SEQUENCE_GENERATOR_IMPL__ALLOCATION_SIZE: + return ALLOCATION_SIZE_EDEFAULT == null ? allocationSize != null : !ALLOCATION_SIZE_EDEFAULT.equals(allocationSize); + case OrmPackage.SEQUENCE_GENERATOR_IMPL__SEQUENCE_NAME: + return SEQUENCE_NAME_EDEFAULT == null ? sequenceName != null : !SEQUENCE_NAME_EDEFAULT.equals(sequenceName); + } + 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(", initialValue: "); + result.append(initialValue); + result.append(", allocationSize: "); + result.append(allocationSize); + result.append(", sequenceName: "); + result.append(sequenceName); + result.append(')'); + return result.toString(); + } + +} // SequenceGenerator |