| /******************************************************************************* |
| * Copyright (c) 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.eclipselink.core.resource.elorm; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.util.EDataTypeEList; |
| |
| import org.eclipse.jpt.core.resource.common.AbstractJpaEObject; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * A representation of the model object '<em><b>Xml Unique Constraint Impl</b></em>'. |
| * <!-- end-user-doc --> |
| * |
| * |
| * @see org.eclipse.jpt.eclipselink.core.resource.elorm.EclipseLinkOrmPackage#getXmlUniqueConstraintImpl() |
| * @model kind="class" |
| * @generated |
| */ |
| public class XmlUniqueConstraintImpl extends AbstractJpaEObject implements XmlUniqueConstraint |
| { |
| /** |
| * The cached value of the '{@link #getColumnNames() <em>Column Names</em>}' attribute list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getColumnNames() |
| * @generated |
| * @ordered |
| */ |
| protected EList<String> columnNames; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected XmlUniqueConstraintImpl() |
| { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() |
| { |
| return EclipseLinkOrmPackage.Literals.XML_UNIQUE_CONSTRAINT_IMPL; |
| } |
| |
| /** |
| * Returns the value of the '<em><b>Column Names</b></em>' attribute list. |
| * The list contents are of type {@link java.lang.String}. |
| * <!-- begin-user-doc --> |
| * <p> |
| * If the meaning of the '<em>Column Names</em>' attribute list isn't clear, |
| * there really should be more of a description here... |
| * </p> |
| * <!-- end-user-doc --> |
| * @return the value of the '<em>Column Names</em>' attribute list. |
| * @see org.eclipse.jpt.eclipselink.core.resource.elorm.EclipseLinkOrmPackage#getXmlUniqueConstraint_ColumnNames() |
| * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String" required="true" |
| * @generated |
| */ |
| public EList<String> getColumnNames() |
| { |
| if (columnNames == null) |
| { |
| columnNames = new EDataTypeEList<String>(String.class, this, EclipseLinkOrmPackage.XML_UNIQUE_CONSTRAINT_IMPL__COLUMN_NAMES); |
| } |
| return columnNames; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) |
| { |
| switch (featureID) |
| { |
| case EclipseLinkOrmPackage.XML_UNIQUE_CONSTRAINT_IMPL__COLUMN_NAMES: |
| return getColumnNames(); |
| } |
| 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 EclipseLinkOrmPackage.XML_UNIQUE_CONSTRAINT_IMPL__COLUMN_NAMES: |
| getColumnNames().clear(); |
| getColumnNames().addAll((Collection<? extends String>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) |
| { |
| switch (featureID) |
| { |
| case EclipseLinkOrmPackage.XML_UNIQUE_CONSTRAINT_IMPL__COLUMN_NAMES: |
| getColumnNames().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) |
| { |
| switch (featureID) |
| { |
| case EclipseLinkOrmPackage.XML_UNIQUE_CONSTRAINT_IMPL__COLUMN_NAMES: |
| return columnNames != null && !columnNames.isEmpty(); |
| } |
| 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(" (columnNames: "); |
| result.append(columnNames); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // XmlUniqueConstraintImpl |