summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Butzke2012-12-12 16:17:31 (EST)
committerKaren Butzke2012-12-20 17:22:09 (EST)
commit953282ab62d85dd380c8c30bf35ab66631d5dbf9 (patch)
treebeaef496b5653785c279562ed03deb33677bafd3
parentee3ac620a83557ec8aa2526c1630d5373d177dad (diff)
downloadwebtools.dali-953282ab62d85dd380c8c30bf35ab66631d5dbf9.zip
webtools.dali-953282ab62d85dd380c8c30bf35ab66631d5dbf9.tar.gz
webtools.dali-953282ab62d85dd380c8c30bf35ab66631d5dbf9.tar.bz2
added JPA 2.1 Converter annotation supportv201212202323
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/META-INF/MANIFEST.MF5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaAnnotationDefinitionProvider.java169
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaPlatformFactory.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/Converter2_1AnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/binary/BinaryConverter2_1Annotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/source/SourceConverter2_1Annotation.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericJpaUserLibraryValidator.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_1/JpaProject2_1.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2/JpaProject2_1.java)3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_1/resource/java/Converter2_1Annotation.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_1/resource/java/JPA2_1.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_5JpaPlatformFactory.java8
13 files changed, 528 insertions, 11 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.core/META-INF/MANIFEST.MF
index 9dfbacf..7eadae5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/META-INF/MANIFEST.MF
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/META-INF/MANIFEST.MF
@@ -65,6 +65,9 @@ Export-Package: org.eclipse.jpt.jpa.core,
org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.binary;x-internal:=true,
org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.source;x-internal:=true,
org.eclipse.jpt.jpa.core.internal.jpa2_1;x-internal:=true,
+ org.eclipse.jpt.jpa.core.internal.jpa2_1.resource.java;x-internal:=true,
+ org.eclipse.jpt.jpa.core.internal.jpa2_1.resource.java.binary;x-internal:=true,
+ org.eclipse.jpt.jpa.core.internal.jpa2_1.resource.java.source;x-internal:=true,
org.eclipse.jpt.jpa.core.internal.libprov;x-internal:=true,
org.eclipse.jpt.jpa.core.internal.libval;x-internal:=true,
org.eclipse.jpt.jpa.core.internal.operations;x-internal:=true,
@@ -84,6 +87,8 @@ Export-Package: org.eclipse.jpt.jpa.core,
org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection,
org.eclipse.jpt.jpa.core.jpa2.context.persistence.options,
org.eclipse.jpt.jpa.core.jpa2.resource.java,
+ org.eclipse.jpt.jpa.core.jpa2_1,
+ org.eclipse.jpt.jpa.core.jpa2_1.resource.java,
org.eclipse.jpt.jpa.core.jpql,
org.eclipse.jpt.jpa.core.jpql.spi,
org.eclipse.jpt.jpa.core.libprov,
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java
index 1b6bf1d..ab44b0e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java
@@ -85,9 +85,9 @@ import org.eclipse.jpt.jpa.core.internal.plugin.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_1;
import org.eclipse.jpt.jpa.core.jpa2.MetamodelSynchronizer;
import org.eclipse.jpt.jpa.core.jpa2.context.JpaRootContextNode2_0;
+import org.eclipse.jpt.jpa.core.jpa2_1.JpaProject2_1;
import org.eclipse.jpt.jpa.core.libprov.JpaLibraryProviderInstallOperationConfig;
import org.eclipse.jpt.jpa.core.resource.ResourceMappingFile;
import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaAnnotationDefinitionProvider.java
new file mode 100644
index 0000000..0fea8ec
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaAnnotationDefinitionProvider.java
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.jpa2_1;
+
+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.collection.CollectionTools;
+import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
+import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.Access2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.AssociationOverride2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.Cacheable2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.CollectionTable2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.ElementCollection2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.GeneratedAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.MapKeyClass2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.MapKeyColumn2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.MapKeyEnumerated2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.MapKeyJoinColumn2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.MapKeyJoinColumns2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.MapKeyTemporal2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.MapsId2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.NamedQuery2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.OrderColumn2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.SequenceGenerator2_0AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.StaticMetamodelAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.resource.java.Converter2_1AnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.AssociationOverridesAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.AttributeOverrideAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.AttributeOverridesAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.BasicAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.ColumnAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.DiscriminatorColumnAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.DiscriminatorValueAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.EmbeddableAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.EmbeddedAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.EmbeddedIdAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.EntityAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.EnumeratedAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.GeneratedValueAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.IdAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.IdClassAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.InheritanceAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.JoinColumnAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.JoinColumnsAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.JoinTableAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.LobAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.ManyToManyAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.ManyToOneAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.MapKeyAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.MappedSuperclassAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.NamedNativeQueriesAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.NamedNativeQueryAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.NamedQueriesAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.OneToManyAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.OneToOneAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.OrderByAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.PrimaryKeyJoinColumnAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.PrimaryKeyJoinColumnsAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.SecondaryTableAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.SecondaryTablesAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.TableAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.TableGeneratorAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.TemporalAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.TransientAnnotationDefinition;
+import org.eclipse.jpt.jpa.core.internal.resource.java.VersionAnnotationDefinition;
+
+public class Generic2_1JpaAnnotationDefinitionProvider
+ extends AbstractJpaAnnotationDefinitionProvider
+{
+ // singleton
+ private static final JpaAnnotationDefinitionProvider INSTANCE = new Generic2_1JpaAnnotationDefinitionProvider();
+
+ /**
+ * Return the singleton
+ */
+ public static JpaAnnotationDefinitionProvider instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Enforce singleton usage
+ */
+ private Generic2_1JpaAnnotationDefinitionProvider() {
+ super();
+ }
+
+ @Override
+ protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
+ CollectionTools.addAll(definitions, ANNOTATION_DEFINITIONS);
+ }
+
+ protected static final AnnotationDefinition[] ANNOTATION_DEFINITIONS = new AnnotationDefinition[] {
+ AttributeOverridesAnnotationDefinition.instance(),
+ AssociationOverridesAnnotationDefinition.instance(),
+ Access2_0AnnotationDefinition.instance(),
+ BasicAnnotationDefinition.instance(),
+ Cacheable2_0AnnotationDefinition.instance(),
+ CollectionTable2_0AnnotationDefinition.instance(),
+ ColumnAnnotationDefinition.instance(),
+ Converter2_1AnnotationDefinition.instance(),
+ DiscriminatorColumnAnnotationDefinition.instance(),
+ DiscriminatorValueAnnotationDefinition.instance(),
+ ElementCollection2_0AnnotationDefinition.instance(),
+ EmbeddableAnnotationDefinition.instance(),
+ EmbeddedAnnotationDefinition.instance(),
+ EmbeddedIdAnnotationDefinition.instance(),
+ EntityAnnotationDefinition.instance(),
+ EnumeratedAnnotationDefinition.instance(),
+ GeneratedAnnotationDefinition.instance(),
+ GeneratedValueAnnotationDefinition.instance(),
+ IdAnnotationDefinition.instance(),
+ IdClassAnnotationDefinition.instance(),
+ InheritanceAnnotationDefinition.instance(),
+ JoinColumnsAnnotationDefinition.instance(),
+ JoinTableAnnotationDefinition.instance(),
+ LobAnnotationDefinition.instance(),
+ ManyToManyAnnotationDefinition.instance(),
+ ManyToOneAnnotationDefinition.instance(),
+ MappedSuperclassAnnotationDefinition.instance(),
+ MapsId2_0AnnotationDefinition.instance(),
+ MapKeyAnnotationDefinition.instance(),
+ MapKeyClass2_0AnnotationDefinition.instance(),
+ MapKeyColumn2_0AnnotationDefinition.instance(),
+ MapKeyEnumerated2_0AnnotationDefinition.instance(),
+ MapKeyJoinColumns2_0AnnotationDefinition.instance(),
+ MapKeyTemporal2_0AnnotationDefinition.instance(),
+ NamedQueriesAnnotationDefinition.instance(),
+ NamedNativeQueriesAnnotationDefinition.instance(),
+ OneToManyAnnotationDefinition.instance(),
+ OneToOneAnnotationDefinition.instance(),
+ OrderByAnnotationDefinition.instance(),
+ OrderColumn2_0AnnotationDefinition.instance(),
+ PrimaryKeyJoinColumnsAnnotationDefinition.instance(),
+ SecondaryTablesAnnotationDefinition.instance(),
+ SequenceGenerator2_0AnnotationDefinition.instance(),
+ StaticMetamodelAnnotationDefinition.instance(),
+ TableAnnotationDefinition.instance(),
+ TableGeneratorAnnotationDefinition.instance(),
+ TemporalAnnotationDefinition.instance(),
+ TransientAnnotationDefinition.instance(),
+ VersionAnnotationDefinition.instance()
+ };
+
+ @Override
+ protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
+ CollectionTools.addAll(definitions, NESTABLE_ANNOTATION_DEFINITIONS);
+ }
+
+ protected static final NestableAnnotationDefinition[] NESTABLE_ANNOTATION_DEFINITIONS = new NestableAnnotationDefinition[] {
+ AssociationOverride2_0AnnotationDefinition.instance(),
+ AttributeOverrideAnnotationDefinition.instance(),
+ JoinColumnAnnotationDefinition.instance(),
+ MapKeyJoinColumn2_0AnnotationDefinition.instance(),
+ NamedQuery2_0AnnotationDefinition.instance(),
+ NamedNativeQueryAnnotationDefinition.instance(),
+ PrimaryKeyJoinColumnAnnotationDefinition.instance(),
+ SecondaryTableAnnotationDefinition.instance(),
+ };
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaPlatformFactory.java
index f6fed3b..b6b23dd 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaPlatformFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaPlatformFactory.java
@@ -17,9 +17,8 @@ import org.eclipse.jpt.jpa.core.context.AccessType;
import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatformFactory.GenericJpaPlatformVersion;
import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
import org.eclipse.jpt.jpa.core.internal.jpa2.GenericJpaFactory2_0;
-import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_1;
+import org.eclipse.jpt.jpa.core.jpa2_1.JpaProject2_1;
import org.eclipse.persistence.jpa.jpql.parser.JPQLGrammar2_1;
/**
@@ -43,7 +42,7 @@ public class Generic2_1JpaPlatformFactory
id,
this.buildJpaVersion(),
new GenericJpaFactory2_0(),
- new JpaAnnotationProvider(Generic2_0JpaAnnotationDefinitionProvider.instance()),
+ new JpaAnnotationProvider(Generic2_1JpaAnnotationDefinitionProvider.instance()),
Generic2_1JpaPlatformProvider.instance(),
this.buildJpaPlatformVariation(),
JPQLGrammar2_1.instance());
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/Converter2_1AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/Converter2_1AnnotationDefinition.java
new file mode 100644
index 0000000..9e4c849
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/Converter2_1AnnotationDefinition.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.jpa2_1.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.core.internal.jpa2_1.resource.java.binary.BinaryConverter2_1Annotation;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.resource.java.source.SourceConverter2_1Annotation;
+import org.eclipse.jpt.jpa.core.jpa2_1.resource.java.Converter2_1Annotation;
+
+/**
+ * javax.persistence.Converter
+ */
+public final class Converter2_1AnnotationDefinition
+ implements AnnotationDefinition
+{
+ // singleton
+ private static final AnnotationDefinition INSTANCE = new Converter2_1AnnotationDefinition();
+
+ /**
+ * Return the singleton.
+ */
+ public static AnnotationDefinition instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Ensure single instance.
+ */
+ private Converter2_1AnnotationDefinition() {
+ super();
+ }
+
+ public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
+ return new SourceConverter2_1Annotation(parent, annotatedElement);
+ }
+
+ public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
+ return new BinaryConverter2_1Annotation(parent, jdtAnnotation);
+ }
+
+ public String getAnnotationName() {
+ return Converter2_1Annotation.ANNOTATION_NAME;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/binary/BinaryConverter2_1Annotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/binary/BinaryConverter2_1Annotation.java
new file mode 100644
index 0000000..89067cc
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/binary/BinaryConverter2_1Annotation.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.jpa2_1.resource.java.binary;
+
+import org.eclipse.jdt.core.IAnnotation;
+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.core.jpa2_1.resource.java.Converter2_1Annotation;
+import org.eclipse.jpt.jpa.core.jpa2_1.resource.java.JPA2_1;
+
+/**
+ * <code>javax.persistence.Converter</code>
+ */
+public final class BinaryConverter2_1Annotation
+ extends BinaryAnnotation
+ implements Converter2_1Annotation
+{
+ private Boolean autoApply;
+
+
+ public BinaryConverter2_1Annotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
+ super(parent, jdtAnnotation);
+ this.autoApply = this.buildAutoApply();
+ }
+
+ @Override
+ public void update() {
+ super.update();
+ this.setAutoApply_(this.buildAutoApply());
+ }
+
+ public String getAnnotationName() {
+ return ANNOTATION_NAME;
+ }
+
+ //************* Converter2_1Annotation implementation *************
+
+ // ***** autoApply
+ public Boolean getAutoApply() {
+ return this.autoApply;
+ }
+
+ public void setAutoApply(Boolean autoApply) {
+ throw new UnsupportedOperationException();
+ }
+
+ private void setAutoApply_(Boolean autoApply) {
+ Boolean old = this.autoApply;
+ this.autoApply = autoApply;
+ this.firePropertyChanged(AUTO_APPLY_PROPERTY, old, autoApply);
+ }
+
+ private Boolean buildAutoApply() {
+ return (Boolean) this.getJdtMemberValue(getNullableElementName());
+ }
+
+ String getNullableElementName() {
+ return JPA2_1.CONVERTER__AUTO_APPLY;
+ }
+
+ public TextRange getAutoApplyTextRange() {
+ throw new UnsupportedOperationException();
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/source/SourceConverter2_1Annotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/source/SourceConverter2_1Annotation.java
new file mode 100644
index 0000000..6ba2dfe
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/resource/java/source/SourceConverter2_1Annotation.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.jpa2_1.resource.java.source;
+
+import org.eclipse.jdt.core.dom.Annotation;
+import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
+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.core.jpa2_1.resource.java.Converter2_1Annotation;
+import org.eclipse.jpt.jpa.core.jpa2_1.resource.java.JPA2_1;
+
+/**
+ * <code>javax.persistence.Converter</code>
+ */
+public final class SourceConverter2_1Annotation
+ extends SourceAnnotation
+ implements Converter2_1Annotation
+{
+ private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
+
+ private DeclarationAnnotationElementAdapter<Boolean> autoApplyDeclarationAdapter;
+ private AnnotationElementAdapter<Boolean> autoApplyAdapter;
+ private Boolean autoApply;
+ private TextRange autoApplyTextRange;
+
+
+ public SourceConverter2_1Annotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
+ super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
+ this.autoApplyDeclarationAdapter = this.buildAutoApplyDeclarationAdapter();
+ this.autoApplyAdapter = this.buildAutoApplyAdapter();
+ }
+
+ @Override
+ public void initialize(Annotation astAnnotation) {
+ super.initialize(astAnnotation);
+
+ this.autoApply = this.buildAutoApply(astAnnotation);
+ this.autoApplyTextRange = this.buildAutoApplyTextRange(astAnnotation);
+ }
+
+ @Override
+ public void synchronizeWith(Annotation astAnnotation) {
+ super.synchronizeWith(astAnnotation);
+
+ this.syncAutoApply(this.buildAutoApply(astAnnotation));
+ this.autoApplyTextRange = this.buildAutoApplyTextRange(astAnnotation);
+ }
+
+ public String getAnnotationName() {
+ return ANNOTATION_NAME;
+ }
+
+
+ //************* Converter2_1Annotation implementation *************
+
+ // ***** autoApply
+ public Boolean getAutoApply() {
+ return this.autoApply;
+ }
+
+ public void setAutoApply(Boolean autoApply) {
+ if (this.attributeValueHasChanged(this.autoApply, autoApply)) {
+ this.autoApply = autoApply;
+ this.autoApplyAdapter.setValue(autoApply);
+ }
+ }
+
+ private void syncAutoApply(Boolean astAutoApply) {
+ Boolean old = this.autoApply;
+ this.autoApply = astAutoApply;
+ this.firePropertyChanged(AUTO_APPLY_PROPERTY, old, astAutoApply);
+ }
+
+ private Boolean buildAutoApply(Annotation astAnnotation) {
+ return this.autoApplyAdapter.getValue(astAnnotation);
+ }
+
+ public TextRange getAutoApplyTextRange() {
+ return this.autoApplyTextRange;
+ }
+
+ private TextRange buildAutoApplyTextRange(Annotation astAnnotation) {
+ return this.getElementTextRange(this.autoApplyDeclarationAdapter, astAnnotation);
+ }
+
+ private DeclarationAnnotationElementAdapter<Boolean> buildAutoApplyDeclarationAdapter() {
+ return this.buildBooleanElementAdapter(this.getAutoApplyElementName());
+ }
+
+ private AnnotationElementAdapter<Boolean> buildAutoApplyAdapter() {
+ return this.buildBooleanElementAdapter(this.autoApplyDeclarationAdapter);
+ }
+
+ String getAutoApplyElementName() {
+ return JPA2_1.CONVERTER__AUTO_APPLY;
+ }
+
+
+ // ********** misc **********
+
+ @Override
+ public boolean isUnset() {
+ return super.isUnset() &&
+ (this.autoApply == null);
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java
index 2aec359..e646c64 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java
@@ -16,7 +16,7 @@ import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationCon
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.internal.libprov.JpaOsgiBundlesLibraryProviderInstallOperationConfig;
import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_1;
+import org.eclipse.jpt.jpa.core.jpa2_1.JpaProject2_1;
import org.eclipse.osgi.service.resolver.VersionRange;
public class GenericEclipseLinkBundlesLibraryValidator
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericJpaUserLibraryValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericJpaUserLibraryValidator.java
index 3d214a7..7a75431 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericJpaUserLibraryValidator.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericJpaUserLibraryValidator.java
@@ -16,8 +16,8 @@ import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationCon
import org.eclipse.jpt.common.core.libval.LibraryValidator;
import org.eclipse.jpt.jpa.core.internal.libprov.JpaUserLibraryProviderInstallOperationConfig;
import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_1;
import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
+import org.eclipse.jpt.jpa.core.jpa2_1.JpaProject2_1;
import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
public class GenericJpaUserLibraryValidator
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2/JpaProject2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_1/JpaProject2_1.java
index 4e74ceb..097c838 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2/JpaProject2_1.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_1/JpaProject2_1.java
@@ -7,8 +7,9 @@
* Contributors:
* Oracle - initial API and implementation
******************************************************************************/
-package org.eclipse.jpt.jpa.core.jpa2;
+package org.eclipse.jpt.jpa.core.jpa2_1;
+import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
/**
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_1/resource/java/Converter2_1Annotation.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_1/resource/java/Converter2_1Annotation.java
new file mode 100644
index 0000000..22a86e5
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_1/resource/java/Converter2_1Annotation.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.jpa2_1.resource.java;
+
+import org.eclipse.jpt.common.core.resource.java.Annotation;
+import org.eclipse.jpt.common.core.utility.TextRange;
+
+/**
+ * Corresponds to the JPA 2.1 annotation
+ * <code>javax.persistence.Converter</code>
+ * <p>
+ * 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.3
+ * @since 3.3
+ */
+public interface Converter2_1Annotation
+ extends Annotation
+{
+ String ANNOTATION_NAME = JPA2_1.CONVERTER;
+
+
+ // ********** autoApply **********
+
+ /**
+ * Corresponds to the 'autoApply' element of the Converter annotation.
+ * Return null if the element does not exist in Java.
+ */
+ Boolean getAutoApply();
+ String AUTO_APPLY_PROPERTY = "autoApply"; //$NON-NLS-1$
+
+ /**
+ * Corresponds to the 'nullable' element of the Converter annotation.
+ * Set to null to remove the element.
+ */
+ void setAutoApply(Boolean autoApply);
+
+ /**
+ * Return the {@link TextRange} for the 'autoApply' element. If the element
+ * does not exist return the {@link TextRange} for the Converter annotation.
+ */
+ TextRange getAutoApplyTextRange();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_1/resource/java/JPA2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_1/resource/java/JPA2_1.java
new file mode 100644
index 0000000..37a569f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_1/resource/java/JPA2_1.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.jpa2_1.resource.java;
+
+import org.eclipse.jpt.jpa.core.resource.java.JPA;
+
+/**
+ * JPA 2.1 Java-related stuff (annotations etc.)
+ * <p>
+ * 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.3
+ * @since 3.3
+ */
+@SuppressWarnings("nls")
+public interface JPA2_1
+{
+ // JPA package
+ String PACKAGE = JPA.PACKAGE;
+ String PACKAGE_ = JPA.PACKAGE_;
+
+
+ // ********** API **********
+
+ // JPA 2.1 annotations
+ String CONVERTER = PACKAGE_ + "Converter";
+ String CONVERTER__AUTO_APPLY = "autoApply";
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_5JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_5JpaPlatformFactory.java
index c0f180e..12f3e1c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_5JpaPlatformFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_5JpaPlatformFactory.java
@@ -17,8 +17,8 @@ import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
import org.eclipse.jpt.jpa.core.context.AccessType;
import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_1;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.Generic2_1JpaAnnotationDefinitionProvider;
+import org.eclipse.jpt.jpa.core.jpa2_1.JpaProject2_1;
import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkJpaPlatformVersion;
import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_1Definition;
import org.eclipse.persistence.jpa.jpql.parser.EclipseLinkJPQLGrammar2_5;
@@ -44,7 +44,7 @@ public class EclipseLink2_5JpaPlatformFactory
buildJpaVersion(),
new EclipseLink2_4JpaFactory(),
buildAnnotationProvider(),
- EclipseLink2_5JpaPlatformProvider.instance(),
+ EclipseLink2_4JpaPlatformProvider.instance(),
buildJpaVariation(),
EclipseLinkJPQLGrammar2_5.instance());
}
@@ -55,7 +55,7 @@ public class EclipseLink2_5JpaPlatformFactory
protected AnnotationProvider buildAnnotationProvider() {
return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
+ Generic2_1JpaAnnotationDefinitionProvider.instance(),
EclipseLink2_4JpaAnnotationDefinitionProvider.instance());
}