diff options
author | kmoore | 2011-08-08 12:01:14 +0000 |
---|---|---|
committer | kmoore | 2011-08-08 12:01:14 +0000 |
commit | 568e8d7cb85e772d1f07cd163ac104efc796c8d2 (patch) | |
tree | adb19bcfc2295114d0758c32326d3245c1b4c28a | |
parent | 023e134d493ffda496708705d70e8b459f2972bb (diff) | |
download | webtools.dali-568e8d7cb85e772d1f07cd163ac104efc796c8d2.tar.gz webtools.dali-568e8d7cb85e772d1f07cd163ac104efc796c8d2.tar.xz webtools.dali-568e8d7cb85e772d1f07cd163ac104efc796c8d2.zip |
added resource model for multi-tenancy support
47 files changed, 3225 insertions, 667 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/model/jpaResourceModels.genmodel b/jpa/plugins/org.eclipse.jpt.jpa.core/model/jpaResourceModels.genmodel index 89701be828..6f0753205a 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/model/jpaResourceModels.genmodel +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/model/jpaResourceModels.genmodel @@ -62,6 +62,10 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlColumn/unique"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlColumn/updatable"/> </genClasses> + <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlDiscriminatorColumn"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlDiscriminatorColumn/discriminatorType"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//AbstractXmlDiscriminatorColumn/length"/> + </genClasses> <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlEmbedded"/> <genClasses image="false" ecoreClass="orm.ecore#//AbstractXmlMultiRelationshipMapping"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference orm.ecore#//AbstractXmlMultiRelationshipMapping/mapKey"/> @@ -145,10 +149,7 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlConvertibleMapping/temporal"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlConvertibleMapping/enumerated"/> </genClasses> - <genClasses ecoreClass="orm.ecore#//XmlDiscriminatorColumn"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlDiscriminatorColumn/discriminatorType"/> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute orm.ecore#//XmlDiscriminatorColumn/length"/> - </genClasses> + <genClasses ecoreClass="orm.ecore#//XmlDiscriminatorColumn"/> <genClasses ecoreClass="orm.ecore#//XmlElementCollection"/> <genClasses ecoreClass="orm.ecore#//XmlEmbeddable"/> <genClasses image="false" ecoreClass="orm.ecore#//XmlEmbedded"/> @@ -452,8 +453,8 @@ </genClasses> </nestedGenPackages> </genPackages> - <genPackages prefix="Persistence" basePackage="org.eclipse.jpt.jpa.core.resource" disposableProviderFactory="true" - adapterFactory="false" ecorePackage="persistence.ecore#/"> + <genPackages prefix="Persistence" basePackage="org.eclipse.jpt.jpa.core.resource" + disposableProviderFactory="true" adapterFactory="false" ecorePackage="persistence.ecore#/"> <genEnums typeSafeEnumCompatible="false" ecoreEnum="persistence.ecore#//XmlPersistenceUnitTransactionType"> <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//XmlPersistenceUnitTransactionType/JTA"/> <genEnumLiterals ecoreEnumLiteral="persistence.ecore#//XmlPersistenceUnitTransactionType/RESOURCE_LOCAL"/> diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/model/orm.ecore b/jpa/plugins/org.eclipse.jpt.jpa.core/model/orm.ecore index 90197ea84f..3edbd9d7da 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/model/orm.ecore +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/model/orm.ecore @@ -12,6 +12,12 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="unique" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="updatable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/> </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlDiscriminatorColumn" abstract="true" + eSuperTypes="#//AbstractXmlNamedColumn"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="discriminatorType" eType="#//DiscriminatorType" + defaultValueLiteral="STRING"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="length" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/> + </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlEmbedded" abstract="true" eSuperTypes="#//AbstractXmlAttributeMapping #//XmlAttributeOverrideContainer"/> <eClassifiers xsi:type="ecore:EClass" name="AbstractXmlMultiRelationshipMapping" @@ -125,11 +131,7 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="temporal" eType="#//TemporalType"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="enumerated" eType="#//EnumType"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="XmlDiscriminatorColumn" eSuperTypes="#//AbstractXmlNamedColumn"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="discriminatorType" eType="#//DiscriminatorType" - defaultValueLiteral="STRING"/> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="length" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/> - </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="XmlDiscriminatorColumn" eSuperTypes="#//AbstractXmlDiscriminatorColumn"/> <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection" eSuperTypes="#//AbstractXmlAttributeMapping #//v2_0/XmlElementCollection_2_0"/> <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable" eSuperTypes="#//AbstractXmlTypeMapping"/> <eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded" eSuperTypes="#//AbstractXmlEmbedded #//v2_0/XmlEmbedded_2_0"/> diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties index 98f06b2b92..c9af037936 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties @@ -56,4 +56,4 @@ JPA_RENAME_FOLDER_PARTICIPANT_NAME=JPA Rename Folder Participant JPA_RENAME_MAPPING_FILE_PARTICIPANT_NAME=JPA Rename Mapping File Participant JPA_MOVE_TYPE_PARTICIPANT_NAME=JPA Move Type Participant JPA_MOVE_MAPPING_FILE_PARTICIPANT_NAME=JPA Move Mapping File Participant -
\ No newline at end of file + diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseDiscriminatorColumnAnnotation.java new file mode 100644 index 0000000000..5ad8acee12 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryBaseDiscriminatorColumnAnnotation.java @@ -0,0 +1,83 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.core.internal.resource.java.binary; + +import org.eclipse.jdt.core.IAnnotation; +import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation; +import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType; + +public abstract class BinaryBaseDiscriminatorColumnAnnotation + extends BinaryNamedColumnAnnotation + implements DiscriminatorColumnAnnotation +{ + private DiscriminatorType discriminatorType; + private Integer length; + + + protected BinaryBaseDiscriminatorColumnAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { + super(parent, jdtAnnotation); + this.discriminatorType = this.buildDiscriminatorType(); + this.length = this.buildLength(); + } + + @Override + public void update() { + super.update(); + this.setDiscriminatorType_(this.buildDiscriminatorType()); + this.setLength_(this.buildLength()); + } + + + // ********** DiscriminatorColumnAnnotation implementation ********** + + // ***** discriminator type + public DiscriminatorType getDiscriminatorType() { + return null; + } + + public void setDiscriminatorType(DiscriminatorType discriminatorType) { + throw new UnsupportedOperationException(); + } + + private void setDiscriminatorType_(DiscriminatorType discriminatorType) { + DiscriminatorType old = this.discriminatorType; + this.discriminatorType = discriminatorType; + this.firePropertyChanged(DISCRIMINATOR_TYPE_PROPERTY, old, discriminatorType); + } + + private DiscriminatorType buildDiscriminatorType() { + return DiscriminatorType.fromJavaAnnotationValue(this.getJdtMemberValue(this.getDiscriminatorTypeElementName())); + } + + protected abstract String getDiscriminatorTypeElementName(); + + // ***** length + public Integer getLength() { + return null; + } + + public void setLength(Integer length) { + throw new UnsupportedOperationException(); + } + + private void setLength_(Integer length) { + Integer old = this.length; + this.length = length; + this.firePropertyChanged(LENGTH_PROPERTY, old, length); + } + + private Integer buildLength() { + return (Integer) this.getJdtMemberValue(this.getLengthElementName()); + } + + protected abstract String getLengthElementName(); + +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java index 90c442f966..6ffea3f24e 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/binary/BinaryDiscriminatorColumnAnnotation.java @@ -11,38 +11,35 @@ package org.eclipse.jpt.jpa.core.internal.resource.java.binary; import org.eclipse.jdt.core.IAnnotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; -import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation; -import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType; import org.eclipse.jpt.jpa.core.resource.java.JPA; /** * javax.persistence.DiscriminatorColumn */ public final class BinaryDiscriminatorColumnAnnotation - extends BinaryNamedColumnAnnotation - implements DiscriminatorColumnAnnotation + extends BinaryBaseDiscriminatorColumnAnnotation { - private DiscriminatorType discriminatorType; - private Integer length; public BinaryDiscriminatorColumnAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { super(parent, jdtAnnotation); - this.discriminatorType = this.buildDiscriminatorType(); - this.length = this.buildLength(); } public String getAnnotationName() { return ANNOTATION_NAME; } + // ********** BinaryBaseDiscriminatorColumnAnnotation implementation ********** + @Override - public void update() { - super.update(); - this.setDiscriminatorType_(this.buildDiscriminatorType()); - this.setLength_(this.buildLength()); + protected String getDiscriminatorTypeElementName() { + return JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; } + @Override + protected String getLengthElementName() { + return JPA.DISCRIMINATOR_COLUMN__LENGTH; + } // ********** BinaryNamedColumnAnnotation implementation ********** @@ -55,46 +52,4 @@ public final class BinaryDiscriminatorColumnAnnotation protected String getColumnDefinitionElementName() { return JPA.DISCRIMINATOR_COLUMN__COLUMN_DEFINITION; } - - - // ********** DiscriminatorColumnAnnotation implementation ********** - - // ***** discriminator type - public DiscriminatorType getDiscriminatorType() { - return null; - } - - public void setDiscriminatorType(DiscriminatorType discriminatorType) { - throw new UnsupportedOperationException(); - } - - private void setDiscriminatorType_(DiscriminatorType discriminatorType) { - DiscriminatorType old = this.discriminatorType; - this.discriminatorType = discriminatorType; - this.firePropertyChanged(DISCRIMINATOR_TYPE_PROPERTY, old, discriminatorType); - } - - private DiscriminatorType buildDiscriminatorType() { - return DiscriminatorType.fromJavaAnnotationValue(this.getJdtMemberValue(JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE)); - } - - // ***** length - public Integer getLength() { - return null; - } - - public void setLength(Integer length) { - throw new UnsupportedOperationException(); - } - - private void setLength_(Integer length) { - Integer old = this.length; - this.length = length; - this.firePropertyChanged(LENGTH_PROPERTY, old, length); - } - - private Integer buildLength() { - return (Integer) this.getJdtMemberValue(JPA.DISCRIMINATOR_COLUMN__LENGTH); - } - } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseDiscriminatorColumnAnnotation.java new file mode 100644 index 0000000000..1ca1c80f81 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceBaseDiscriminatorColumnAnnotation.java @@ -0,0 +1,152 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.core.internal.resource.java.source; + +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; +import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter; +import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter; +import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; +import org.eclipse.jpt.common.core.resource.java.JavaResourceNode; +import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; +import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter; +import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter; +import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter; +import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter; +import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation; +import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType; + +/** + * <code>javax.persistence.DiscriminatorColumn</code> + */ +public abstract class SourceBaseDiscriminatorColumnAnnotation + extends SourceNamedColumnAnnotation + implements DiscriminatorColumnAnnotation +{ + + private DeclarationAnnotationElementAdapter<String> discriminatorTypeDeclarationAdapter; + private AnnotationElementAdapter<String> discriminatorTypeAdapter; + private DiscriminatorType discriminatorType; + + private DeclarationAnnotationElementAdapter<Integer> lengthDeclarationAdapter; + private AnnotationElementAdapter<Integer> lengthAdapter; + private Integer length; + + + + protected SourceBaseDiscriminatorColumnAnnotation(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { + super(parent, element, daa, annotationAdapter); + this.discriminatorTypeDeclarationAdapter = this.buildDiscriminatorTypeDeclarationAdapter(); + this.discriminatorTypeAdapter = this.buildDiscriminatorTypeAdapter(); + this.lengthDeclarationAdapter = this.buildLengthDeclarationAdapter(); + this.lengthAdapter = this.buildLengthAdapter(); + } + + protected SourceBaseDiscriminatorColumnAnnotation(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) { + this(parent, element, daa, new ElementAnnotationAdapter(element, daa)); + } + + protected SourceBaseDiscriminatorColumnAnnotation(JavaResourceNode parent, AnnotatedElement element, IndexedDeclarationAnnotationAdapter idaa) { + this(parent, element, idaa, new ElementIndexedAnnotationAdapter(element, idaa)); + } + + @Override + public void initialize(CompilationUnit astRoot) { + super.initialize(astRoot); + this.discriminatorType = this.buildDiscriminatorType(astRoot); + this.length = this.buildLength(astRoot); + } + + @Override + public void synchronizeWith(CompilationUnit astRoot) { + super.synchronizeWith(astRoot); + this.syncLength(this.buildLength(astRoot)); + this.syncDiscriminatorType(this.buildDiscriminatorType(astRoot)); + } + + + // ********** DiscriminatorColumn implementation ********** + + // ***** discriminator type + public DiscriminatorType getDiscriminatorType() { + return this.discriminatorType; + } + + public void setDiscriminatorType(DiscriminatorType discriminatorType) { + if (this.attributeValueHasChanged(this.discriminatorType, discriminatorType)) { + this.discriminatorType = discriminatorType; + this.discriminatorTypeAdapter.setValue(DiscriminatorType.toJavaAnnotationValue(discriminatorType)); + } + } + + private void syncDiscriminatorType(DiscriminatorType astDiscriminatorType) { + DiscriminatorType old = this.discriminatorType; + this.discriminatorType = astDiscriminatorType; + this.firePropertyChanged(DISCRIMINATOR_TYPE_PROPERTY, old, astDiscriminatorType); + } + + private DiscriminatorType buildDiscriminatorType(CompilationUnit astRoot) { + return DiscriminatorType.fromJavaAnnotationValue(this.discriminatorTypeAdapter.getValue(astRoot)); + } + + private DeclarationAnnotationElementAdapter<String> buildDiscriminatorTypeDeclarationAdapter() { + return new EnumDeclarationAnnotationElementAdapter(this.daa, this.getDiscriminatorTypeElementName()); + } + + private AnnotationElementAdapter<String> buildDiscriminatorTypeAdapter() { + return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, this.discriminatorTypeDeclarationAdapter); + } + + protected abstract String getDiscriminatorTypeElementName(); + + // ***** length + public Integer getLength() { + return this.length; + } + + public void setLength(Integer length) { + if (this.attributeValueHasChanged(this.length, length)) { + this.length = length; + this.lengthAdapter.setValue(length); + } + } + + private void syncLength(Integer astLength) { + Integer old = this.length; + this.length = astLength; + this.firePropertyChanged(LENGTH_PROPERTY, old, astLength); + } + + private Integer buildLength(CompilationUnit astRoot) { + return this.lengthAdapter.getValue(astRoot); + } + + private DeclarationAnnotationElementAdapter<Integer> buildLengthDeclarationAdapter() { + return this.buildIntegerElementAdapter(this.getLengthElementName()); + } + + private AnnotationElementAdapter<Integer> buildLengthAdapter() { + return this.buildIntegerElementAdapter(this.lengthDeclarationAdapter); + } + + protected abstract String getLengthElementName(); + + + // ********** misc ********** + + @Override + public boolean isUnset() { + return super.isUnset() && + (this.discriminatorType == null) && + (this.length == null); + } + +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java index 1be3475532..da10772710 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/resource/java/source/SourceDiscriminatorColumnAnnotation.java @@ -9,64 +9,32 @@ ******************************************************************************/ package org.eclipse.jpt.jpa.core.internal.resource.java.source; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; -import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; -import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter; import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; -import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter; import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation; -import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType; import org.eclipse.jpt.jpa.core.resource.java.JPA; /** * <code>javax.persistence.DiscriminatorColumn</code> */ public final class SourceDiscriminatorColumnAnnotation - extends SourceNamedColumnAnnotation + extends SourceBaseDiscriminatorColumnAnnotation implements DiscriminatorColumnAnnotation { private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); - private static final DeclarationAnnotationElementAdapter<String> DISCRIMINATOR_TYPE_DECLARATION_ADAPTER = buildDiscriminatorTypeDeclarationAdapter(); - private AnnotationElementAdapter<String> discriminatorTypeAdapter; - private DiscriminatorType discriminatorType; - - private DeclarationAnnotationElementAdapter<Integer> lengthDeclarationAdapter; - private AnnotationElementAdapter<Integer> lengthAdapter; - private Integer length; - public SourceDiscriminatorColumnAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) { super(parent, element, DECLARATION_ANNOTATION_ADAPTER); - this.discriminatorTypeAdapter = this.buildDiscriminatorTypeAdapter(); - this.lengthDeclarationAdapter = this.buildLengthDeclarationAdapter(); - this.lengthAdapter = this.buildLengthAdapter(); } public String getAnnotationName() { return ANNOTATION_NAME; } - @Override - public void initialize(CompilationUnit astRoot) { - super.initialize(astRoot); - this.discriminatorType = this.buildDiscriminatorType(astRoot); - this.length = this.buildLength(astRoot); - } - - @Override - public void synchronizeWith(CompilationUnit astRoot) { - super.synchronizeWith(astRoot); - this.syncLength(this.buildLength(astRoot)); - this.syncDiscriminatorType(this.buildDiscriminatorType(astRoot)); - } - - - // ********** JavaSourceNamedColumnAnnotation implementation ********** + // ********** SourceNamedColumnAnnotation implementation ********** @Override protected String getNameElementName() { @@ -78,79 +46,15 @@ public final class SourceDiscriminatorColumnAnnotation return JPA.DISCRIMINATOR_COLUMN__COLUMN_DEFINITION; } - - // ********** DiscriminatorColumn implementation ********** - - // ***** discriminator type - public DiscriminatorType getDiscriminatorType() { - return this.discriminatorType; - } - - public void setDiscriminatorType(DiscriminatorType discriminatorType) { - if (this.attributeValueHasChanged(this.discriminatorType, discriminatorType)) { - this.discriminatorType = discriminatorType; - this.discriminatorTypeAdapter.setValue(DiscriminatorType.toJavaAnnotationValue(discriminatorType)); - } - } - - private void syncDiscriminatorType(DiscriminatorType astDiscriminatorType) { - DiscriminatorType old = this.discriminatorType; - this.discriminatorType = astDiscriminatorType; - this.firePropertyChanged(DISCRIMINATOR_TYPE_PROPERTY, old, astDiscriminatorType); - } - - private DiscriminatorType buildDiscriminatorType(CompilationUnit astRoot) { - return DiscriminatorType.fromJavaAnnotationValue(this.discriminatorTypeAdapter.getValue(astRoot)); - } - - private AnnotationElementAdapter<String> buildDiscriminatorTypeAdapter() { - return new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, DISCRIMINATOR_TYPE_DECLARATION_ADAPTER); - } - - // ***** length - public Integer getLength() { - return this.length; - } - - public void setLength(Integer length) { - if (this.attributeValueHasChanged(this.length, length)) { - this.length = length; - this.lengthAdapter.setValue(length); - } - } - - private void syncLength(Integer astLength) { - Integer old = this.length; - this.length = astLength; - this.firePropertyChanged(LENGTH_PROPERTY, old, astLength); - } - - private Integer buildLength(CompilationUnit astRoot) { - return this.lengthAdapter.getValue(astRoot); - } - - private DeclarationAnnotationElementAdapter<Integer> buildLengthDeclarationAdapter() { - return this.buildIntegerElementAdapter(JPA.DISCRIMINATOR_COLUMN__LENGTH); - } - - private AnnotationElementAdapter<Integer> buildLengthAdapter() { - return this.buildIntegerElementAdapter(this.lengthDeclarationAdapter); - } - - - // ********** misc ********** + // ********** SourceBaseDiscriminatorColumnAnnotation implementation ********** @Override - public boolean isUnset() { - return super.isUnset() && - (this.discriminatorType == null) && - (this.length == null); + protected String getDiscriminatorTypeElementName() { + return JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; } - - // ********** static methods ********** - - private static DeclarationAnnotationElementAdapter<String> buildDiscriminatorTypeDeclarationAdapter() { - return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, JPA.DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE); + @Override + protected String getLengthElementName() { + return JPA.DISCRIMINATOR_COLUMN__LENGTH; } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/AbstractXmlDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/AbstractXmlDiscriminatorColumn.java new file mode 100644 index 0000000000..f86625ab98 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/AbstractXmlDiscriminatorColumn.java @@ -0,0 +1,274 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.core.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.wst.common.internal.emf.resource.Translator; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Abstract Xml Discriminator Column</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}</li> + * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn#getLength <em>Length</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlDiscriminatorColumn() + * @model kind="class" abstract="true" + * @generated + */ +public abstract class AbstractXmlDiscriminatorColumn extends AbstractXmlNamedColumn +{ + /** + * 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 DiscriminatorType DISCRIMINATOR_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDiscriminatorType() <em>Discriminator Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getDiscriminatorType() + * @generated + * @ordered + */ + protected DiscriminatorType discriminatorType = DISCRIMINATOR_TYPE_EDEFAULT; + + /** + * The default value of the '{@link #getLength() <em>Length</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getLength() + * @generated + * @ordered + */ + protected static final Integer LENGTH_EDEFAULT = null; + + /** + * The cached value of the '{@link #getLength() <em>Length</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getLength() + * @generated + * @ordered + */ + protected Integer length = LENGTH_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected AbstractXmlDiscriminatorColumn() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() + { + return OrmPackage.Literals.ABSTRACT_XML_DISCRIMINATOR_COLUMN; + } + + /** + * Returns the value of the '<em><b>Discriminator Type</b></em>' attribute. + * The default value is <code>"STRING"</code>. + * The literals are from the enumeration {@link org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Discriminator Type</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Discriminator Type</em>' attribute. + * @see org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType + * @see #setDiscriminatorType(DiscriminatorType) + * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlDiscriminatorColumn_DiscriminatorType() + * @model default="STRING" + * @generated + */ + public DiscriminatorType getDiscriminatorType() + { + return discriminatorType; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Discriminator Type</em>' attribute. + * @see org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType + * @see #getDiscriminatorType() + * @generated + */ + public void setDiscriminatorType(DiscriminatorType newDiscriminatorType) + { + DiscriminatorType oldDiscriminatorType = discriminatorType; + discriminatorType = newDiscriminatorType == null ? DISCRIMINATOR_TYPE_EDEFAULT : newDiscriminatorType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE, oldDiscriminatorType, discriminatorType)); + } + + /** + * Returns the value of the '<em><b>Length</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Length</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Length</em>' attribute. + * @see #setLength(Integer) + * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlDiscriminatorColumn_Length() + * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject" + * @generated + */ + public Integer getLength() + { + return length; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn#getLength <em>Length</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Length</em>' attribute. + * @see #getLength() + * @generated + */ + public void setLength(Integer newLength) + { + Integer oldLength = length; + length = newLength; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__LENGTH, oldLength, length)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE: + return getDiscriminatorType(); + case OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__LENGTH: + return getLength(); + } + 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.ABSTRACT_XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE: + setDiscriminatorType((DiscriminatorType)newValue); + return; + case OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__LENGTH: + setLength((Integer)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE: + setDiscriminatorType(DISCRIMINATOR_TYPE_EDEFAULT); + return; + case OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__LENGTH: + setLength(LENGTH_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE: + return discriminatorType != DISCRIMINATOR_TYPE_EDEFAULT; + case OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__LENGTH: + return LENGTH_EDEFAULT == null ? length != null : !LENGTH_EDEFAULT.equals(length); + } + 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(" (discriminatorType: "); + result.append(discriminatorType); + result.append(", length: "); + result.append(length); + result.append(')'); + return result.toString(); + } + + + // ********** translators ********** + + protected static Translator buildDiscrminiatorTypeTranslator() { + return new Translator(JPA.DISCRIMINATOR_TYPE, OrmPackage.eINSTANCE.getAbstractXmlDiscriminatorColumn_DiscriminatorType(), Translator.DOM_ATTRIBUTE); + } + + protected static Translator buildLengthTranslator() { + return new Translator(JPA.LENGTH, OrmPackage.eINSTANCE.getAbstractXmlDiscriminatorColumn_Length(), Translator.DOM_ATTRIBUTE); + } +} // AbstractXmlDiscriminatorColumn diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/OrmPackage.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/OrmPackage.java index 715b6aa4e5..8f62fbc828 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/OrmPackage.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/OrmPackage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. + * Copyright (c) 2007, 2011 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. @@ -79,7 +79,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlAccessHolder() * @generated */ - public static final int XML_ACCESS_HOLDER = 10; + public static final int XML_ACCESS_HOLDER = 11; /** * The feature id for the '<em><b>Access</b></em>' attribute. @@ -107,7 +107,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlAttributeMapping() * @generated */ - public static final int XML_ATTRIBUTE_MAPPING = 11; + public static final int XML_ATTRIBUTE_MAPPING = 12; /** * The feature id for the '<em><b>Access</b></em>' attribute. @@ -181,7 +181,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlNamedColumn() * @generated */ - public static final int ABSTRACT_XML_NAMED_COLUMN = 4; + public static final int ABSTRACT_XML_NAMED_COLUMN = 5; /** * The feature id for the '<em><b>Column Definition</b></em>' attribute. @@ -293,6 +293,61 @@ public class OrmPackage extends EPackageImpl public static final int ABSTRACT_XML_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 5; /** + * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn <em>Abstract Xml Discriminator Column</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn + * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlDiscriminatorColumn() + * @generated + */ + public static final int ABSTRACT_XML_DISCRIMINATOR_COLUMN = 2; + + /** + * The feature id for the '<em><b>Column Definition</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ABSTRACT_XML_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ABSTRACT_XML_DISCRIMINATOR_COLUMN__NAME = ABSTRACT_XML_NAMED_COLUMN__NAME; + + /** + * The feature id for the '<em><b>Discriminator Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ABSTRACT_XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Length</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ABSTRACT_XML_DISCRIMINATOR_COLUMN__LENGTH = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1; + + /** + * The number of structural features of the '<em>Abstract Xml Discriminator Column</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int ABSTRACT_XML_DISCRIMINATOR_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 2; + + /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlEmbedded <em>Abstract Xml Embedded</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -300,7 +355,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlEmbedded() * @generated */ - public static final int ABSTRACT_XML_EMBEDDED = 2; + public static final int ABSTRACT_XML_EMBEDDED = 3; /** * The feature id for the '<em><b>Access</b></em>' attribute. @@ -346,7 +401,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlRelationshipMapping() * @generated */ - public static final int ABSTRACT_XML_RELATIONSHIP_MAPPING = 5; + public static final int ABSTRACT_XML_RELATIONSHIP_MAPPING = 6; /** * The feature id for the '<em><b>Access</b></em>' attribute. @@ -410,7 +465,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlMultiRelationshipMapping() * @generated */ - public static final int ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING = 3; + public static final int ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING = 4; /** * The feature id for the '<em><b>Access</b></em>' attribute. @@ -573,7 +628,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlSingleRelationshipMapping() * @generated */ - public static final int ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING = 6; + public static final int ABSTRACT_XML_SINGLE_RELATIONSHIP_MAPPING = 7; /** * The feature id for the '<em><b>Access</b></em>' attribute. @@ -682,7 +737,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlTable() * @generated */ - public static final int ABSTRACT_XML_TABLE = 8; + public static final int ABSTRACT_XML_TABLE = 9; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -737,7 +792,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlTypeMapping() * @generated */ - public static final int XML_TYPE_MAPPING = 83; + public static final int XML_TYPE_MAPPING = 84; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlTypeMapping <em>Abstract Xml Type Mapping</em>}' class. @@ -747,7 +802,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlTypeMapping() * @generated */ - public static final int ABSTRACT_XML_TYPE_MAPPING = 9; + public static final int ABSTRACT_XML_TYPE_MAPPING = 10; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride <em>Xml Association Override</em>}' class. @@ -757,7 +812,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlAssociationOverride() * @generated */ - public static final int XML_ASSOCIATION_OVERRIDE = 12; + public static final int XML_ASSOCIATION_OVERRIDE = 13; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverrideContainer <em>Xml Association Override Container</em>}' class. @@ -767,7 +822,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlAssociationOverrideContainer() * @generated */ - public static final int XML_ASSOCIATION_OVERRIDE_CONTAINER = 13; + public static final int XML_ASSOCIATION_OVERRIDE_CONTAINER = 14; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride <em>Xml Attribute Override</em>}' class. @@ -777,7 +832,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlAttributeOverride() * @generated */ - public static final int XML_ATTRIBUTE_OVERRIDE = 14; + public static final int XML_ATTRIBUTE_OVERRIDE = 15; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverrideContainer <em>Xml Attribute Override Container</em>}' class. @@ -787,7 +842,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlAttributeOverrideContainer() * @generated */ - public static final int XML_ATTRIBUTE_OVERRIDE_CONTAINER = 15; + public static final int XML_ATTRIBUTE_OVERRIDE_CONTAINER = 16; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.Attributes <em>Attributes</em>}' class. @@ -797,7 +852,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAttributes() * @generated */ - public static final int ATTRIBUTES = 16; + public static final int ATTRIBUTES = 17; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlBasic <em>Xml Basic</em>}' class. @@ -807,7 +862,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlBasic() * @generated */ - public static final int XML_BASIC = 17; + public static final int XML_BASIC = 18; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.CascadeType <em>Cascade Type</em>}' class. @@ -817,7 +872,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getCascadeType() * @generated */ - public static final int CASCADE_TYPE = 18; + public static final int CASCADE_TYPE = 19; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlReferenceTable <em>Abstract Xml Reference Table</em>}' class. @@ -827,7 +882,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlReferenceTable() * @generated */ - public static final int ABSTRACT_XML_REFERENCE_TABLE = 7; + public static final int ABSTRACT_XML_REFERENCE_TABLE = 8; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -999,7 +1054,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOverride() * @generated */ - public static final int XML_OVERRIDE = 61; + public static final int XML_OVERRIDE = 62; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -1405,7 +1460,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlClassReference() * @generated */ - public static final int XML_CLASS_REFERENCE = 19; + public static final int XML_CLASS_REFERENCE = 20; /** * The feature id for the '<em><b>Class Name</b></em>' attribute. @@ -1433,7 +1488,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlCollectionTable() * @generated */ - public static final int XML_COLLECTION_TABLE = 20; + public static final int XML_COLLECTION_TABLE = 21; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -1497,7 +1552,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlColumn() * @generated */ - public static final int XML_COLUMN = 21; + public static final int XML_COLUMN = 22; /** * The feature id for the '<em><b>Column Definition</b></em>' attribute. @@ -1606,7 +1661,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getColumnMapping() * @generated */ - public static final int COLUMN_MAPPING = 22; + public static final int COLUMN_MAPPING = 23; /** * The feature id for the '<em><b>Column</b></em>' containment reference. @@ -1634,7 +1689,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getColumnResult() * @generated */ - public static final int COLUMN_RESULT = 23; + public static final int COLUMN_RESULT = 24; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -1662,7 +1717,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlConvertibleMapping() * @generated */ - public static final int XML_CONVERTIBLE_MAPPING = 24; + public static final int XML_CONVERTIBLE_MAPPING = 25; /** * The feature id for the '<em><b>Lob</b></em>' attribute. @@ -1708,7 +1763,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn() * @generated */ - public static final int XML_DISCRIMINATOR_COLUMN = 25; + public static final int XML_DISCRIMINATOR_COLUMN = 26; /** * The feature id for the '<em><b>Column Definition</b></em>' attribute. @@ -1717,7 +1772,7 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_NAMED_COLUMN__COLUMN_DEFINITION; + public static final int XML_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = ABSTRACT_XML_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -1726,7 +1781,7 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_DISCRIMINATOR_COLUMN__NAME = ABSTRACT_XML_NAMED_COLUMN__NAME; + public static final int XML_DISCRIMINATOR_COLUMN__NAME = ABSTRACT_XML_DISCRIMINATOR_COLUMN__NAME; /** * The feature id for the '<em><b>Discriminator Type</b></em>' attribute. @@ -1735,7 +1790,7 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 0; + public static final int XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = ABSTRACT_XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; /** * The feature id for the '<em><b>Length</b></em>' attribute. @@ -1744,7 +1799,7 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_DISCRIMINATOR_COLUMN__LENGTH = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 1; + public static final int XML_DISCRIMINATOR_COLUMN__LENGTH = ABSTRACT_XML_DISCRIMINATOR_COLUMN__LENGTH; /** * The number of structural features of the '<em>Xml Discriminator Column</em>' class. @@ -1753,7 +1808,7 @@ public class OrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_DISCRIMINATOR_COLUMN_FEATURE_COUNT = ABSTRACT_XML_NAMED_COLUMN_FEATURE_COUNT + 2; + public static final int XML_DISCRIMINATOR_COLUMN_FEATURE_COUNT = ABSTRACT_XML_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 0; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}' class. @@ -1763,7 +1818,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlElementCollection() * @generated */ - public static final int XML_ELEMENT_COLLECTION = 26; + public static final int XML_ELEMENT_COLLECTION = 27; /** * The feature id for the '<em><b>Access</b></em>' attribute. @@ -1962,7 +2017,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlEmbeddable() * @generated */ - public static final int XML_EMBEDDABLE = 27; + public static final int XML_EMBEDDABLE = 28; /** * The feature id for the '<em><b>Access</b></em>' attribute. @@ -2026,7 +2081,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlEmbedded() * @generated */ - public static final int XML_EMBEDDED = 28; + public static final int XML_EMBEDDED = 29; /** * The feature id for the '<em><b>Access</b></em>' attribute. @@ -2081,7 +2136,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlEmbeddedId() * @generated */ - public static final int XML_EMBEDDED_ID = 29; + public static final int XML_EMBEDDED_ID = 30; /** * The feature id for the '<em><b>Access</b></em>' attribute. @@ -2127,7 +2182,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlEntity() * @generated */ - public static final int XML_ENTITY = 30; + public static final int XML_ENTITY = 31; /** * The feature id for the '<em><b>Access</b></em>' attribute. @@ -2425,7 +2480,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlEventMethodContainer() * @generated */ - public static final int XML_EVENT_METHOD_CONTAINER = 36; + public static final int XML_EVENT_METHOD_CONTAINER = 37; /** * The feature id for the '<em><b>Pre Persist</b></em>' containment reference. @@ -2507,7 +2562,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getEntityListener() * @generated */ - public static final int ENTITY_LISTENER = 31; + public static final int ENTITY_LISTENER = 32; /** * The feature id for the '<em><b>Pre Persist</b></em>' containment reference. @@ -2607,7 +2662,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getEntityListeners() * @generated */ - public static final int ENTITY_LISTENERS = 32; + public static final int ENTITY_LISTENERS = 33; /** * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference list. @@ -2635,7 +2690,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlEntityMappings() * @generated */ - public static final int XML_ENTITY_MAPPINGS = 33; + public static final int XML_ENTITY_MAPPINGS = 34; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.EntityResult <em>Entity Result</em>}' class. @@ -2645,7 +2700,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getEntityResult() * @generated */ - public static final int ENTITY_RESULT = 34; + public static final int ENTITY_RESULT = 35; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.EventMethod <em>Event Method</em>}' class. @@ -2655,7 +2710,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getEventMethod() * @generated */ - public static final int EVENT_METHOD = 35; + public static final int EVENT_METHOD = 36; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.FieldResult <em>Field Result</em>}' class. @@ -2665,7 +2720,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getFieldResult() * @generated */ - public static final int FIELD_RESULT = 37; + public static final int FIELD_RESULT = 38; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratedValue <em>Xml Generated Value</em>}' class. @@ -2675,7 +2730,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlGeneratedValue() * @generated */ - public static final int XML_GENERATED_VALUE = 38; + public static final int XML_GENERATED_VALUE = 39; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlGenerator <em>Xml Generator</em>}' class. @@ -2685,7 +2740,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlGenerator() * @generated */ - public static final int XML_GENERATOR = 39; + public static final int XML_GENERATOR = 40; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratorContainer <em>Xml Generator Container</em>}' class. @@ -2695,7 +2750,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlGeneratorContainer() * @generated */ - public static final int XML_GENERATOR_CONTAINER = 40; + public static final int XML_GENERATOR_CONTAINER = 41; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlId <em>Xml Id</em>}' class. @@ -2705,7 +2760,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlId() * @generated */ - public static final int XML_ID = 41; + public static final int XML_ID = 42; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.Inheritance <em>Inheritance</em>}' class. @@ -2715,7 +2770,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getInheritance() * @generated */ - public static final int INHERITANCE = 43; + public static final int INHERITANCE = 44; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumn <em>Xml Join Column</em>}' class. @@ -2725,7 +2780,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlJoinColumn() * @generated */ - public static final int XML_JOIN_COLUMN = 44; + public static final int XML_JOIN_COLUMN = 45; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}' class. @@ -2735,7 +2790,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlJoinTable() * @generated */ - public static final int XML_JOIN_TABLE = 46; + public static final int XML_JOIN_TABLE = 47; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.Lob <em>Lob</em>}' class. @@ -2745,7 +2800,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getLob() * @generated */ - public static final int LOB = 48; + public static final int LOB = 49; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class. @@ -2755,7 +2810,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlManyToMany() * @generated */ - public static final int XML_MANY_TO_MANY = 49; + public static final int XML_MANY_TO_MANY = 50; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class. @@ -2765,7 +2820,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlManyToOne() * @generated */ - public static final int XML_MANY_TO_ONE = 50; + public static final int XML_MANY_TO_ONE = 51; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.MapKey <em>Map Key</em>}' class. @@ -2775,7 +2830,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getMapKey() * @generated */ - public static final int MAP_KEY = 51; + public static final int MAP_KEY = 52; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlMappedByMapping <em>Xml Mapped By Mapping</em>}' class. @@ -2785,7 +2840,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlMappedByMapping() * @generated */ - public static final int XML_MAPPED_BY_MAPPING = 52; + public static final int XML_MAPPED_BY_MAPPING = 53; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class. @@ -2795,7 +2850,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlMappedSuperclass() * @generated */ - public static final int XML_MAPPED_SUPERCLASS = 53; + public static final int XML_MAPPED_SUPERCLASS = 54; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlQuery <em>Xml Query</em>}' class. @@ -2805,7 +2860,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlQuery() * @generated */ - public static final int XML_QUERY = 74; + public static final int XML_QUERY = 75; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedNativeQuery <em>Xml Named Native Query</em>}' class. @@ -2815,7 +2870,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedNativeQuery() * @generated */ - public static final int XML_NAMED_NATIVE_QUERY = 54; + public static final int XML_NAMED_NATIVE_QUERY = 55; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery <em>Xml Named Query</em>}' class. @@ -2825,7 +2880,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNamedQuery() * @generated */ - public static final int XML_NAMED_QUERY = 55; + public static final int XML_NAMED_QUERY = 56; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlNullAttributeMapping <em>Xml Null Attribute Mapping</em>}' class. @@ -2835,7 +2890,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlNullAttributeMapping() * @generated */ - public static final int XML_NULL_ATTRIBUTE_MAPPING = 56; + public static final int XML_NULL_ATTRIBUTE_MAPPING = 57; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class. @@ -2845,7 +2900,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOneToMany() * @generated */ - public static final int XML_ONE_TO_MANY = 57; + public static final int XML_ONE_TO_MANY = 58; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class. @@ -2855,7 +2910,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOneToOne() * @generated */ - public static final int XML_ONE_TO_ONE = 58; + public static final int XML_ONE_TO_ONE = 59; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}' class. @@ -2865,7 +2920,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOrderColumn() * @generated */ - public static final int XML_ORDER_COLUMN = 60; + public static final int XML_ORDER_COLUMN = 61; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class. @@ -2875,7 +2930,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlPersistenceUnitDefaults() * @generated */ - public static final int XML_PERSISTENCE_UNIT_DEFAULTS = 62; + public static final int XML_PERSISTENCE_UNIT_DEFAULTS = 63; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class. @@ -2885,7 +2940,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlPersistenceUnitMetadata() * @generated */ - public static final int XML_PERSISTENCE_UNIT_METADATA = 63; + public static final int XML_PERSISTENCE_UNIT_METADATA = 64; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PostLoad <em>Post Load</em>}' class. @@ -2895,7 +2950,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPostLoad() * @generated */ - public static final int POST_LOAD = 65; + public static final int POST_LOAD = 66; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PostPersist <em>Post Persist</em>}' class. @@ -2905,7 +2960,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPostPersist() * @generated */ - public static final int POST_PERSIST = 66; + public static final int POST_PERSIST = 67; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PostRemove <em>Post Remove</em>}' class. @@ -2915,7 +2970,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPostRemove() * @generated */ - public static final int POST_REMOVE = 67; + public static final int POST_REMOVE = 68; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PostUpdate <em>Post Update</em>}' class. @@ -2925,7 +2980,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPostUpdate() * @generated */ - public static final int POST_UPDATE = 68; + public static final int POST_UPDATE = 69; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PrePersist <em>Pre Persist</em>}' class. @@ -2935,7 +2990,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPrePersist() * @generated */ - public static final int PRE_PERSIST = 69; + public static final int PRE_PERSIST = 70; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PreRemove <em>Pre Remove</em>}' class. @@ -2945,7 +3000,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPreRemove() * @generated */ - public static final int PRE_REMOVE = 70; + public static final int PRE_REMOVE = 71; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.PreUpdate <em>Pre Update</em>}' class. @@ -2955,7 +3010,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getPreUpdate() * @generated */ - public static final int PRE_UPDATE = 71; + public static final int PRE_UPDATE = 72; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlPrimaryKeyJoinColumn <em>Xml Primary Key Join Column</em>}' class. @@ -2965,7 +3020,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumn() * @generated */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN = 72; + public static final int XML_PRIMARY_KEY_JOIN_COLUMN = 73; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}' class. @@ -2975,7 +3030,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlQueryContainer() * @generated */ - public static final int XML_QUERY_CONTAINER = 75; + public static final int XML_QUERY_CONTAINER = 76; /** * The feature id for the '<em><b>Version</b></em>' attribute. @@ -3417,7 +3472,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlIdClassContainer() * @generated */ - public static final int XML_ID_CLASS_CONTAINER = 42; + public static final int XML_ID_CLASS_CONTAINER = 43; /** * The feature id for the '<em><b>Id Class</b></em>' containment reference. @@ -3544,7 +3599,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlJoinColumnContainer() * @generated */ - public static final int XML_JOIN_COLUMN_CONTAINER = 45; + public static final int XML_JOIN_COLUMN_CONTAINER = 46; /** * The feature id for the '<em><b>Join Columns</b></em>' containment reference list. @@ -3572,7 +3627,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlReferenceTable() * @generated */ - public static final int XML_REFERENCE_TABLE = 64; + public static final int XML_REFERENCE_TABLE = 65; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -3645,7 +3700,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlJoinTableContainer() * @generated */ - public static final int XML_JOIN_TABLE_CONTAINER = 47; + public static final int XML_JOIN_TABLE_CONTAINER = 48; /** * The feature id for the '<em><b>Join Table</b></em>' containment reference. @@ -4546,7 +4601,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlQueryHint() * @generated */ - public static final int XML_QUERY_HINT = 76; + public static final int XML_QUERY_HINT = 77; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}' class. @@ -4556,7 +4611,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlSecondaryTable() * @generated */ - public static final int XML_SECONDARY_TABLE = 77; + public static final int XML_SECONDARY_TABLE = 78; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator <em>Xml Sequence Generator</em>}' class. @@ -4566,7 +4621,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlSequenceGenerator() * @generated */ - public static final int XML_SEQUENCE_GENERATOR = 78; + public static final int XML_SEQUENCE_GENERATOR = 79; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.SqlResultSetMapping <em>Sql Result Set Mapping</em>}' class. @@ -4576,7 +4631,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getSqlResultSetMapping() * @generated */ - public static final int SQL_RESULT_SET_MAPPING = 79; + public static final int SQL_RESULT_SET_MAPPING = 80; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlTable <em>Xml Table</em>}' class. @@ -4586,7 +4641,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlTable() * @generated */ - public static final int XML_TABLE = 80; + public static final int XML_TABLE = 81; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}' class. @@ -4596,7 +4651,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlTableGenerator() * @generated */ - public static final int XML_TABLE_GENERATOR = 81; + public static final int XML_TABLE_GENERATOR = 82; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class. @@ -4606,7 +4661,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlTransient() * @generated */ - public static final int XML_TRANSIENT = 82; + public static final int XML_TRANSIENT = 83; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint <em>Xml Unique Constraint</em>}' class. @@ -4616,7 +4671,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlUniqueConstraint() * @generated */ - public static final int XML_UNIQUE_CONSTRAINT = 84; + public static final int XML_UNIQUE_CONSTRAINT = 85; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlVersion <em>Xml Version</em>}' class. @@ -4626,7 +4681,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlVersion() * @generated */ - public static final int XML_VERSION = 85; + public static final int XML_VERSION = 86; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlOrderable <em>Xml Orderable</em>}' class. @@ -4636,7 +4691,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlOrderable() * @generated */ - public static final int XML_ORDERABLE = 59; + public static final int XML_ORDERABLE = 60; /** * The feature id for the '<em><b>Order Column</b></em>' containment reference. @@ -5078,7 +5133,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlPrimaryKeyJoinColumnContainer() * @generated */ - public static final int XML_PRIMARY_KEY_JOIN_COLUMN_CONTAINER = 73; + public static final int XML_PRIMARY_KEY_JOIN_COLUMN_CONTAINER = 74; /** * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list. @@ -5610,7 +5665,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAccessType() * @generated */ - public static final int ACCESS_TYPE = 86; + public static final int ACCESS_TYPE = 87; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType <em>Discriminator Type</em>}' enum. @@ -5620,7 +5675,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getDiscriminatorType() * @generated */ - public static final int DISCRIMINATOR_TYPE = 87; + public static final int DISCRIMINATOR_TYPE = 88; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.EnumType <em>Enum Type</em>}' enum. @@ -5630,7 +5685,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getEnumType() * @generated */ - public static final int ENUM_TYPE = 88; + public static final int ENUM_TYPE = 89; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.FetchType <em>Fetch Type</em>}' enum. @@ -5640,7 +5695,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getFetchType() * @generated */ - public static final int FETCH_TYPE = 89; + public static final int FETCH_TYPE = 90; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.GenerationType <em>Generation Type</em>}' enum. @@ -5650,7 +5705,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getGenerationType() * @generated */ - public static final int GENERATION_TYPE = 90; + public static final int GENERATION_TYPE = 91; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.InheritanceType <em>Inheritance Type</em>}' enum. @@ -5660,7 +5715,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getInheritanceType() * @generated */ - public static final int INHERITANCE_TYPE = 91; + public static final int INHERITANCE_TYPE = 92; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.core.resource.orm.TemporalType <em>Temporal Type</em>}' enum. @@ -5670,7 +5725,7 @@ public class OrmPackage extends EPackageImpl * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getTemporalType() * @generated */ - public static final int TEMPORAL_TYPE = 92; + public static final int TEMPORAL_TYPE = 93; /** * <!-- begin-user-doc --> @@ -5691,6 +5746,13 @@ public class OrmPackage extends EPackageImpl * <!-- end-user-doc --> * @generated */ + private EClass abstractXmlDiscriminatorColumnEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ private EClass abstractXmlEmbeddedEClass = null; /** @@ -6502,6 +6564,50 @@ public class OrmPackage extends EPackageImpl } /** + * Returns the meta object for class '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn <em>Abstract Xml Discriminator Column</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Abstract Xml Discriminator Column</em>'. + * @see org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn + * @generated + */ + public EClass getAbstractXmlDiscriminatorColumn() + { + return abstractXmlDiscriminatorColumnEClass; + } + + + /** + * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Discriminator Type</em>'. + * @see org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn#getDiscriminatorType() + * @see #getAbstractXmlDiscriminatorColumn() + * @generated + */ + public EAttribute getAbstractXmlDiscriminatorColumn_DiscriminatorType() + { + return (EAttribute)abstractXmlDiscriminatorColumnEClass.getEStructuralFeatures().get(0); + } + + + /** + * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn#getLength <em>Length</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Length</em>'. + * @see org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn#getLength() + * @see #getAbstractXmlDiscriminatorColumn() + * @generated + */ + public EAttribute getAbstractXmlDiscriminatorColumn_Length() + { + return (EAttribute)abstractXmlDiscriminatorColumnEClass.getEStructuralFeatures().get(1); + } + + + /** * Returns the meta object for class '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlEmbedded <em>Abstract Xml Embedded</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -7391,34 +7497,6 @@ public class OrmPackage extends EPackageImpl } /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Discriminator Type</em>'. - * @see org.eclipse.jpt.jpa.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType() - * @see #getXmlDiscriminatorColumn() - * @generated - */ - public EAttribute getXmlDiscriminatorColumn_DiscriminatorType() - { - return (EAttribute)xmlDiscriminatorColumnEClass.getEStructuralFeatures().get(0); - } - - /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlDiscriminatorColumn#getLength <em>Length</em>}'. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Length</em>'. - * @see org.eclipse.jpt.jpa.core.resource.orm.XmlDiscriminatorColumn#getLength() - * @see #getXmlDiscriminatorColumn() - * @generated - */ - public EAttribute getXmlDiscriminatorColumn_Length() - { - return (EAttribute)xmlDiscriminatorColumnEClass.getEStructuralFeatures().get(1); - } - - /** * Returns the meta object for class '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -9660,6 +9738,10 @@ public class OrmPackage extends EPackageImpl createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__UNIQUE); createEAttribute(abstractXmlColumnEClass, ABSTRACT_XML_COLUMN__UPDATABLE); + abstractXmlDiscriminatorColumnEClass = createEClass(ABSTRACT_XML_DISCRIMINATOR_COLUMN); + createEAttribute(abstractXmlDiscriminatorColumnEClass, ABSTRACT_XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE); + createEAttribute(abstractXmlDiscriminatorColumnEClass, ABSTRACT_XML_DISCRIMINATOR_COLUMN__LENGTH); + abstractXmlEmbeddedEClass = createEClass(ABSTRACT_XML_EMBEDDED); abstractXmlMultiRelationshipMappingEClass = createEClass(ABSTRACT_XML_MULTI_RELATIONSHIP_MAPPING); @@ -9749,8 +9831,6 @@ public class OrmPackage extends EPackageImpl createEAttribute(xmlConvertibleMappingEClass, XML_CONVERTIBLE_MAPPING__ENUMERATED); xmlDiscriminatorColumnEClass = createEClass(XML_DISCRIMINATOR_COLUMN); - createEAttribute(xmlDiscriminatorColumnEClass, XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE); - createEAttribute(xmlDiscriminatorColumnEClass, XML_DISCRIMINATOR_COLUMN__LENGTH); xmlElementCollectionEClass = createEClass(XML_ELEMENT_COLLECTION); @@ -10014,6 +10094,7 @@ public class OrmPackage extends EPackageImpl // Add supertypes to classes abstractXmlAttributeMappingEClass.getESuperTypes().add(this.getXmlAttributeMapping()); abstractXmlColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn()); + abstractXmlDiscriminatorColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn()); abstractXmlEmbeddedEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping()); abstractXmlEmbeddedEClass.getESuperTypes().add(this.getXmlAttributeOverrideContainer()); abstractXmlMultiRelationshipMappingEClass.getESuperTypes().add(this.getAbstractXmlRelationshipMapping()); @@ -10043,7 +10124,7 @@ public class OrmPackage extends EPackageImpl xmlCollectionTableEClass.getESuperTypes().add(this.getAbstractXmlReferenceTable()); xmlCollectionTableEClass.getESuperTypes().add(theOrmV2_0Package.getXmlCollectionTable_2_0()); xmlColumnEClass.getESuperTypes().add(this.getAbstractXmlColumn()); - xmlDiscriminatorColumnEClass.getESuperTypes().add(this.getAbstractXmlNamedColumn()); + xmlDiscriminatorColumnEClass.getESuperTypes().add(this.getAbstractXmlDiscriminatorColumn()); xmlElementCollectionEClass.getESuperTypes().add(this.getAbstractXmlAttributeMapping()); xmlElementCollectionEClass.getESuperTypes().add(theOrmV2_0Package.getXmlElementCollection_2_0()); xmlEmbeddableEClass.getESuperTypes().add(this.getAbstractXmlTypeMapping()); @@ -10126,6 +10207,10 @@ public class OrmPackage extends EPackageImpl initEAttribute(getAbstractXmlColumn_Unique(), theXMLTypePackage.getBooleanObject(), "unique", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getAbstractXmlColumn_Updatable(), theXMLTypePackage.getBooleanObject(), "updatable", null, 0, 1, AbstractXmlColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(abstractXmlDiscriminatorColumnEClass, AbstractXmlDiscriminatorColumn.class, "AbstractXmlDiscriminatorColumn", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getAbstractXmlDiscriminatorColumn_DiscriminatorType(), this.getDiscriminatorType(), "discriminatorType", "STRING", 0, 1, AbstractXmlDiscriminatorColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getAbstractXmlDiscriminatorColumn_Length(), theXMLTypePackage.getIntObject(), "length", null, 0, 1, AbstractXmlDiscriminatorColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(abstractXmlEmbeddedEClass, AbstractXmlEmbedded.class, "AbstractXmlEmbedded", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(abstractXmlMultiRelationshipMappingEClass, AbstractXmlMultiRelationshipMapping.class, "AbstractXmlMultiRelationshipMapping", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -10215,8 +10300,6 @@ public class OrmPackage extends EPackageImpl initEAttribute(getXmlConvertibleMapping_Enumerated(), this.getEnumType(), "enumerated", null, 0, 1, XmlConvertibleMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(xmlDiscriminatorColumnEClass, XmlDiscriminatorColumn.class, "XmlDiscriminatorColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getXmlDiscriminatorColumn_DiscriminatorType(), this.getDiscriminatorType(), "discriminatorType", "STRING", 0, 1, XmlDiscriminatorColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getXmlDiscriminatorColumn_Length(), theXMLTypePackage.getIntObject(), "length", null, 0, 1, XmlDiscriminatorColumn.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(xmlElementCollectionEClass, XmlElementCollection.class, "XmlElementCollection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -10544,6 +10627,32 @@ public class OrmPackage extends EPackageImpl public static final EAttribute ABSTRACT_XML_COLUMN__UPDATABLE = eINSTANCE.getAbstractXmlColumn_Updatable(); /** + * The meta object literal for the '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn <em>Abstract Xml Discriminator Column</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn + * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getAbstractXmlDiscriminatorColumn() + * @generated + */ + public static final EClass ABSTRACT_XML_DISCRIMINATOR_COLUMN = eINSTANCE.getAbstractXmlDiscriminatorColumn(); + + /** + * The meta object literal for the '<em><b>Discriminator Type</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EAttribute ABSTRACT_XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = eINSTANCE.getAbstractXmlDiscriminatorColumn_DiscriminatorType(); + + /** + * The meta object literal for the '<em><b>Length</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EAttribute ABSTRACT_XML_DISCRIMINATOR_COLUMN__LENGTH = eINSTANCE.getAbstractXmlDiscriminatorColumn_Length(); + + /** * The meta object literal for the '{@link org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlEmbedded <em>Abstract Xml Embedded</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -11110,22 +11219,6 @@ public class OrmPackage extends EPackageImpl public static final EClass XML_DISCRIMINATOR_COLUMN = eINSTANCE.getXmlDiscriminatorColumn(); /** - * The meta object literal for the '<em><b>Discriminator Type</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = eINSTANCE.getXmlDiscriminatorColumn_DiscriminatorType(); - - /** - * The meta object literal for the '<em><b>Length</b></em>' attribute feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public static final EAttribute XML_DISCRIMINATOR_COLUMN__LENGTH = eINSTANCE.getXmlDiscriminatorColumn_Length(); - - /** * The meta object literal for the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/XmlDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/XmlDiscriminatorColumn.java index 232218a983..de2212c43a 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/XmlDiscriminatorColumn.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/XmlDiscriminatorColumn.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 Oracle. All rights reserved. + * Copyright (c) 2007, 2011 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. @@ -9,10 +9,8 @@ ******************************************************************************/ package org.eclipse.jpt.jpa.core.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.common.core.internal.utility.translators.SimpleTranslator; import org.eclipse.wst.common.internal.emf.resource.Translator; @@ -27,19 +25,12 @@ import org.eclipse.wst.common.internal.emf.resource.Translator; * will almost certainly be broken (repeatedly) as the API evolves. * <!-- end-user-doc --> * - * <p> - * The following features are supported: - * <ul> - * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}</li> - * <li>{@link org.eclipse.jpt.jpa.core.resource.orm.XmlDiscriminatorColumn#getLength <em>Length</em>}</li> - * </ul> - * </p> * * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn() * @model kind="class" * @generated */ -public class XmlDiscriminatorColumn extends AbstractXmlNamedColumn +public class XmlDiscriminatorColumn extends AbstractXmlDiscriminatorColumn { /** * changed this to null and removed the generated flag so emf won't generate over it @@ -48,36 +39,6 @@ public class XmlDiscriminatorColumn extends AbstractXmlNamedColumn protected static final DiscriminatorType DISCRIMINATOR_TYPE_EDEFAULT = null; /** - * The cached value of the '{@link #getDiscriminatorType() <em>Discriminator Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDiscriminatorType() - * @generated - * @ordered - */ - protected DiscriminatorType discriminatorType = DISCRIMINATOR_TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getLength() <em>Length</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getLength() - * @generated - * @ordered - */ - protected static final Integer LENGTH_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLength() <em>Length</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getLength() - * @generated - * @ordered - */ - protected Integer length = LENGTH_EDEFAULT; - - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -98,175 +59,6 @@ public class XmlDiscriminatorColumn extends AbstractXmlNamedColumn return OrmPackage.Literals.XML_DISCRIMINATOR_COLUMN; } - /** - * Returns the value of the '<em><b>Discriminator Type</b></em>' attribute. - * The default value is <code>"STRING"</code>. - * The literals are from the enumeration {@link org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType}. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Discriminator Type</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Discriminator Type</em>' attribute. - * @see org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType - * @see #setDiscriminatorType(DiscriminatorType) - * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn_DiscriminatorType() - * @model default="STRING" - * @generated - */ - public DiscriminatorType getDiscriminatorType() - { - return discriminatorType; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlDiscriminatorColumn#getDiscriminatorType <em>Discriminator Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Discriminator Type</em>' attribute. - * @see org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType - * @see #getDiscriminatorType() - * @generated - */ - public void setDiscriminatorType(DiscriminatorType newDiscriminatorType) - { - DiscriminatorType oldDiscriminatorType = discriminatorType; - discriminatorType = newDiscriminatorType == null ? DISCRIMINATOR_TYPE_EDEFAULT : newDiscriminatorType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE, oldDiscriminatorType, discriminatorType)); - } - - /** - * Returns the value of the '<em><b>Length</b></em>' attribute. - * <!-- begin-user-doc --> - * <p> - * If the meaning of the '<em>Length</em>' attribute isn't clear, - * there really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * @return the value of the '<em>Length</em>' attribute. - * @see #setLength(Integer) - * @see org.eclipse.jpt.jpa.core.resource.orm.OrmPackage#getXmlDiscriminatorColumn_Length() - * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject" - * @generated - */ - public Integer getLength() - { - return length; - } - - /** - * Sets the value of the '{@link org.eclipse.jpt.jpa.core.resource.orm.XmlDiscriminatorColumn#getLength <em>Length</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @param value the new value of the '<em>Length</em>' attribute. - * @see #getLength() - * @generated - */ - public void setLength(Integer newLength) - { - Integer oldLength = length; - length = newLength; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH, oldLength, length)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE: - return getDiscriminatorType(); - case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH: - return getLength(); - } - 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.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE: - setDiscriminatorType((DiscriminatorType)newValue); - return; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH: - setLength((Integer)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE: - setDiscriminatorType(DISCRIMINATOR_TYPE_EDEFAULT); - return; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH: - setLength(LENGTH_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case OrmPackage.XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE: - return discriminatorType != DISCRIMINATOR_TYPE_EDEFAULT; - case OrmPackage.XML_DISCRIMINATOR_COLUMN__LENGTH: - return LENGTH_EDEFAULT == null ? length != null : !LENGTH_EDEFAULT.equals(length); - } - 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(" (discriminatorType: "); - result.append(discriminatorType); - result.append(", length: "); - result.append(length); - result.append(')'); - return result.toString(); - } - // ********** translators ********** public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) { @@ -286,12 +78,5 @@ public class XmlDiscriminatorColumn extends AbstractXmlNamedColumn buildLengthTranslator() }; } - - protected static Translator buildDiscrminiatorTypeTranslator() { - return new Translator(JPA.DISCRIMINATOR_TYPE, OrmPackage.eINSTANCE.getXmlDiscriminatorColumn_DiscriminatorType(), Translator.DOM_ATTRIBUTE); - } - - protected static Translator buildLengthTranslator() { - return new Translator(JPA.LENGTH, OrmPackage.eINSTANCE.getXmlDiscriminatorColumn_Length(), Translator.DOM_ATTRIBUTE); - } + } // DiscriminatorColumn diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/persistence/XmlJavaClassRef.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/persistence/XmlJavaClassRef.java index 107c573e01..47a0881b54 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/persistence/XmlJavaClassRef.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/persistence/XmlJavaClassRef.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2010 Oracle. All rights reserved. + * Copyright (c) 2006, 2011 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. @@ -17,6 +17,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.jdt.core.IType; import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator; import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject; +import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject; import org.eclipse.text.edits.ReplaceEdit; import org.eclipse.wst.common.internal.emf.resource.Translator; @@ -43,7 +44,7 @@ import org.eclipse.wst.common.internal.emf.resource.Translator; * @extends JpaEObject * @generated */ -public class XmlJavaClassRef extends AbstractJpaEObject +public class XmlJavaClassRef extends AbstractJpaEObject implements JpaEObject { /** * The default value of the '{@link #getJavaClass() <em>Java Class</em>}' attribute. diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF index 68d6bffc79..f11737654a 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF @@ -82,6 +82,11 @@ Export-Package: org.eclipse.jpt.jpa.eclipselink.core, org.eclipse.jpt.jpa.eclipselink.core.internal.v2_1.resource.java.source;x-internal:=true, org.eclipse.jpt.jpa.eclipselink.core.internal.v2_2;x-internal:=true, org.eclipse.jpt.jpa.eclipselink.core.internal.v2_2.context.orm;x-internal:=true, + org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3;x-internal:=true, + org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.context.orm;x-internal:=true, + org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.resource.java;x-internal:=true, + org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.resource.java.binary;x-internal:=true, + org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.resource.java.source;x-internal:=true, org.eclipse.jpt.jpa.eclipselink.core.platform, org.eclipse.jpt.jpa.eclipselink.core.resource.java, org.eclipse.jpt.jpa.eclipselink.core.resource.orm, @@ -90,10 +95,13 @@ Export-Package: org.eclipse.jpt.jpa.eclipselink.core, org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0, org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1, org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2, + org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3, org.eclipse.jpt.jpa.eclipselink.core.v2_0.context, org.eclipse.jpt.jpa.eclipselink.core.v2_0.context.java, org.eclipse.jpt.jpa.eclipselink.core.v2_0.context.orm, org.eclipse.jpt.jpa.eclipselink.core.v2_0.context.persistence.connection, org.eclipse.jpt.jpa.eclipselink.core.v2_0.context.persistence.logging, org.eclipse.jpt.jpa.eclipselink.core.v2_0.context.persistence.options, - org.eclipse.jpt.jpa.eclipselink.core.v2_0.resource.java + org.eclipse.jpt.jpa.eclipselink.core.v2_0.resource.java, + org.eclipse.jpt.jpa.eclipselink.core.v2_3, + org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel index 08fb91cb63..386f74dff9 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel @@ -569,6 +569,7 @@ </genClasses> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlMultitenant_2_3"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlMultitenant_2_3/type"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMultitenant_2_3/tenantDiscriminatorColumns"/> </genClasses> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3/name"/> @@ -592,7 +593,9 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlStruct_2_3/name"/> </genClasses> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/name"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/contextProperty"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/table"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/primaryKey"/> </genClasses> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlStructure_2_3"/> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlElementCollection_2_3"> diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore index 7dbaa6d7bb..025af0aa57 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore @@ -725,6 +725,8 @@ <eClassifiers xsi:type="ecore:EClass" name="XmlMultitenant_2_3" abstract="true" interface="true"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//v2_3/XmlMultitenantType"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="tenantDiscriminatorColumns" + upperBound="-1" eType="#//v2_3/XmlTenantDiscriminatorColumn_2_3" containment="true"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="XmlNamedPlsqlStoredFunctionQuery_2_3" abstract="true" interface="true"> @@ -755,8 +757,10 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="XmlTenantDiscriminatorColumn_2_3" - abstract="true" interface="true"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> + abstract="true" interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlDiscriminatorColumn"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="contextProperty" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="table" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="primaryKey" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="XmlStructure_2_3" abstract="true" interface="true"/> diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_1/AbstractEclipseLink2_1JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_1/AbstractEclipseLink2_1JpaPlatformProvider.java deleted file mode 100644 index 215b1d2095..0000000000 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_1/AbstractEclipseLink2_1JpaPlatformProvider.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 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.jpa.eclipselink.core.internal.v2_1; - -import java.util.ArrayList; -import org.eclipse.core.runtime.content.IContentType; -import org.eclipse.jpt.common.core.JptResourceType; -import org.eclipse.jpt.jpa.core.ResourceDefinition; -import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin; -import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_0.AbstractEclipseLink2_0JpaPlatformProvider; -import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_1.context.orm.EclipseLinkOrmXml2_1Definition; - -public abstract class AbstractEclipseLink2_1JpaPlatformProvider - extends AbstractEclipseLink2_0JpaPlatformProvider -{ - protected AbstractEclipseLink2_1JpaPlatformProvider() { - super(); - } - - - // ********** resource models ********** - - @Override - public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) { - if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) { - return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE; - } - return super.getMostRecentSupportedResourceType(contentType); - } - - - // ********** resource definitions ********** - - @Override - protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) { - super.addResourceDefinitionsTo(definitions); - definitions.add(EclipseLinkOrmXml2_1Definition.instance()); - } -} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformProvider.java index e2bc1f0063..4e242a80ca 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformProvider.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_1/EclipseLink2_1JpaPlatformProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. + * Copyright (c) 2009, 2011 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. @@ -9,13 +9,20 @@ ******************************************************************************/ package org.eclipse.jpt.jpa.eclipselink.core.internal.v2_1; +import java.util.ArrayList; +import org.eclipse.core.runtime.content.IContentType; +import org.eclipse.jpt.common.core.JptResourceType; import org.eclipse.jpt.jpa.core.JpaPlatformProvider; +import org.eclipse.jpt.jpa.core.ResourceDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_0.AbstractEclipseLink2_0JpaPlatformProvider; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_1.context.orm.EclipseLinkOrmXml2_1Definition; /** * EclipseLink 2.1 platform config */ public class EclipseLink2_1JpaPlatformProvider - extends AbstractEclipseLink2_1JpaPlatformProvider + extends AbstractEclipseLink2_0JpaPlatformProvider { // singleton private static final JpaPlatformProvider INSTANCE = new EclipseLink2_1JpaPlatformProvider(); @@ -35,4 +42,23 @@ public class EclipseLink2_1JpaPlatformProvider private EclipseLink2_1JpaPlatformProvider() { super(); } + + + // ********** resource models ********** + + @Override + public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) { + if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) { + return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE; + } + return super.getMostRecentSupportedResourceType(contentType); + } + + // ********** resource definitions ********** + + @Override + protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) { + super.addResourceDefinitionsTo(definitions); + definitions.add(EclipseLinkOrmXml2_1Definition.instance()); + } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_2/EclipseLink2_2JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_2/EclipseLink2_2JpaPlatformProvider.java index 5e5776793a..73c3df5398 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_2/EclipseLink2_2JpaPlatformProvider.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_2/EclipseLink2_2JpaPlatformProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2010 Oracle. All rights reserved. +* Copyright (c) 2010, 2011 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. @@ -12,14 +12,16 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.v2_2; import java.util.ArrayList; import org.eclipse.core.runtime.content.IContentType; import org.eclipse.jpt.common.core.JptResourceType; +import org.eclipse.jpt.common.utility.internal.CollectionTools; import org.eclipse.jpt.jpa.core.JpaPlatformProvider; import org.eclipse.jpt.jpa.core.ResourceDefinition; import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin; -import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_1.AbstractEclipseLink2_1JpaPlatformProvider; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_0.AbstractEclipseLink2_0JpaPlatformProvider; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_1.context.orm.EclipseLinkOrmXml2_1Definition; import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_2.context.orm.EclipseLinkOrmXml2_2Definition; public class EclipseLink2_2JpaPlatformProvider - extends AbstractEclipseLink2_1JpaPlatformProvider + extends AbstractEclipseLink2_0JpaPlatformProvider { // singleton private static final JpaPlatformProvider INSTANCE = new EclipseLink2_2JpaPlatformProvider(); @@ -57,6 +59,11 @@ public class EclipseLink2_2JpaPlatformProvider @Override protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) { super.addResourceDefinitionsTo(definitions); - definitions.add(EclipseLinkOrmXml2_2Definition.instance()); + CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS); } + + protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] { + EclipseLinkOrmXml2_1Definition.instance(), + EclipseLinkOrmXml2_2Definition.instance(), + }; } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/EclipseLink2_3JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/EclipseLink2_3JpaAnnotationDefinitionProvider.java new file mode 100644 index 0000000000..ec0ee61ff2 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/EclipseLink2_3JpaAnnotationDefinitionProvider.java @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 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.jpa.eclipselink.core.internal.v2_3; + +import java.util.ArrayList; +import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition; +import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition; +import org.eclipse.jpt.common.utility.internal.CollectionTools; +import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider; +import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_1.resource.java.EclipseLinkClassExtractor2_1AnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.resource.java.EclipseLinkMultitenantAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotationDefinition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.resource.java.EclipseLinkTenantDiscriminatorColumnsAnnotationDefinition; + +/** + * Provides annotations for 2.3 EclipseLink platform + */ +public class EclipseLink2_3JpaAnnotationDefinitionProvider + extends AbstractJpaAnnotationDefinitionProvider +{ + // singleton + private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLink2_3JpaAnnotationDefinitionProvider(); + + /** + * Return the singleton + */ + public static JpaAnnotationDefinitionProvider instance() { + return INSTANCE; + } + + /** + * Enforce singleton usage + */ + private EclipseLink2_3JpaAnnotationDefinitionProvider() { + super(); + } + + @Override + protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) { + CollectionTools.addAll(definitions, ANNOTATION_DEFINITIONS); + } + + protected static final AnnotationDefinition[] ANNOTATION_DEFINITIONS = new AnnotationDefinition[] { + EclipseLinkBasicCollectionAnnotationDefinition.instance(), + EclipseLinkBasicMapAnnotationDefinition.instance(), + EclipseLinkCacheAnnotationDefinition.instance(), + EclipseLinkChangeTrackingAnnotationDefinition.instance(), + EclipseLinkClassExtractor2_1AnnotationDefinition.instance(), + EclipseLinkConvertAnnotationDefinition.instance(), + EclipseLinkConverterAnnotationDefinition.instance(), + EclipseLinkCustomizerAnnotationDefinition.instance(), + EclipseLinkExistenceCheckingAnnotationDefinition.instance(), + EclipseLinkJoinFetchAnnotationDefinition.instance(), + EclipseLinkMultitenantAnnotationDefinition.instance(), + EclipseLinkMutableAnnotationDefinition.instance(), + EclipseLinkObjectTypeConverterAnnotationDefinition.instance(), + EclipseLinkPrimaryKeyAnnotationDefinition.instance(), + EclipseLinkPrivateOwnedAnnotationDefinition.instance(), + EclipseLinkReadOnlyAnnotationDefinition.instance(), + EclipseLinkReadTransformerAnnotationDefinition.instance(), + EclipseLinkStructConverterAnnotationDefinition.instance(), + EclipseLinkTenantDiscriminatorColumnsAnnotationDefinition.instance(), + EclipseLinkTransformationAnnotationDefinition.instance(), + EclipseLinkTypeConverterAnnotationDefinition.instance(), + EclipseLinkVariableOneToOneAnnotationDefinition.instance(), + EclipseLinkWriteTransformerAnnotationDefinition.instance() + }; + + @Override + protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) { + CollectionTools.addAll(definitions, NESTABLE_ANNOTATION_DEFINITIONS); + } + + protected static final NestableAnnotationDefinition[] NESTABLE_ANNOTATION_DEFINITIONS = new NestableAnnotationDefinition[] { + EclipseLinkTenantDiscriminatorColumnAnnotationDefinition.instance() + }; + +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/EclipseLink2_3JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/EclipseLink2_3JpaPlatformFactory.java index 33c2ece79d..230750f071 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/EclipseLink2_3JpaPlatformFactory.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/EclipseLink2_3JpaPlatformFactory.java @@ -19,7 +19,6 @@ import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin; import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion; import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_0.EclipseLink2_0JpaFactory; import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_0.EclipseLink2_0JpaPlatformFactory; -import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_1.EclipseLink2_1JpaAnnotationDefinitionProvider; public class EclipseLink2_3JpaPlatformFactory @@ -55,6 +54,6 @@ public class EclipseLink2_3JpaPlatformFactory protected AnnotationProvider buildAnnotationProvider() { return new JpaAnnotationProvider( Generic2_0JpaAnnotationDefinitionProvider.instance(), - EclipseLink2_1JpaAnnotationDefinitionProvider.instance()); + EclipseLink2_3JpaAnnotationDefinitionProvider.instance()); } }
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/EclipseLink2_3JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/EclipseLink2_3JpaPlatformProvider.java index 1b6d31e55b..4a40d120f1 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/EclipseLink2_3JpaPlatformProvider.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/EclipseLink2_3JpaPlatformProvider.java @@ -12,16 +12,22 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3; import java.util.ArrayList; import org.eclipse.core.runtime.content.IContentType; import org.eclipse.jpt.common.core.JptResourceType; +import org.eclipse.jpt.common.utility.internal.CollectionTools; import org.eclipse.jpt.jpa.core.JpaPlatformProvider; import org.eclipse.jpt.jpa.core.ResourceDefinition; +import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition; import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin; -import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_1.AbstractEclipseLink2_1JpaPlatformProvider; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_0.AbstractEclipseLink2_0JpaPlatformProvider; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_0.context.java.EclipseLinkJavaEmbeddableDefinition2_0; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_1.context.orm.EclipseLinkOrmXml2_1Definition; import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_2.context.orm.EclipseLinkOrmXml2_2Definition; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.context.java.EclipseLinkJavaEntityDefinition2_3; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.context.java.EclipseLinkJavaMappedSuperclassDefinition2_3; import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.context.orm.EclipseLinkOrmXml2_3Definition; public class EclipseLink2_3JpaPlatformProvider - extends AbstractEclipseLink2_1JpaPlatformProvider { + extends AbstractEclipseLink2_0JpaPlatformProvider { // singleton private static final JpaPlatformProvider INSTANCE = new EclipseLink2_3JpaPlatformProvider(); @@ -59,7 +65,28 @@ public class EclipseLink2_3JpaPlatformProvider @Override protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) { super.addResourceDefinitionsTo(definitions); - definitions.add(EclipseLinkOrmXml2_2Definition.instance()); - definitions.add(EclipseLinkOrmXml2_3Definition.instance()); + CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS); } + + protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] { + EclipseLinkOrmXml2_1Definition.instance(), + EclipseLinkOrmXml2_2Definition.instance(), + EclipseLinkOrmXml2_3Definition.instance() + }; + + // ********* Java type mappings ********* + + @Override + protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) { + CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS); + } + + // order matches that used by EclipseLink + // NB: no EclipseLink-specific mappings + protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] { + EclipseLinkJavaEntityDefinition2_3.instance(), + EclipseLinkJavaEmbeddableDefinition2_0.instance(), + EclipseLinkJavaMappedSuperclassDefinition2_3.instance() + }; + } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/context/java/EclipseLinkJavaEntityDefinition2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/context/java/EclipseLinkJavaEntityDefinition2_3.java new file mode 100644 index 0000000000..29c87ef2e8 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/context/java/EclipseLinkJavaEntityDefinition2_3.java @@ -0,0 +1,66 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.internal.v2_3.context.java; + +import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable; +import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; +import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition; +import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_0.context.java.EclipseLinkJavaEntityDefinition2_0; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLink2_3; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLinkMultitenantAnnotation; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation; + +public class EclipseLinkJavaEntityDefinition2_3 + extends JavaTypeMappingDefinitionWrapper +{ + private static final JavaTypeMappingDefinition DELEGATE = EclipseLinkJavaEntityDefinition2_0.instance(); + + // singleton + private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEntityDefinition2_3(); + + /** + * Return the singleton. + */ + public static JavaTypeMappingDefinition instance() { + return INSTANCE; + } + + + /** + * Enforce singleton usage + */ + private EclipseLinkJavaEntityDefinition2_3() { + super(); + } + + @Override + protected JavaTypeMappingDefinition getDelegate() { + return DELEGATE; + } + + @Override + public Iterable<String> getSupportingAnnotationNames() { + return COMBINED_SUPPORTING_ANNOTATION_NAMES; + } + + public static final String[] ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] { + EclipseLinkMultitenantAnnotation.ANNOTATION_NAME, + EclipseLinkTenantDiscriminatorColumnAnnotation.ANNOTATION_NAME, + EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMNS + }; + public static final Iterable<String> ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES_ARRAY); + + @SuppressWarnings("unchecked") + private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>( + DELEGATE.getSupportingAnnotationNames(), + ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES + ); +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/context/java/EclipseLinkJavaMappedSuperclassDefinition2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/context/java/EclipseLinkJavaMappedSuperclassDefinition2_3.java new file mode 100644 index 0000000000..1e06ef399e --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/context/java/EclipseLinkJavaMappedSuperclassDefinition2_3.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.internal.v2_3.context.java; + +import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; +import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition; +import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_0.context.java.EclipseLinkJavaMappedSuperclassDefinition2_0; + +public class EclipseLinkJavaMappedSuperclassDefinition2_3 + extends JavaTypeMappingDefinitionWrapper +{ + private static final JavaTypeMappingDefinition DELEGATE = EclipseLinkJavaMappedSuperclassDefinition2_0.instance(); + + // singleton + private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaMappedSuperclassDefinition2_3(); + + /** + * Return the singleton. + */ + public static JavaTypeMappingDefinition instance() { + return INSTANCE; + } + + + /** + * Enforce singleton usage + */ + private EclipseLinkJavaMappedSuperclassDefinition2_3() { + super(); + } + + @Override + protected JavaTypeMappingDefinition getDelegate() { + return DELEGATE; + } + + @Override + public Iterable<String> getSupportingAnnotationNames() { + return COMBINED_SUPPORTING_ANNOTATION_NAMES; + } + + @SuppressWarnings("unchecked") + private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>( + DELEGATE.getSupportingAnnotationNames(), + EclipseLinkJavaEntityDefinition2_3.ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES + ); +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/EclipseLinkMultitenantAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/EclipseLinkMultitenantAnnotationDefinition.java new file mode 100644 index 0000000000..08d5e924ff --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/EclipseLinkMultitenantAnnotationDefinition.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.internal.v2_3.resource.java; + +import org.eclipse.jdt.core.IAnnotation; +import org.eclipse.jpt.common.core.resource.java.Annotation; +import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition; +import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.resource.java.binary.BinaryEclipseLinkMultitenantAnnotation; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.resource.java.source.SourceEclipseLinkMultitenantAnnotation; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLinkMultitenantAnnotation; + +public class EclipseLinkMultitenantAnnotationDefinition + implements AnnotationDefinition +{ + // singleton + private static final AnnotationDefinition INSTANCE + = new EclipseLinkMultitenantAnnotationDefinition(); + + + /** + * Return the singleton + */ + public static AnnotationDefinition instance() { + return INSTANCE; + } + + + /** + * Enforce singleton usage + */ + private EclipseLinkMultitenantAnnotationDefinition() { + super(); + } + + + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceEclipseLinkMultitenantAnnotation(parent, annotatedElement); + } + + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { + throw new UnsupportedOperationException(); + } + + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { + return new BinaryEclipseLinkMultitenantAnnotation(parent, jdtAnnotation); + } + + public String getAnnotationName() { + return EclipseLinkMultitenantAnnotation.ANNOTATION_NAME; + } +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotationDefinition.java new file mode 100644 index 0000000000..ccf019f87d --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotationDefinition.java @@ -0,0 +1,65 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.internal.v2_3.resource.java; + +import org.eclipse.jdt.core.IAnnotation; +import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.common.core.resource.java.NestableAnnotation; +import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition; +import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.resource.java.binary.BinaryEclipseLinkTenantDiscriminatorColumnAnnotation; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.resource.java.source.SourceEclipseLinkTenantDiscriminatorColumnAnnotation; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLink2_3; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation; + +public class EclipseLinkTenantDiscriminatorColumnAnnotationDefinition + implements NestableAnnotationDefinition +{ + // singleton + private static final NestableAnnotationDefinition INSTANCE + = new EclipseLinkTenantDiscriminatorColumnAnnotationDefinition(); + + + /** + * Return the singleton + */ + public static NestableAnnotationDefinition instance() { + return INSTANCE; + } + + + /** + * Enforce singleton usage + */ + private EclipseLinkTenantDiscriminatorColumnAnnotationDefinition() { + super(); + } + + public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) { + return SourceEclipseLinkTenantDiscriminatorColumnAnnotation.buildSourceTenantDiscriminatorColumnAnnotation(parent, annotatedElement, index); + } + + public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) { + return new BinaryEclipseLinkTenantDiscriminatorColumnAnnotation(parent, jdtAnnotation); + } + + public String getNestableAnnotationName() { + return EclipseLinkTenantDiscriminatorColumnAnnotation.ANNOTATION_NAME; + } + + public String getContainerAnnotationName() { + return EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMNS; + } + + public String getElementName() { + return EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMNS__VALUE; + } +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnsAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnsAnnotationDefinition.java new file mode 100644 index 0000000000..e2777a4251 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnsAnnotationDefinition.java @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.internal.v2_3.resource.java; + +import org.eclipse.jdt.core.IAnnotation; +import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation; +import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation; +import org.eclipse.jpt.common.core.resource.java.Annotation; +import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition; +import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLink2_3; + +public final class EclipseLinkTenantDiscriminatorColumnsAnnotationDefinition + implements AnnotationDefinition +{ + // singleton + private static final AnnotationDefinition INSTANCE = new EclipseLinkTenantDiscriminatorColumnsAnnotationDefinition(); + + /** + * Return the singleton. + */ + public static AnnotationDefinition instance() { + return INSTANCE; + } + + /** + * Ensure single instance. + */ + private EclipseLinkTenantDiscriminatorColumnsAnnotationDefinition() { + super(); + } + + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) { + return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName()); + } + + public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) { + throw new UnsupportedOperationException(); + } + + public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { + return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName()); + } + + public String getAnnotationName() { + return EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMNS; + } + +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/binary/BinaryEclipseLinkMultitenantAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/binary/BinaryEclipseLinkMultitenantAnnotation.java new file mode 100644 index 0000000000..3730953a1f --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/binary/BinaryEclipseLinkMultitenantAnnotation.java @@ -0,0 +1,73 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.internal.v2_3.resource.java.binary; + +import org.eclipse.jdt.core.IAnnotation; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation; +import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLinkMultitenantAnnotation; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.MultitenantType; + +/** + * org.eclipse.persistence.annotations.Multitenant + */ +public class BinaryEclipseLinkMultitenantAnnotation + extends BinaryAnnotation + implements EclipseLinkMultitenantAnnotation +{ + private MultitenantType value; + + + public BinaryEclipseLinkMultitenantAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { + super(parent, jdtAnnotation); + this.value = this.buildValue(); + } + + public String getAnnotationName() { + return ANNOTATION_NAME; + } + + @Override + public void update() { + super.update(); + this.setValue_(this.buildValue()); + } + + + // ********** EclipseLinkMultitenantAnnotation implementation ********** + + // ***** value + public MultitenantType getValue() { + return this.value; + } + + public void setValue(MultitenantType value) { + throw new UnsupportedOperationException(); + } + + private void setValue_(MultitenantType value) { + MultitenantType old = this.value; + this.value = value; + this.firePropertyChanged(VALUE_PROPERTY, old, value); + } + + private MultitenantType buildValue() { + return MultitenantType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.JOIN_FETCH__VALUE)); + } + + public TextRange getValueTextRange(CompilationUnit astRoot) { + throw new UnsupportedOperationException(); + } + +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/binary/BinaryEclipseLinkTenantDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/binary/BinaryEclipseLinkTenantDiscriminatorColumnAnnotation.java new file mode 100644 index 0000000000..7913190259 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/binary/BinaryEclipseLinkTenantDiscriminatorColumnAnnotation.java @@ -0,0 +1,151 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.internal.v2_3.resource.java.binary; + +import org.eclipse.jdt.core.IAnnotation; +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryBaseDiscriminatorColumnAnnotation; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLink2_3; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation; + +/** + * org.eclipse.persistence.annotations.TenantDiscriminatorColumn + */ +public class BinaryEclipseLinkTenantDiscriminatorColumnAnnotation + extends BinaryBaseDiscriminatorColumnAnnotation + implements EclipseLinkTenantDiscriminatorColumnAnnotation +{ + private String contextProperty; + private String table; + private Boolean primaryKey; + + public BinaryEclipseLinkTenantDiscriminatorColumnAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) { + super(parent, jdtAnnotation); + this.contextProperty = this.buildContextProperty(); + this.table = this.buildTable(); + this.primaryKey = this.buildPrimaryKey(); + } + + public String getAnnotationName() { + return EclipseLinkTenantDiscriminatorColumnAnnotation.ANNOTATION_NAME; + } + + @Override + public void update() { + super.update(); + this.setContextProperty_(this.buildContextProperty()); + this.setTable_(this.buildTable()); + this.setPrimaryKey_(this.buildPrimaryKey()); + } + + // ********** BinaryBaseDiscriminatorColumnAnnotation implementation ********** + + @Override + protected String getDiscriminatorTypeElementName() { + return EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; + } + + @Override + protected String getLengthElementName() { + return EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__LENGTH; + } + + // ********** BinaryNamedColumnAnnotation implementation ********** + + @Override + protected String getNameElementName() { + return EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__NAME; + } + + @Override + protected String getColumnDefinitionElementName() { + return EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION; + } + + + //************* EclipseLinkTenantDiscriminatorColumnAnnotation implementation ************* + + // ***** contextProperty + public String getContextProperty() { + return this.contextProperty; + } + + public void setContextProperty(String contextProperty) { + throw new UnsupportedOperationException(); + } + + private void setContextProperty_(String contextProperty) { + String old = this.contextProperty; + this.contextProperty = contextProperty; + this.firePropertyChanged(CONTEXT_PROPERTY_PROPERTY, old, contextProperty); + } + + private String buildContextProperty() { + return (String) this.getJdtMemberValue(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY); + } + + public TextRange getContextPropertyTextRange(CompilationUnit astRoot) { + throw new UnsupportedOperationException(); + } + + // ***** table + public String getTable() { + return this.table; + } + + public void setTable(String table) { + throw new UnsupportedOperationException(); + } + + private void setTable_(String table) { + String old = this.table; + this.table = table; + this.firePropertyChanged(TABLE_PROPERTY, old, table); + } + + private String buildTable() { + return (String) this.getJdtMemberValue(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__TABLE); + } + + public TextRange getTableTextRange(CompilationUnit astRoot) { + throw new UnsupportedOperationException(); + } + + public boolean tableTouches(int pos, CompilationUnit astRoot) { + throw new UnsupportedOperationException(); + } + + // ***** primaryKey + public Boolean getPrimaryKey() { + return this.primaryKey; + } + + public void setPrimaryKey(Boolean primaryKey) { + throw new UnsupportedOperationException(); + } + + private void setPrimaryKey_(Boolean primaryKey) { + Boolean old = this.primaryKey; + this.primaryKey = primaryKey; + this.firePropertyChanged(PRIMARY_KEY_PROPERTY, old, primaryKey); + } + + private Boolean buildPrimaryKey() { + return (Boolean) this.getJdtMemberValue(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY); + } + + public TextRange getPrimaryKeyTextRange(CompilationUnit astRoot) { + throw new UnsupportedOperationException(); + } + +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/source/SourceEclipseLinkMultitenantAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/source/SourceEclipseLinkMultitenantAnnotation.java new file mode 100644 index 0000000000..2f0751284f --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/source/SourceEclipseLinkMultitenantAnnotation.java @@ -0,0 +1,106 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.internal.v2_3.resource.java.source; + +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation; +import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter; +import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter; +import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; +import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; +import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter; +import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter; +import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLinkMultitenantAnnotation; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.MultitenantType; + +/** + * org.eclipse.persistence.annotations.Multitenant + */ +public class SourceEclipseLinkMultitenantAnnotation + extends SourceAnnotation + implements EclipseLinkMultitenantAnnotation +{ + private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER + = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME); + + private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter(); + private final AnnotationElementAdapter<String> valueAdapter; + private MultitenantType value; + + public SourceEclipseLinkMultitenantAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) { + super(parent, element, DECLARATION_ANNOTATION_ADAPTER); + this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER); + } + + + public String getAnnotationName() { + return ANNOTATION_NAME; + } + + public void initialize(CompilationUnit astRoot) { + this.value = this.buildValue(astRoot); + } + + public void synchronizeWith(CompilationUnit astRoot) { + this.syncValue(this.buildValue(astRoot)); + } + + @Override + public boolean isUnset() { + return super.isUnset() && + (this.value == null); + } + + @Override + public void toString(StringBuilder sb) { + sb.append(this.value); + } + + // ********** MultitenantAnnotation implementation ********** + + // ***** value + public MultitenantType getValue() { + return this.value; + } + + public void setValue(MultitenantType value) { + if (this.attributeValueHasChanged(this.value, value)) { + this.value = value; + this.valueAdapter.setValue(MultitenantType.toJavaAnnotationValue(value)); + } + } + + private void syncValue(MultitenantType astValue) { + MultitenantType old = this.value; + this.value = astValue; + this.firePropertyChanged(VALUE_PROPERTY, old, astValue); + } + + private MultitenantType buildValue(CompilationUnit astRoot) { + return MultitenantType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot)); + } + + public TextRange getValueTextRange(CompilationUnit astRoot) { + return this.getElementTextRange(VALUE_ADAPTER, astRoot); + } + + + // ********** static methods ********** + + private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() { + return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.JOIN_FETCH__VALUE); + } + +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/source/SourceEclipseLinkTenantDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/source/SourceEclipseLinkTenantDiscriminatorColumnAnnotation.java new file mode 100644 index 0000000000..ac4a0bc424 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/v2_3/resource/java/source/SourceEclipseLinkTenantDiscriminatorColumnAnnotation.java @@ -0,0 +1,282 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.internal.v2_3.resource.java.source; + +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter; +import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter; +import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter; +import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter; +import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement; +import org.eclipse.jpt.common.core.resource.java.JavaResourceNode; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; +import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter; +import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter; +import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; +import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter; +import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter; +import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter; +import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceBaseDiscriminatorColumnAnnotation; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLink2_3; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation; + +/** + * org.eclipse.persistence.annotations.TenantDiscriminatorColumn + */ +public class SourceEclipseLinkTenantDiscriminatorColumnAnnotation + extends SourceBaseDiscriminatorColumnAnnotation + implements EclipseLinkTenantDiscriminatorColumnAnnotation +{ + private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLinkTenantDiscriminatorColumnAnnotation.ANNOTATION_NAME); + private static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMNS); + + protected DeclarationAnnotationElementAdapter<String> contextPropertyDeclarationAdapter; + protected AnnotationElementAdapter<String> contextPropertyAdapter; + protected String contextProperty; + + protected DeclarationAnnotationElementAdapter<String> tableDeclarationAdapter; + protected AnnotationElementAdapter<String> tableAdapter; + protected String table; + + protected DeclarationAnnotationElementAdapter<Boolean> primaryKeyDeclarationAdapter; + protected AnnotationElementAdapter<Boolean> primaryKeyAdapter; + protected Boolean primaryKey; + + public static SourceEclipseLinkTenantDiscriminatorColumnAnnotation buildSourceTenantDiscriminatorColumnAnnotation( + JavaResourceNode parent, + AnnotatedElement element) { + + return new SourceEclipseLinkTenantDiscriminatorColumnAnnotation(parent, element, DECLARATION_ANNOTATION_ADAPTER); + } + + public static SourceEclipseLinkTenantDiscriminatorColumnAnnotation buildSourceTenantDiscriminatorColumnAnnotation( + JavaResourceAnnotatedElement parent, + AnnotatedElement annotatedElement, + int index) { + IndexedDeclarationAnnotationAdapter idaa = buildTenantDiscriminatorColumnDeclarationAnnotationAdapter(index); + IndexedAnnotationAdapter iaa = buildTenantDiscriminatorColumnAnnotationAdapter(annotatedElement, idaa); + return new SourceEclipseLinkTenantDiscriminatorColumnAnnotation( + parent, + annotatedElement, + idaa, + iaa); + } + + + public static SourceEclipseLinkTenantDiscriminatorColumnAnnotation buildNestedSourceTenantDiscriminatorColumnAnnotation( + JavaResourceNode parent, + AnnotatedElement element, + IndexedDeclarationAnnotationAdapter idaa) { + + return new SourceEclipseLinkTenantDiscriminatorColumnAnnotation(parent, element, idaa); + } + + private SourceEclipseLinkTenantDiscriminatorColumnAnnotation(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) { + this(parent, element, daa, new ElementAnnotationAdapter(element, daa)); + } + + private SourceEclipseLinkTenantDiscriminatorColumnAnnotation(JavaResourceNode parent, AnnotatedElement element, IndexedDeclarationAnnotationAdapter idaa) { + this(parent, element, idaa, new ElementIndexedAnnotationAdapter(element, idaa)); + } + + private SourceEclipseLinkTenantDiscriminatorColumnAnnotation(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) { + super(parent, element, daa, annotationAdapter); + this.contextPropertyDeclarationAdapter = this.buildContextPropertyDeclarationAdapter(); + this.contextPropertyAdapter = this.buildContextPropertyAdapter(); + this.tableDeclarationAdapter = this.buildTableDeclarationAdapter(); + this.tableAdapter = this.buildTableAdapter(); + this.primaryKeyDeclarationAdapter = this.buildPrimaryKeyDeclarationAdapter(); + this.primaryKeyAdapter = this.buildPrimaryKeyAdapter(); + } + + @Override + public void initialize(CompilationUnit astRoot) { + super.initialize(astRoot); + this.contextProperty = this.buildContextProperty(astRoot); + this.table = this.buildTable(astRoot); + this.primaryKey = this.buildPrimaryKey(astRoot); + } + + @Override + public void synchronizeWith(CompilationUnit astRoot) { + super.synchronizeWith(astRoot); + this.syncContextProperty(this.buildContextProperty(astRoot)); + this.syncTable(this.buildTable(astRoot)); + this.syncPrimaryKey(this.buildPrimaryKey(astRoot)); + } + + public String getAnnotationName() { + return EclipseLinkTenantDiscriminatorColumnAnnotation.ANNOTATION_NAME; + } + + + // ********** SourceNamedColumnAnnotation implementation ********** + + @Override + protected String getNameElementName() { + return EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__NAME; + } + + @Override + protected String getColumnDefinitionElementName() { + return EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION; + } + + + //************* SourceBaseDiscriminatorColumnAnnotation implementation ************* + + @Override + protected String getDiscriminatorTypeElementName() { + return EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; + } + + @Override + protected String getLengthElementName() { + return EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__LENGTH; + } + + + //************* TenantDiscriminatorColumnAnnotation implementation ************* + + // ***** contextProperty + public String getContextProperty() { + return this.contextProperty; + } + + public void setContextProperty(String contextProperty) { + if (this.attributeValueHasChanged(this.contextProperty, contextProperty)) { + this.contextProperty = contextProperty; + this.contextPropertyAdapter.setValue(contextProperty); + } + } + + private void syncContextProperty(String astContextProperty) { + String old = this.contextProperty; + this.contextProperty = astContextProperty; + this.firePropertyChanged(CONTEXT_PROPERTY_PROPERTY, old, astContextProperty); + } + + private String buildContextProperty(CompilationUnit astRoot) { + return this.contextPropertyAdapter.getValue(astRoot); + } + + public TextRange getContextPropertyTextRange(CompilationUnit astRoot) { + return this.getElementTextRange(this.contextPropertyDeclarationAdapter, astRoot); + } + + private DeclarationAnnotationElementAdapter<String> buildContextPropertyDeclarationAdapter() { + return this.buildStringElementAdapter(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY); + } + + private AnnotationElementAdapter<String> buildContextPropertyAdapter() { + return this.buildStringElementAdapter(this.contextPropertyDeclarationAdapter); + } + + // ***** table + public String getTable() { + return this.table; + } + + public void setTable(String table) { + if (this.attributeValueHasChanged(this.table, table)) { + this.table = table; + this.tableAdapter.setValue(table); + } + } + + private void syncTable(String astTable) { + String old = this.table; + this.table = astTable; + this.firePropertyChanged(TABLE_PROPERTY, old, astTable); + } + + private String buildTable(CompilationUnit astRoot) { + return this.tableAdapter.getValue(astRoot); + } + + public TextRange getTableTextRange(CompilationUnit astRoot) { + return this.getElementTextRange(this.tableDeclarationAdapter, astRoot); + } + + public boolean tableTouches(int pos, CompilationUnit astRoot) { + return this.elementTouches(this.tableDeclarationAdapter, pos, astRoot); + } + + private DeclarationAnnotationElementAdapter<String> buildTableDeclarationAdapter() { + return this.buildStringElementAdapter(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__TABLE); + } + + private AnnotationElementAdapter<String> buildTableAdapter() { + return this.buildStringElementAdapter(this.tableDeclarationAdapter); + } + + // ***** primaryKey + public Boolean getPrimaryKey() { + return this.primaryKey; + } + + public void setPrimaryKey(Boolean primaryKey) { + if (this.attributeValueHasChanged(this.primaryKey, primaryKey)) { + this.primaryKey = primaryKey; + this.primaryKeyAdapter.setValue(primaryKey); + } + } + + private void syncPrimaryKey(Boolean astPrimaryKey) { + Boolean old = this.primaryKey; + this.primaryKey = astPrimaryKey; + this.firePropertyChanged(PRIMARY_KEY_PROPERTY, old, astPrimaryKey); + } + + private Boolean buildPrimaryKey(CompilationUnit astRoot) { + return this.primaryKeyAdapter.getValue(astRoot); + } + + public TextRange getPrimaryKeyTextRange(CompilationUnit astRoot) { + return this.getElementTextRange(this.primaryKeyDeclarationAdapter, astRoot); + } + + private DeclarationAnnotationElementAdapter<Boolean> buildPrimaryKeyDeclarationAdapter() { + return this.buildBooleanElementAdapter(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY); + } + + private AnnotationElementAdapter<Boolean> buildPrimaryKeyAdapter() { + return this.buildBooleanElementAdapter(this.primaryKeyDeclarationAdapter); + } + + + // ********** misc ********** + + @Override + public boolean isUnset() { + return super.isUnset() && + (this.contextProperty == null) && + (this.primaryKey == null) && + (this.table == null); + } + + // ********** static methods ********** + + private static IndexedAnnotationAdapter buildTenantDiscriminatorColumnAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) { + return new ElementIndexedAnnotationAdapter(annotatedElement, idaa); + } + + private static IndexedDeclarationAnnotationAdapter buildTenantDiscriminatorColumnDeclarationAnnotationAdapter(int index) { + IndexedDeclarationAnnotationAdapter idaa = + new CombinationIndexedDeclarationAnnotationAdapter( + DECLARATION_ANNOTATION_ADAPTER, + CONTAINER_DECLARATION_ANNOTATION_ADAPTER, + index, + EclipseLinkTenantDiscriminatorColumnAnnotation.ANNOTATION_NAME); + return idaa; + } +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java index e992ccc54e..7bfa6fcf4d 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java @@ -4736,6 +4736,14 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_MULTITENANT__TYPE = EclipseLinkOrmV2_3Package.XML_MULTITENANT_23__TYPE; /** + * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS = EclipseLinkOrmV2_3Package.XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS; + /** * The number of structural features of the '<em>Xml Multitenant</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -6485,6 +6493,14 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_TENANT_DISCRIMINATOR_COLUMN = 78; /** + * The feature id for the '<em><b>Column Definition</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__COLUMN_DEFINITION; + /** * The feature id for the '<em><b>Name</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -6493,6 +6509,46 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_TENANT_DISCRIMINATOR_COLUMN__NAME = EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__NAME; /** + * The feature id for the '<em><b>Discriminator Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__DISCRIMINATOR_TYPE; + /** + * The feature id for the '<em><b>Length</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN__LENGTH = EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__LENGTH; + /** + * The feature id for the '<em><b>Context Property</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY = EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY; + /** + * The feature id for the '<em><b>Table</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN__TABLE = EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE; + /** + * The feature id for the '<em><b>Primary Key</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY = EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY; + /** * The number of structural features of the '<em>Xml Tenant Discriminator Column</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java index 3a8654af68..8496e8717b 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java @@ -9,16 +9,23 @@ *******************************************************************************/ package org.eclipse.jpt.jpa.eclipselink.core.resource.orm; +import java.util.Collection; 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.impl.ENotificationImpl; import org.eclipse.emf.ecore.EStructuralFeature; - +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.common.core.internal.utility.translators.SimpleTranslator; import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject; - +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3; +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenantType; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3; +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3; import org.eclipse.wst.common.internal.emf.resource.Translator; /** @@ -53,6 +60,16 @@ public class XmlMultitenant extends AbstractJpaEObject implements XmlMultitenant protected XmlMultitenantType type = TYPE_EDEFAULT; /** + * The cached value of the '{@link #getTenantDiscriminatorColumns() <em>Tenant Discriminator Columns</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getTenantDiscriminatorColumns() + * @generated + * @ordered + */ + protected EList<XmlTenantDiscriminatorColumn_2_3> tenantDiscriminatorColumns; + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -112,6 +129,45 @@ public class XmlMultitenant extends AbstractJpaEObject implements XmlMultitenant } /** + * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list. + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant_2_3_TenantDiscriminatorColumns() + * @model containment="true" + * @generated + */ + public EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns() + { + if (tenantDiscriminatorColumns == null) + { + tenantDiscriminatorColumns = new EObjectContainmentEList<XmlTenantDiscriminatorColumn_2_3>(XmlTenantDiscriminatorColumn_2_3.class, this, EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS); + } + return tenantDiscriminatorColumns; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS: + return ((InternalEList<?>)getTenantDiscriminatorColumns()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -123,6 +179,8 @@ public class XmlMultitenant extends AbstractJpaEObject implements XmlMultitenant { case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE: return getType(); + case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS: + return getTenantDiscriminatorColumns(); } return super.eGet(featureID, resolve, coreType); } @@ -132,6 +190,7 @@ public class XmlMultitenant extends AbstractJpaEObject implements XmlMultitenant * <!-- end-user-doc --> * @generated */ + @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { @@ -140,6 +199,10 @@ public class XmlMultitenant extends AbstractJpaEObject implements XmlMultitenant case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE: setType((XmlMultitenantType)newValue); return; + case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS: + getTenantDiscriminatorColumns().clear(); + getTenantDiscriminatorColumns().addAll((Collection<? extends XmlTenantDiscriminatorColumn_2_3>)newValue); + return; } super.eSet(featureID, newValue); } @@ -157,6 +220,9 @@ public class XmlMultitenant extends AbstractJpaEObject implements XmlMultitenant case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE: setType(TYPE_EDEFAULT); return; + case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS: + getTenantDiscriminatorColumns().clear(); + return; } super.eUnset(featureID); } @@ -173,6 +239,8 @@ public class XmlMultitenant extends AbstractJpaEObject implements XmlMultitenant { case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE: return type != TYPE_EDEFAULT; + case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS: + return tenantDiscriminatorColumns != null && !tenantDiscriminatorColumns.isEmpty(); } return super.eIsSet(featureID); } @@ -206,6 +274,17 @@ public class XmlMultitenant extends AbstractJpaEObject implements XmlMultitenant private static Translator[] buildTranslatorChildren() { return new Translator[] { + buildTypeTranslator(), + buildTenantDiscriminatorColumnsTranslator() }; } + + protected static Translator buildTypeTranslator() { + return new Translator(EclipseLink2_3.MULTITENANT__TYPE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMultitenant_2_3_Type()); + } + + protected static Translator buildTenantDiscriminatorColumnsTranslator() { + return XmlTenantDiscriminatorColumn.buildTranslator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMultitenant_2_3_TenantDiscriminatorColumns()); + } + } // XmlMultitenant diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java index 9588a15cca..a52f42faef 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java @@ -355,7 +355,7 @@ public class XmlPersistenceUnitDefaults extends org.eclipse.jpt.jpa.core.resourc buildAccessTranslator(), buildAccessMethodsTranslator(), buildCascadePersistTranslator(), - XmlTenantDiscriminatorColumn.buildTranslator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns()), + buildTenantDiscriminatorColumnsTranslator(), buildEntityListenersTranslator() }; } @@ -364,4 +364,7 @@ public class XmlPersistenceUnitDefaults extends org.eclipse.jpt.jpa.core.resourc return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods()); } + protected static Translator buildTenantDiscriminatorColumnsTranslator() { + return XmlTenantDiscriminatorColumn.buildTranslator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns()); + } } // XmlPersistenceUnitDefaults diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java index 56bf34a6c6..6cfa8cd22a 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java @@ -11,12 +11,10 @@ package org.eclipse.jpt.jpa.eclipselink.core.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.emf.ecore.EStructuralFeature; - +import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator; -import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject; - +import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlDiscriminatorColumn; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3; @@ -32,26 +30,63 @@ import org.eclipse.wst.common.internal.emf.resource.Translator; * @model kind="class" * @generated */ -public class XmlTenantDiscriminatorColumn extends AbstractJpaEObject implements XmlTenantDiscriminatorColumn_2_3 +public class XmlTenantDiscriminatorColumn extends AbstractXmlDiscriminatorColumn implements XmlTenantDiscriminatorColumn_2_3 { /** - * The default value of the '{@link #getName() <em>Name</em>}' attribute. + * The default value of the '{@link #getContextProperty() <em>Context Property</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getName() + * @see #getContextProperty() * @generated * @ordered */ - protected static final String NAME_EDEFAULT = null; + protected static final String CONTEXT_PROPERTY_EDEFAULT = null; /** - * The cached value of the '{@link #getName() <em>Name</em>}' attribute. + * The cached value of the '{@link #getContextProperty() <em>Context Property</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getName() + * @see #getContextProperty() * @generated * @ordered */ - protected String name = NAME_EDEFAULT; + protected String contextProperty = CONTEXT_PROPERTY_EDEFAULT; + + /** + * The default value of the '{@link #getTable() <em>Table</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getTable() + * @generated + * @ordered + */ + protected static final String TABLE_EDEFAULT = null; + /** + * The cached value of the '{@link #getTable() <em>Table</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getTable() + * @generated + * @ordered + */ + protected String table = TABLE_EDEFAULT; + /** + * The default value of the '{@link #getPrimaryKey() <em>Primary Key</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getPrimaryKey() + * @generated + * @ordered + */ + protected static final Boolean PRIMARY_KEY_EDEFAULT = null; + /** + * The cached value of the '{@link #getPrimaryKey() <em>Primary Key</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getPrimaryKey() + * @generated + * @ordered + */ + protected Boolean primaryKey = PRIMARY_KEY_EDEFAULT; /** * <!-- begin-user-doc --> @@ -74,38 +109,108 @@ public class XmlTenantDiscriminatorColumn extends AbstractJpaEObject implements return EclipseLinkOrmPackage.Literals.XML_TENANT_DISCRIMINATOR_COLUMN; } /** - * Returns the value of the '<em><b>Name</b></em>' attribute. + * Returns the value of the '<em><b>Context Property</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Context Property</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Context Property</em>' attribute. + * @see #setContextProperty(String) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn_2_3_ContextProperty() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * @generated + */ + public String getContextProperty() + { + return contextProperty; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn#getContextProperty <em>Context Property</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Context Property</em>' attribute. + * @see #getContextProperty() + * @generated + */ + public void setContextProperty(String newContextProperty) + { + String oldContextProperty = contextProperty; + contextProperty = newContextProperty; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY, oldContextProperty, contextProperty)); + } + + /** + * Returns the value of the '<em><b>Table</b></em>' attribute. * <!-- begin-user-doc --> * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, + * If the meaning of the '<em>Table</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.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn_2_3_Name() + * @return the value of the '<em>Table</em>' attribute. + * @see #setTable(String) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn_2_3_Table() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ - public String getName() + public String getTable() { - return name; + return table; } /** - * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn#getName <em>Name</em>}' attribute. + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn#getTable <em>Table</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() + * @param value the new value of the '<em>Table</em>' attribute. + * @see #getTable() * @generated */ - public void setName(String newName) + public void setTable(String newTable) { - String oldName = name; - name = newName; + String oldTable = table; + table = newTable; if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__NAME, oldName, name)); + eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE, oldTable, table)); + } + + /** + * Returns the value of the '<em><b>Primary Key</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Primary Key</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Primary Key</em>' attribute. + * @see #setPrimaryKey(Boolean) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn_2_3_PrimaryKey() + * @model + * @generated + */ + public Boolean getPrimaryKey() + { + return primaryKey; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn#getPrimaryKey <em>Primary Key</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Primary Key</em>' attribute. + * @see #getPrimaryKey() + * @generated + */ + public void setPrimaryKey(Boolean newPrimaryKey) + { + Boolean oldPrimaryKey = primaryKey; + primaryKey = newPrimaryKey; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY, oldPrimaryKey, primaryKey)); } /** @@ -118,8 +223,12 @@ public class XmlTenantDiscriminatorColumn extends AbstractJpaEObject implements { switch (featureID) { - case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__NAME: - return getName(); + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY: + return getContextProperty(); + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE: + return getTable(); + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY: + return getPrimaryKey(); } return super.eGet(featureID, resolve, coreType); } @@ -134,8 +243,14 @@ public class XmlTenantDiscriminatorColumn extends AbstractJpaEObject implements { switch (featureID) { - case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__NAME: - setName((String)newValue); + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY: + setContextProperty((String)newValue); + return; + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE: + setTable((String)newValue); + return; + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY: + setPrimaryKey((Boolean)newValue); return; } super.eSet(featureID, newValue); @@ -151,8 +266,14 @@ public class XmlTenantDiscriminatorColumn extends AbstractJpaEObject implements { switch (featureID) { - case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__NAME: - setName(NAME_EDEFAULT); + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY: + setContextProperty(CONTEXT_PROPERTY_EDEFAULT); + return; + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE: + setTable(TABLE_EDEFAULT); + return; + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY: + setPrimaryKey(PRIMARY_KEY_EDEFAULT); return; } super.eUnset(featureID); @@ -168,8 +289,12 @@ public class XmlTenantDiscriminatorColumn extends AbstractJpaEObject implements { switch (featureID) { - case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY: + return CONTEXT_PROPERTY_EDEFAULT == null ? contextProperty != null : !CONTEXT_PROPERTY_EDEFAULT.equals(contextProperty); + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE: + return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table); + case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY: + return PRIMARY_KEY_EDEFAULT == null ? primaryKey != null : !PRIMARY_KEY_EDEFAULT.equals(primaryKey); } return super.eIsSet(featureID); } @@ -185,8 +310,12 @@ public class XmlTenantDiscriminatorColumn extends AbstractJpaEObject implements if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); + result.append(" (contextProperty: "); + result.append(contextProperty); + result.append(", table: "); + result.append(table); + result.append(", primaryKey: "); + result.append(primaryKey); result.append(')'); return result.toString(); } @@ -204,10 +333,24 @@ public class XmlTenantDiscriminatorColumn extends AbstractJpaEObject implements private static Translator[] buildTranslatorChildren() { return new Translator[] { buildNameTranslator(), + buildContextPropertyTranslator(), + buildDiscrminiatorTypeTranslator(), + buildColumnDefinitionTranslator(), + buildLengthTranslator(), + buildTableTranslator(), + buildPrimaryKeyTranslator() }; } - protected static Translator buildNameTranslator() { - return new Translator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_Name(), Translator.DOM_ATTRIBUTE); + protected static Translator buildContextPropertyTranslator() { + return new Translator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_ContextProperty(), Translator.DOM_ATTRIBUTE); + } + + protected static Translator buildTableTranslator() { + return new Translator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__TABLE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_Table(), Translator.DOM_ATTRIBUTE); + } + + protected static Translator buildPrimaryKeyTranslator() { + return new Translator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_PrimaryKey(), Translator.DOM_ATTRIBUTE); } } // XmlTenantDiscriminator diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java index 9a373a47e7..94bca72457 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java @@ -28,6 +28,7 @@ public interface EclipseLink2_3 String MULTITENANT = "multitenant"; String MULTITENANT__TYPE = "type"; String MULTITENANT_TYPE = "multiltenant-type"; + String NAMED_STORED_FUNCTION_QUERY = "named-stored-function-query"; String NAMED_STORED_FUNCTION_QUERY__NAME = "nname"; String NAMED_PLSQL_STORED_PROCEDURE_QUERY = "named-plsql-stored-procedure-query"; @@ -41,8 +42,11 @@ public interface EclipseLink2_3 String STRUCT = "struct"; String STRUCT__NAME = "name"; String STRUCTURE = "structure"; + String TENANT_DISCRIMINATOR_COLUMN = "tenant-discriminator-column"; - String TENANT_DISCRIMINATOR_COLUMN__NAME = "name"; + String TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY = "contextProperty"; + String TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY= "primaryKey"; + String TENANT_DISCRIMINATOR_COLUMN__TABLE = "table"; }
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java index 9eff76397d..8a40b9df67 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java @@ -511,13 +511,22 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl public static final int XML_MULTITENANT_23__TYPE = 0; /** + * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS = 1; + + /** * The number of structural features of the '<em>Xml Multitenant 23</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MULTITENANT_23_FEATURE_COUNT = 1; + public static final int XML_MULTITENANT_23_FEATURE_COUNT = 2; /** * The feature id for the '<em><b>Name</b></em>' attribute. @@ -656,13 +665,67 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23 = 14; /** + * The feature id for the '<em><b>Column Definition</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__COLUMN_DEFINITION = OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION; + + /** * The feature id for the '<em><b>Name</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__NAME = 0; + public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__NAME = OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__NAME; + + /** + * The feature id for the '<em><b>Discriminator Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__DISCRIMINATOR_TYPE = OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE; + + /** + * The feature id for the '<em><b>Length</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__LENGTH = OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN__LENGTH; + + /** + * The feature id for the '<em><b>Context Property</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY = OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Table</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE = OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Primary Key</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY = OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 2; /** * The number of structural features of the '<em>Xml Tenant Discriminator Column 23</em>' class. @@ -671,7 +734,7 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl * @generated * @ordered */ - public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23_FEATURE_COUNT = 1; + public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 3; /** * The number of structural features of the '<em>Xml Structure 23</em>' class. @@ -1020,6 +1083,21 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl /** + * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Tenant Discriminator Columns</em>'. + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getTenantDiscriminatorColumns() + * @see #getXmlMultitenant_2_3() + * @generated + */ + public EReference getXmlMultitenant_2_3_TenantDiscriminatorColumns() + { + return (EReference)xmlMultitenant_2_3EClass.getEStructuralFeatures().get(1); + } + + + /** * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3 <em>Xml Named Plsql Stored Function Query 23</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -1560,21 +1638,51 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl /** - * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getName <em>Name</em>}'. + * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty <em>Context Property</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @return the meta object for the attribute '<em>Name</em>'. - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getName() + * @return the meta object for the attribute '<em>Context Property</em>'. + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty() * @see #getXmlTenantDiscriminatorColumn_2_3() * @generated */ - public EAttribute getXmlTenantDiscriminatorColumn_2_3_Name() + public EAttribute getXmlTenantDiscriminatorColumn_2_3_ContextProperty() { return (EAttribute)xmlTenantDiscriminatorColumn_2_3EClass.getEStructuralFeatures().get(0); } /** + * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable <em>Table</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Table</em>'. + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable() + * @see #getXmlTenantDiscriminatorColumn_2_3() + * @generated + */ + public EAttribute getXmlTenantDiscriminatorColumn_2_3_Table() + { + return (EAttribute)xmlTenantDiscriminatorColumn_2_3EClass.getEStructuralFeatures().get(1); + } + + + /** + * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey <em>Primary Key</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Primary Key</em>'. + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey() + * @see #getXmlTenantDiscriminatorColumn_2_3() + * @generated + */ + public EAttribute getXmlTenantDiscriminatorColumn_2_3_PrimaryKey() + { + return (EAttribute)xmlTenantDiscriminatorColumn_2_3EClass.getEStructuralFeatures().get(2); + } + + + /** * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3 <em>Xml Attributes 23</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -1759,6 +1867,7 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl xmlMultitenant_2_3EClass = createEClass(XML_MULTITENANT_23); createEAttribute(xmlMultitenant_2_3EClass, XML_MULTITENANT_23__TYPE); + createEReference(xmlMultitenant_2_3EClass, XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS); xmlNamedPlsqlStoredFunctionQuery_2_3EClass = createEClass(XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23); createEAttribute(xmlNamedPlsqlStoredFunctionQuery_2_3EClass, XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23__NAME); @@ -1782,7 +1891,9 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl createEAttribute(xmlStruct_2_3EClass, XML_STRUCT_23__NAME); xmlTenantDiscriminatorColumn_2_3EClass = createEClass(XML_TENANT_DISCRIMINATOR_COLUMN_23); - createEAttribute(xmlTenantDiscriminatorColumn_2_3EClass, XML_TENANT_DISCRIMINATOR_COLUMN_23__NAME); + createEAttribute(xmlTenantDiscriminatorColumn_2_3EClass, XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY); + createEAttribute(xmlTenantDiscriminatorColumn_2_3EClass, XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE); + createEAttribute(xmlTenantDiscriminatorColumn_2_3EClass, XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY); xmlStructure_2_3EClass = createEClass(XML_STRUCTURE_23); @@ -1820,12 +1931,14 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl // Obtain other dependent packages EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI); XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI); + OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI); // Create type parameters // Set bounds for type parameters // Add supertypes to classes + xmlTenantDiscriminatorColumn_2_3EClass.getESuperTypes().add(theOrmPackage.getAbstractXmlDiscriminatorColumn()); // Initialize classes and features; add operations and parameters initEClass(xmlArray_2_3EClass, XmlArray_2_3.class, "XmlArray_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -1866,6 +1979,7 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl initEClass(xmlMultitenant_2_3EClass, XmlMultitenant_2_3.class, "XmlMultitenant_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getXmlMultitenant_2_3_Type(), this.getXmlMultitenantType(), "type", null, 0, 1, XmlMultitenant_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getXmlMultitenant_2_3_TenantDiscriminatorColumns(), this.getXmlTenantDiscriminatorColumn_2_3(), null, "tenantDiscriminatorColumns", null, 0, -1, XmlMultitenant_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(xmlNamedPlsqlStoredFunctionQuery_2_3EClass, XmlNamedPlsqlStoredFunctionQuery_2_3.class, "XmlNamedPlsqlStoredFunctionQuery_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEAttribute(getXmlNamedPlsqlStoredFunctionQuery_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedPlsqlStoredFunctionQuery_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -1889,7 +2003,9 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl initEAttribute(getXmlStruct_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlStruct_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(xmlTenantDiscriminatorColumn_2_3EClass, XmlTenantDiscriminatorColumn_2_3.class, "XmlTenantDiscriminatorColumn_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getXmlTenantDiscriminatorColumn_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlTenantDiscriminatorColumn_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getXmlTenantDiscriminatorColumn_2_3_ContextProperty(), theXMLTypePackage.getString(), "contextProperty", null, 0, 1, XmlTenantDiscriminatorColumn_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getXmlTenantDiscriminatorColumn_2_3_Table(), theXMLTypePackage.getString(), "table", null, 0, 1, XmlTenantDiscriminatorColumn_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getXmlTenantDiscriminatorColumn_2_3_PrimaryKey(), ecorePackage.getEBooleanObject(), "primaryKey", null, 0, 1, XmlTenantDiscriminatorColumn_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(xmlStructure_2_3EClass, XmlStructure_2_3.class, "XmlStructure_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -1969,6 +2085,14 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl public static final EAttribute XML_MULTITENANT_23__TYPE = eINSTANCE.getXmlMultitenant_2_3_Type(); /** + * The meta object literal for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EReference XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS = eINSTANCE.getXmlMultitenant_2_3_TenantDiscriminatorColumns(); + + /** * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3 <em>Xml Named Plsql Stored Function Query 23</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -2287,12 +2411,28 @@ public class EclipseLinkOrmV2_3Package extends EPackageImpl public static final EClass XML_TENANT_DISCRIMINATOR_COLUMN_23 = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3(); /** - * The meta object literal for the '<em><b>Name</b></em>' attribute feature. + * The meta object literal for the '<em><b>Context Property</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EAttribute XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_ContextProperty(); + + /** + * The meta object literal for the '<em><b>Table</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EAttribute XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_Table(); + + /** + * The meta object literal for the '<em><b>Primary Key</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - public static final EAttribute XML_TENANT_DISCRIMINATOR_COLUMN_23__NAME = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_Name(); + public static final EAttribute XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_PrimaryKey(); /** * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3 <em>Xml Attributes 23</em>}' class. diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java index 7d10ffcdbe..10dab96854 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java @@ -9,6 +9,7 @@ *******************************************************************************/ package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3; +import org.eclipse.emf.common.util.EList; import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject; /** @@ -20,6 +21,7 @@ import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject; * The following features are supported: * <ul> * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getType <em>Type</em>}</li> + * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}</li> * </ul> * </p> * @@ -59,4 +61,20 @@ public interface XmlMultitenant_2_3 extends JpaEObject * @generated */ void setType(XmlMultitenantType value); + + /** + * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list. + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMultitenant_2_3_TenantDiscriminatorColumns() + * @model containment="true" + * @generated + */ + EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns(); } // XmlMultitenant_2_3 diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java index 2585c3fe81..8c8490f21b 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java @@ -9,7 +9,6 @@ *******************************************************************************/ package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3; -import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject; /** * <!-- begin-user-doc --> @@ -19,41 +18,94 @@ import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject; * <p> * The following features are supported: * <ul> - * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getName <em>Name</em>}</li> + * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty <em>Context Property</em>}</li> + * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable <em>Table</em>}</li> + * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey <em>Primary Key</em>}</li> * </ul> * </p> * * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3() * @model kind="class" interface="true" abstract="true" - * @extends JpaEObject * @generated */ -public interface XmlTenantDiscriminatorColumn_2_3 extends JpaEObject +public interface XmlTenantDiscriminatorColumn_2_3 { /** - * Returns the value of the '<em><b>Name</b></em>' attribute. + * Returns the value of the '<em><b>Context Property</b></em>' attribute. * <!-- begin-user-doc --> * <p> - * If the meaning of the '<em>Name</em>' attribute isn't clear, + * If the meaning of the '<em>Context Property</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.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3_Name() + * @return the value of the '<em>Context Property</em>' attribute. + * @see #setContextProperty(String) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3_ContextProperty() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ - String getName(); + String getContextProperty(); /** - * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getName <em>Name</em>}' attribute. + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty <em>Context Property</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @param value the new value of the '<em>Name</em>' attribute. - * @see #getName() + * @param value the new value of the '<em>Context Property</em>' attribute. + * @see #getContextProperty() * @generated */ - void setName(String value); + void setContextProperty(String value); + + /** + * Returns the value of the '<em><b>Table</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Table</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Table</em>' attribute. + * @see #setTable(String) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3_Table() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * @generated + */ + String getTable(); + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable <em>Table</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Table</em>' attribute. + * @see #getTable() + * @generated + */ + void setTable(String value); + + /** + * Returns the value of the '<em><b>Primary Key</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Primary Key</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Primary Key</em>' attribute. + * @see #setPrimaryKey(Boolean) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3_PrimaryKey() + * @model + * @generated + */ + Boolean getPrimaryKey(); + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey <em>Primary Key</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Primary Key</em>' attribute. + * @see #getPrimaryKey() + * @generated + */ + void setPrimaryKey(Boolean value); } // XmlTenantDiscriminator2_3 diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/EclipseLink2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/EclipseLink2_3.java new file mode 100644 index 0000000000..0775da406f --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/EclipseLink2_3.java @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.v2_3.resource.java; + +/** + * EclipseLink Java-related stuff (annotations etc.) + * + * 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. + * + * @version 3.1 + * @since 3.1 + */ +@SuppressWarnings("nls") +public interface EclipseLink2_3 { + + // EclipseLink package + String PACKAGE = "org.eclipse.persistence.annotations"; //$NON-NLS-1$ + String PACKAGE_ = PACKAGE + "."; + + + // ********** API ********** + + // EclispeLink 2.3 annotations + String MULTITENANT = PACKAGE_ + "Multitenant"; + String CLASS_EXTRACTOR__VALUE = "value"; + + String MULTITENANT_TYPE = PACKAGE_ + "MultitenantType"; + String MULTITENANT_TYPE_ = MULTITENANT_TYPE + "."; + String MULTITENANT_TYPE__SINGLE_TABLE = MULTITENANT_TYPE_ + "SINGLE_TABLE"; + String MULTITENANT_TYPE__TABLE_PER_TENANT = MULTITENANT_TYPE_ + "TABLE_PER_TENANT"; + + String TENANT_DISCRIMINATOR_COLUMN = PACKAGE_ + "TenantDiscriminatorColumn"; + String TENANT_DISCRIMINATOR_COLUMN__NAME = "name"; + String TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY = "contextProperty"; + String TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = "discriminatorType"; + String TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = "columnDefinition"; + String TENANT_DISCRIMINATOR_COLUMN__LENGTH = "length"; + String TENANT_DISCRIMINATOR_COLUMN__TABLE = "table"; + String TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY = "primaryKey"; + + String TENANT_DISCRIMINATOR_COLUMNS = PACKAGE_ + "TenantDiscriminatorColumns"; + String TENANT_DISCRIMINATOR_COLUMNS__VALUE = "value"; + +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/EclipseLinkMultitenantAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/EclipseLinkMultitenantAnnotation.java new file mode 100644 index 0000000000..dd12ffcdef --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/EclipseLinkMultitenantAnnotation.java @@ -0,0 +1,54 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.v2_3.resource.java; + +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jpt.common.core.resource.java.Annotation; +import org.eclipse.jpt.common.core.utility.TextRange; + +/** + * Corresponds to the EclipseLink annotation + * org.eclipse.persistence.annotations.Multitenant + * + * 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. + * + * @version 3.1 + * @since 3.1 + */ +public interface EclipseLinkMultitenantAnnotation + extends Annotation +{ + String ANNOTATION_NAME = EclipseLink2_3.MULTITENANT; + + + /** + * Corresponds to the 'value' element of the Multitenant annotation. + * Return null if the element does not exist in Java. + */ + MultitenantType getValue(); + String VALUE_PROPERTY = "value"; //$NON-NLS-1$ + + /** + * Corresponds to the 'value' element of the Multitenant annotation. + * Set to null to remove the element. + */ + void setValue(MultitenantType value); + + /** + * Return the {@link TextRange} for the 'value' element. If the element + * does not exist return the {@link TextRange} for the Multitenant annotation. + */ + TextRange getValueTextRange(CompilationUnit astRoot); + +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation.java new file mode 100644 index 0000000000..a512954630 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation.java @@ -0,0 +1,105 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.v2_3.resource.java; + +import org.eclipse.jdt.core.dom.CompilationUnit; +import org.eclipse.jpt.common.core.resource.java.NestableAnnotation; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation; + +/** + * Corresponds to the EclipseLink annotation + * org.eclipse.persistence.annotations.TenantDiscriminatorColumn + * + * 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. + * + * @version 3.1 + * @since 3.1 + */ +public interface EclipseLinkTenantDiscriminatorColumnAnnotation + extends DiscriminatorColumnAnnotation, + NestableAnnotation +{ + String ANNOTATION_NAME = EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN; + + // ********** contextProperty ********** + + /** + * Corresponds to the 'contextProperty' element of the TenantDiscriminatorColumn annotation. + * Return null if the element does not exist in Java. + */ + String getContextProperty(); + String CONTEXT_PROPERTY_PROPERTY = "contextProperty"; //$NON-NLS-1$ + + /** + * Corresponds to the 'contextProperty' element of the TenantDiscriminatorColumn annotation. + * Set to null to remove the element. + */ + void setContextProperty(String table); + + /** + * Return the {@link TextRange} for the 'contextProperty' element. If the element + * does not exist return the {@link TextRange} for the TenantDiscriminatorColumn annotation. + */ + TextRange getContextPropertyTextRange(CompilationUnit astRoot); + + // ********** table ********** + + /** + * Corresponds to the 'table' element of the TenantDiscriminatorColumn annotation. + * Return null if the element does not exist in Java. + */ + String getTable(); + String TABLE_PROPERTY = "table"; //$NON-NLS-1$ + + /** + * Corresponds to the 'table' element of the TenantDiscriminatorColumn annotation. + * Set to null to remove the element. + */ + void setTable(String table); + + /** + * Return the {@link TextRange} for the 'table' element. If the element + * does not exist return the {@link TextRange} for the TenantDiscriminatorColumn annotation. + */ + TextRange getTableTextRange(CompilationUnit astRoot); + + /** + * Return whether the specified position touches the 'table' element. + * Return false if the element does not exist. + */ + boolean tableTouches(int pos, CompilationUnit astRoot); + + // ********** primaryKey ********** + + /** + * Corresponds to the 'primaryKey' element of the TenantDiscriminatorColumn annotation. + * Return null if the element does not exist in Java. + */ + Boolean getPrimaryKey(); + String PRIMARY_KEY_PROPERTY = "primaryKey"; //$NON-NLS-1$ + + /** + * Corresponds to the 'primaryKey' element of the TenantDiscriminatorColumn annotation. + * Set to null to remove the element. + */ + void setPrimaryKey(Boolean primaryKey); + + /** + * Return the {@link TextRange} for the 'primaryKey' element. If the element + * does not exist return the {@link TextRange} for the TenantDiscriminatorColumn annotation. + */ + TextRange getPrimaryKeyTextRange(CompilationUnit astRoot); + +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/MultitenantType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/MultitenantType.java new file mode 100644 index 0000000000..7db896aa40 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/v2_3/resource/java/MultitenantType.java @@ -0,0 +1,64 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.v2_3.resource.java; + +/** + * Corresponds to the EclipseLink JPA enum + * org.eclipse.persistence.annotations.MultitenantType + * + * 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. + * + * @version 3.1 + * @since 3.1 + */ +public enum MultitenantType { + + SINGLE_TABLE(EclipseLink2_3.MULTITENANT_TYPE__SINGLE_TABLE), + TABLE_PER_TENANT(EclipseLink2_3.MULTITENANT_TYPE__TABLE_PER_TENANT); + + + private String javaAnnotationValue; + + MultitenantType(String javaAnnotationValue) { + if (javaAnnotationValue == null) { + throw new NullPointerException(); + } + this.javaAnnotationValue = javaAnnotationValue; + } + + public String getJavaAnnotationValue() { + return this.javaAnnotationValue; + } + + + // ********** static methods ********** + + public static MultitenantType fromJavaAnnotationValue(Object javaAnnotationValue) { + return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue); + } + + private static MultitenantType fromJavaAnnotationValue_(Object javaAnnotationValue) { + for (MultitenantType fetchType : MultitenantType.values()) { + if (fetchType.getJavaAnnotationValue().equals(javaAnnotationValue)) { + return fetchType; + } + } + return null; + } + + public static String toJavaAnnotationValue(MultitenantType fetchType) { + return (fetchType == null) ? null : fetchType.getJavaAnnotationValue(); + } + +} diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF index 4b5094dd48..4ca6e6cbae 100644 --- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF +++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF @@ -43,4 +43,5 @@ Export-Package: org.eclipse.jpt.jpa.eclipselink.core.tests.internal;x-internal:= org.eclipse.jpt.jpa.eclipselink.core.tests.internal.v2_0.context;x-internal:=true, org.eclipse.jpt.jpa.eclipselink.core.tests.internal.v2_0.context.java;x-internal:=true, org.eclipse.jpt.jpa.eclipselink.core.tests.internal.v2_0.context.orm;x-internal:=true, - org.eclipse.jpt.jpa.eclipselink.core.tests.internal.v2_0.context.persistence;x-internal:=true + org.eclipse.jpt.jpa.eclipselink.core.tests.internal.v2_0.context.persistence;x-internal:=true, + org.eclipse.jpt.jpa.eclipselink.core.tests.internal.v2_3.resource.java;x-internal:=true diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java index dea557ce8f..8ba5b3e3f3 100644 --- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java +++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. + * Copyright (c) 2007, 2011 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 @@ -15,6 +15,7 @@ import junit.framework.TestCase; import junit.framework.TestSuite; import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.JptJpaEclipseLinkCoreTests; import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java.JptEclipseLinkCoreJavaResourceModelTests; +import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.v2_3.resource.java.JptEclipseLink2_3CoreJavaResourceModelTests; /** * Required Java system property: @@ -27,6 +28,7 @@ public class JptJpaEclipselinkCoreResourceModelTests extends TestCase TestSuite suite = new TestSuite(JptJpaEclipselinkCoreResourceModelTests.class.getName()); if(JptJpaEclipseLinkCoreTests.requiredJarsExists()) { suite.addTest(JptEclipseLinkCoreJavaResourceModelTests.suite()); + suite.addTest(JptEclipseLink2_3CoreJavaResourceModelTests.suite()); } else { suite.addTest(TestSuite.warning(JptJpaEclipseLinkCoreTests.buildMissingJarErrorMessage())); diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/EclipseLink2_3JavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/EclipseLink2_3JavaResourceModelTestCase.java new file mode 100644 index 0000000000..748e806fe1 --- /dev/null +++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/EclipseLink2_3JavaResourceModelTestCase.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.tests.internal.v2_3.resource.java; + +import org.eclipse.jpt.common.core.AnnotationProvider; +import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider; +import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider; +import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JpaJavaResourceModelTestCase; +import org.eclipse.jpt.jpa.eclipselink.core.internal.v2_3.EclipseLink2_3JpaAnnotationDefinitionProvider; + +public class EclipseLink2_3JavaResourceModelTestCase extends JpaJavaResourceModelTestCase +{ + + public static final String ECLIPSELINK_ANNOTATIONS_PACKAGE_NAME = "org.eclipse.persistence.annotations"; //$NON-NLS-1$ + + public EclipseLink2_3JavaResourceModelTestCase(String name) { + super(name); + } + + @Override + protected AnnotationProvider buildAnnotationProvider() { + return new JpaAnnotationProvider( + GenericJpaAnnotationDefinitionProvider.instance(), + EclipseLink2_3JpaAnnotationDefinitionProvider.instance()); + } + +} diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnTests.java new file mode 100644 index 0000000000..aabb0d642e --- /dev/null +++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/EclipseLinkTenantDiscriminatorColumnTests.java @@ -0,0 +1,330 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.tests.internal.v2_3.resource.java; + +import java.util.Iterator; +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jpt.common.core.resource.java.JavaResourceType; +import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator; +import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType; +import org.eclipse.jpt.jpa.core.resource.java.JPA; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLink2_3; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation; + +@SuppressWarnings("nls") +public class EclipseLinkTenantDiscriminatorColumnTests extends EclipseLink2_3JavaResourceModelTestCase { + + private static final String COLUMN_NAME = "MY_COLUMN"; + private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION"; + private static final String COLUMN_CONTEXT_PROPERTY = "eclipselink.foo-id"; + private static final String COLUMN_TABLE = "MY_TABLE"; + + public EclipseLinkTenantDiscriminatorColumnTests(String name) { + super(name); + } + + private ICompilationUnit createTestTenantDiscriminatorColumn() throws Exception { + return this.createTestType(new DefaultAnnotationWriter() { + @Override + public Iterator<String> imports() { + return new ArrayIterator<String>(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + } + @Override + public void appendTypeAnnotationTo(StringBuilder sb) { + sb.append("@TenantDiscriminatorColumn"); + } + }); + } + + private ICompilationUnit createTestTenantDiscriminatorColumnWithName() throws Exception { + return this.createTestType(new DefaultAnnotationWriter() { + @Override + public Iterator<String> imports() { + return new ArrayIterator<String>(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + } + @Override + public void appendTypeAnnotationTo(StringBuilder sb) { + sb.append("@TenantDiscriminatorColumn(name = \"" + COLUMN_NAME + "\")"); + } + }); + } + + private ICompilationUnit createTestTenantDiscriminatorColumnWithColumnDefinition() throws Exception { + return this.createTestType(new DefaultAnnotationWriter() { + @Override + public Iterator<String> imports() { + return new ArrayIterator<String>(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + } + @Override + public void appendTypeAnnotationTo(StringBuilder sb) { + sb.append("@TenantDiscriminatorColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")"); + } + }); + } + + private ICompilationUnit createTestTenantDiscriminatorColumnWithContextProperty() throws Exception { + return this.createTestType(new DefaultAnnotationWriter() { + @Override + public Iterator<String> imports() { + return new ArrayIterator<String>(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + } + @Override + public void appendTypeAnnotationTo(StringBuilder sb) { + sb.append("@TenantDiscriminatorColumn(contextProperty = \"" + COLUMN_CONTEXT_PROPERTY + "\")"); + } + }); + } + + private ICompilationUnit createTestTenantDiscriminatorColumnWithTable() throws Exception { + return this.createTestType(new DefaultAnnotationWriter() { + @Override + public Iterator<String> imports() { + return new ArrayIterator<String>(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + } + @Override + public void appendTypeAnnotationTo(StringBuilder sb) { + sb.append("@TenantDiscriminatorColumn(table = \"" + COLUMN_TABLE + "\")"); + } + }); + } + + private ICompilationUnit createTestTenenatDiscriminatorColumnWithDiscriminatorType() throws Exception { + return this.createTestType(new DefaultAnnotationWriter() { + @Override + public Iterator<String> imports() { + return new ArrayIterator<String>(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN, JPA.DISCRIMINATOR_TYPE); + } + @Override + public void appendTypeAnnotationTo(StringBuilder sb) { + sb.append("@TenantDiscriminatorColumn(discriminatorType = DiscriminatorType.CHAR)"); + } + }); + } + + private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception { + return this.createTestType(new DefaultAnnotationWriter() { + @Override + public Iterator<String> imports() { + return new ArrayIterator<String>(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + } + @Override + public void appendTypeAnnotationTo(StringBuilder sb) { + sb.append("@TenantDiscriminatorColumn(" + intElement + " = 5)"); + } + }); + } + + private ICompilationUnit createTestColumnWithBooleanElement(final String booleanElement) throws Exception { + return this.createTestType(new DefaultAnnotationWriter() { + @Override + public Iterator<String> imports() { + return new ArrayIterator<String>(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + } + @Override + public void appendTypeAnnotationTo(StringBuilder sb) { + sb.append("@TenantDiscriminatorColumn(" + booleanElement + " = true)"); + } + }); + } + + public void testGetName() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithName(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + assertNotNull(column); + assertEquals(COLUMN_NAME, column.getName()); + } + + public void testGetNull() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumn(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + assertNotNull(column); + assertNull(column.getName()); + assertNull(column.getDiscriminatorType()); + assertNull(column.getColumnDefinition()); + } + + public void testSetName() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumn(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + + assertNotNull(column); + assertNull(column.getName()); + + column.setName("Foo"); + assertEquals("Foo", column.getName()); + + assertSourceContains("@TenantDiscriminatorColumn(name = \"Foo\")", cu); + } + + public void testSetNameNull() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithName(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + + assertEquals(COLUMN_NAME, column.getName()); + + column.setName(null); + assertNull(column.getName()); + + assertSourceDoesNotContain("(name", cu); + } + + public void testGetColumnDefinition() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithColumnDefinition(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition()); + } + + public void testSetColumnDefinition() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumn(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + + assertNotNull(column); + assertNull(column.getColumnDefinition()); + + column.setColumnDefinition("Foo"); + assertEquals("Foo", column.getColumnDefinition()); + + assertSourceContains("@TenantDiscriminatorColumn(columnDefinition = \"Foo\")", cu); + + + column.setColumnDefinition(null); + assertSourceDoesNotContain("(columnDefinition", cu); + } + + public void testGetLength() throws Exception { + ICompilationUnit cu = this.createTestColumnWithIntElement("length"); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + + assertEquals(Integer.valueOf(5), column.getLength()); + } + + public void testSetLength() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumn(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + + assertNotNull(column); + assertNull(column.getLength()); + + column.setLength(Integer.valueOf(5)); + assertEquals(Integer.valueOf(5), column.getLength()); + + assertSourceContains("@TenantDiscriminatorColumn(length = 5)", cu); + + column.setLength(null); + assertSourceDoesNotContain("(length", cu); + } + + public void testGetDiscriminatorType() throws Exception { + ICompilationUnit cu = this.createTestTenenatDiscriminatorColumnWithDiscriminatorType(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + assertEquals(DiscriminatorType.CHAR, column.getDiscriminatorType()); + } + + public void testSetDiscriminatorType() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumn(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + + assertNull(column.getDiscriminatorType()); + + column.setDiscriminatorType(DiscriminatorType.INTEGER); + assertEquals(DiscriminatorType.INTEGER, column.getDiscriminatorType()); + + assertSourceContains("@TenantDiscriminatorColumn(discriminatorType = INTEGER)", cu); + + column.setDiscriminatorType(null); + assertSourceDoesNotContain("(discriminatorType", cu); + } + + public void testGetContextProperty() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithContextProperty(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + assertEquals(COLUMN_CONTEXT_PROPERTY, column.getContextProperty()); + } + + public void testSetContextProperty() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumn(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + + assertNotNull(column); + assertNull(column.getContextProperty()); + + column.setContextProperty("Foo"); + assertEquals("Foo", column.getContextProperty()); + + assertSourceContains("@TenantDiscriminatorColumn(contextProperty = \"Foo\")", cu); + + + column.setContextProperty(null); + assertSourceDoesNotContain("(contextProperty", cu); + } + + public void testGetTable() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithTable(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + assertEquals(COLUMN_TABLE, column.getTable()); + } + + public void testSetTable() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumn(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + + assertNotNull(column); + assertNull(column.getTable()); + + column.setTable("Foo"); + assertEquals("Foo", column.getTable()); + + assertSourceContains("@TenantDiscriminatorColumn(table = \"Foo\")", cu); + + + column.setTable(null); + assertSourceDoesNotContain("(table", cu); + } + + public void testGetPrimaryKey() throws Exception { + ICompilationUnit cu = this.createTestColumnWithBooleanElement("primaryKey"); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + + assertEquals(Boolean.TRUE, column.getPrimaryKey()); + } + + public void testSetPrimaryKey() throws Exception { + ICompilationUnit cu = this.createTestTenantDiscriminatorColumn(); + JavaResourceType resourceType = buildJavaResourceType(cu); + EclipseLinkTenantDiscriminatorColumnAnnotation column = (EclipseLinkTenantDiscriminatorColumnAnnotation) resourceType.getAnnotation(0, EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN); + + assertNotNull(column); + assertNull(column.getPrimaryKey()); + + column.setPrimaryKey(Boolean.FALSE); + assertEquals(Boolean.FALSE, column.getPrimaryKey()); + + assertSourceContains("@TenantDiscriminatorColumn(primaryKey = false)", cu); + + column.setPrimaryKey(null); + assertSourceDoesNotContain("primaryKey", cu); + } + +} diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/EclipselinkMultitenantAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/EclipselinkMultitenantAnnotationTests.java new file mode 100644 index 0000000000..a67b1cd97b --- /dev/null +++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/EclipselinkMultitenantAnnotationTests.java @@ -0,0 +1,88 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.tests.internal.v2_3.resource.java; + +import java.util.Iterator; +import org.eclipse.jdt.core.ICompilationUnit; +import org.eclipse.jpt.common.core.resource.java.JavaResourceType; +import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLink2_3; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.EclipseLinkMultitenantAnnotation; +import org.eclipse.jpt.jpa.eclipselink.core.v2_3.resource.java.MultitenantType; + +@SuppressWarnings("nls") +public class EclipselinkMultitenantAnnotationTests extends EclipseLink2_3JavaResourceModelTestCase { + + public EclipselinkMultitenantAnnotationTests(String name) { + super(name); + } + + private ICompilationUnit createTestMultitenant() throws Exception { + return this.createTestType(new DefaultAnnotationWriter() { + @Override + public Iterator<String> imports() { + return new ArrayIterator<String>(EclipseLink2_3.MULTITENANT); + } + @Override + public void appendTypeAnnotationTo(StringBuilder sb) { + sb.append("@Multitenant"); + } + }); + } + + private ICompilationUnit createTestMultitenantWithValue() throws Exception { + return this.createTestType(new DefaultAnnotationWriter() { + @Override + public Iterator<String> imports() { + return new ArrayIterator<String>(EclipseLink2_3.MULTITENANT, EclipseLink2_3.MULTITENANT_TYPE); + } + @Override + public void appendTypeAnnotationTo(StringBuilder sb) { + sb.append("@Multitenant(MultitenantType.SINGLE_TABLE)"); + } + }); + } + + public void testMultitenant() throws Exception { + ICompilationUnit cu = this.createTestMultitenant(); + JavaResourceType resourceType = buildJavaResourceType(cu); + + EclipseLinkMultitenantAnnotation multitenant = (EclipseLinkMultitenantAnnotation) resourceType.getAnnotation(EclipseLink2_3.MULTITENANT); + assertNotNull(multitenant); + } + + public void testGetValue() throws Exception { + ICompilationUnit cu = this.createTestMultitenantWithValue(); + JavaResourceType resourceType = buildJavaResourceType(cu); + + EclipseLinkMultitenantAnnotation multitenant = (EclipseLinkMultitenantAnnotation) resourceType.getAnnotation(EclipseLink2_3.MULTITENANT); + assertEquals(MultitenantType.SINGLE_TABLE, multitenant.getValue()); + } + + public void testSetValue() throws Exception { + ICompilationUnit cu = this.createTestMultitenantWithValue(); + JavaResourceType resourceType = buildJavaResourceType(cu); + + EclipseLinkMultitenantAnnotation multitenant = (EclipseLinkMultitenantAnnotation) resourceType.getAnnotation(EclipseLink2_3.MULTITENANT); + assertEquals(MultitenantType.SINGLE_TABLE, multitenant.getValue()); + + multitenant.setValue(MultitenantType.TABLE_PER_TENANT); + assertEquals(MultitenantType.TABLE_PER_TENANT, multitenant.getValue()); + + assertSourceContains("@Multitenant(TABLE_PER_TENANT)", cu); + + multitenant.setValue(null); + assertNull(multitenant.getValue()); + + assertSourceDoesNotContain("(TABLE_PER_TENANT)", cu); + assertSourceContains("@Multitenant", cu); + assertSourceDoesNotContain("@Multitenant(", cu); + } +} diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/JptEclipseLink2_3CoreJavaResourceModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/JptEclipseLink2_3CoreJavaResourceModelTests.java new file mode 100644 index 0000000000..bd2c48691e --- /dev/null +++ b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/v2_3/resource/java/JptEclipseLink2_3CoreJavaResourceModelTests.java @@ -0,0 +1,30 @@ +/******************************************************************************* + * Copyright (c) 2011 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.jpa.eclipselink.core.tests.internal.v2_3.resource.java; + +import junit.framework.Test; +import junit.framework.TestSuite; + +public class JptEclipseLink2_3CoreJavaResourceModelTests { + + public static Test suite() { + TestSuite suite = new TestSuite(JptEclipseLink2_3CoreJavaResourceModelTests.class.getName()); + suite.addTestSuite(EclipselinkMultitenantAnnotationTests.class); + suite.addTestSuite(EclipseLinkTenantDiscriminatorColumnTests.class); + + return suite; + } + + private JptEclipseLink2_3CoreJavaResourceModelTests() { + super(); + throw new UnsupportedOperationException(); + } + +} |