summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Butzke2012-11-14 07:31:54 (EST)
committerKaren Butzke2012-11-14 07:31:54 (EST)
commit6f867b86662761700efdd121b7783eb2cc0eed9d (patch)
treec35c7e1fb2983400b5a6cb1cf446fd9d69b33d2b
parent5f35e2196a8647cd425c618f187ba41bdbc0e561 (diff)
downloadwebtools.dali-6f867b86662761700efdd121b7783eb2cc0eed9d.zip
webtools.dali-6f867b86662761700efdd121b7783eb2cc0eed9d.tar.gz
webtools.dali-6f867b86662761700efdd121b7783eb2cc0eed9d.tar.bz2
Bug 393086 - [JPA 2.1] Add JPA 2.1 facet version and generic 2.1 platform
Bug 393090 - Add new JPA platform for EclipseLink 2.5.x
-rw-r--r--common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/META-INF/MANIFEST.MF2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/plugin.xml19
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/property_files/jpa_core.properties2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/JptCoreMessages.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmXml2_1Definition.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaPlatformFactory.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaPlatformProvider.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericJpaUserLibraryValidator.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/AbstractJpaFileCreationDataModelProvider.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/OrmFileCreationDataModelProvider.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/PersistenceFileCreationDataModelProvider.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2/JpaProject2_1.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntityMappings.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/v2_1/JPA2_1.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_5JpaPlatformFactory.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_5JpaPlatformProvider.java204
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_5Definition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_5/EclipseLink2_5.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.xml5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/UpgradeToEclipseLinkMappingFileXmlResourceHandler.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_5UiDefinition.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_5JpaPlatformUiFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_5JpaPlatformUiProvider.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Generic2_1JpaPlatformUiProvider.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmXml2_1UiDefinition.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/platform/generic/Generic2_1JpaPlatformUiFactory.java34
39 files changed, 1284 insertions, 152 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml b/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml
index 1de1066..122be46 100644
--- a/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml
+++ b/common/plugins/org.eclipse.jpt.common.eclipselink.core/plugin.xml
@@ -83,11 +83,11 @@
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_4.xsd"
uri="schemas/eclipselink_orm_2_4.xsd"/>
-<!-- comment out for now until the 2.5 schema is in our wtp build
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_5.xsd"
uri="platform:/plugin/org.eclipse.persistence.jpa/org/eclipse/persistence/jpa/eclipselink_orm_2_5.xsd"/>
--->
+
<uri
name="http://www.eclipse.org/eclipselink/xsds/eclipselink_oxm_2_0.xsd"
uri="schemas/eclipselink_oxm_2_0.xsd"/>
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 3abfce2..9dfbacf 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
@@ -64,6 +64,7 @@ Export-Package: org.eclipse.jpt.jpa.core,
org.eclipse.jpt.jpa.core.internal.jpa2.resource.java;x-internal:=true,
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.libprov;x-internal:=true,
org.eclipse.jpt.jpa.core.internal.libval;x-internal:=true,
org.eclipse.jpt.jpa.core.internal.operations;x-internal:=true,
@@ -91,5 +92,6 @@ Export-Package: org.eclipse.jpt.jpa.core,
org.eclipse.jpt.jpa.core.resource.java,
org.eclipse.jpt.jpa.core.resource.orm,
org.eclipse.jpt.jpa.core.resource.orm.v2_0,
+ org.eclipse.jpt.jpa.core.resource.orm.v2_1,
org.eclipse.jpt.jpa.core.resource.persistence,
org.eclipse.jpt.jpa.core.resource.persistence.v2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties
index c2be0d7..3c08a05 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties
@@ -35,6 +35,7 @@ ORM_XML_CONTENT = JPA orm.xml mapping file
GENERIC_PLATFORM_GROUP_LABEL=Generic
GENERIC_1_0_PLATFORM_LABEL=Generic 1.0
GENERIC_2_0_PLATFORM_LABEL=Generic 2.0
+GENERIC_2_1_PLATFORM_LABEL=Generic 2.1
NO_OP_LIBRARY_PROVIDER_MESSAGE = The JPA facet requires a JPA implementation library to be present on the project classpath. By disabling library configuration, the user takes on the responsibility of ensuring that the classpath is configured appropriately via alternate means.
DEPRECATED_USER_LIBRARY_PROVIDER_LABEL=User Library (deprecated)
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.xml b/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.xml
index c29aa85..a264c1c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.xml
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.xml
@@ -188,6 +188,11 @@
content-type="org.eclipse.jpt.jpa.core.content.orm"
version="2.0"/>
+ <resource-type
+ id="org.eclipse.jpt.jpa.core.resource.orm_2_1"
+ content-type="org.eclipse.jpt.jpa.core.content.orm"
+ version="2.1"/>
+
</extension>
@@ -283,6 +288,14 @@
group="generic"
jpaFacetVersion="2.0"
default="false"/>
+
+ <jpaPlatform
+ id="generic2_1"
+ label="%GENERIC_2_1_PLATFORM_LABEL"
+ factoryClass="org.eclipse.jpt.jpa.core.internal.jpa2_1.Generic2_1JpaPlatformFactory"
+ group="generic"
+ jpaFacetVersion="2.1"
+ default="false"/>
</extension>
@@ -535,6 +548,12 @@
</constraint>
</project-facet-version>
+ <project-facet-version facet="jpt.jpa" version="2.1">
+ <constraint>
+ <requires facet="java" version="[5.0"/>
+ </constraint>
+ </project-facet-version>
+
<template id="jpt.jpa.template">
<label>%JPA_TEMPLATE_LABEL</label>
<fixed facet="jpt.jpa"/>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/property_files/jpa_core.properties b/jpa/plugins/org.eclipse.jpt.jpa.core/property_files/jpa_core.properties
index 49cc968..bcd84c4 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/property_files/jpa_core.properties
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/property_files/jpa_core.properties
@@ -24,8 +24,6 @@ VALIDATE_JOB=Validation
VALIDATE_PROJECT_NOT_JPA=Project does not have the JPA facet
VALIDATE_PROJECT_IMPROPER_PLATFORM=Project's JPA platform does not support this file type
VALIDATE_CONTAINER_QUESTIONABLE=Parent folder may not be acceptable for this project
-VALIDATE_FILE_VERSION_NOT_SUPPORTED=File version not supported
-VALIDATE_FILE_VERSION_NOT_SUPPORTED_FOR_FACET_VERSION=File version not supported for JPA facet version
VALIDATE_PERSISTENCE_UNIT_DOES_NOT_SPECIFIED=Persistence unit not specified
VALIDATE_PERSISTENCE_UNIT_NOT_IN_PROJECT=Persistence unit ''{0}'' not defined in project ''{1}''
VALIDATE_PLATFORM_NOT_SPECIFIED=Platform must be specified
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 f496d28..5e854ad 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
@@ -84,6 +84,7 @@ 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.libprov.JpaLibraryProviderInstallOperationConfig;
@@ -122,7 +123,7 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
*/
public abstract class AbstractJpaProject
extends AbstractJpaNode
- implements JpaProject2_0
+ implements JpaProject2_1
{
/**
* The JPA project manager.
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/JptCoreMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/JptCoreMessages.java
index 185d769..357002c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/JptCoreMessages.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/JptCoreMessages.java
@@ -38,8 +38,6 @@ public class JptCoreMessages {
public static String VALIDATE_PROJECT_NOT_JPA;
public static String VALIDATE_PROJECT_IMPROPER_PLATFORM;
public static String VALIDATE_CONTAINER_QUESTIONABLE;
- public static String VALIDATE_FILE_VERSION_NOT_SUPPORTED;
- public static String VALIDATE_FILE_VERSION_NOT_SUPPORTED_FOR_FACET_VERSION;
public static String VALIDATE_PERSISTENCE_UNIT_DOES_NOT_SPECIFIED;
public static String VALIDATE_PERSISTENCE_UNIT_NOT_IN_PROJECT;
public static String VALIDATE_PLATFORM_NOT_SPECIFIED;
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmXml2_1Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmXml2_1Definition.java
new file mode 100644
index 0000000..7778995
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmXml2_1Definition.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * 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.context.orm;
+
+import java.util.ArrayList;
+
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
+import org.eclipse.jpt.jpa.core.context.orm.NullOrmAttributeMappingDefinition;
+import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
+import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
+import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.orm.OrmBasicMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedIdMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.orm.OrmIdMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToManyMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToOneMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToManyMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToOneMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.orm.OrmTransientMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.orm.OrmVersionMappingDefinition;
+import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
+import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
+import org.eclipse.jpt.jpa.core.resource.orm.v2_1.JPA2_1;
+
+public class GenericOrmXml2_1Definition
+ extends AbstractOrmXmlDefinition
+{
+ // singleton
+ private static final OrmXmlDefinition INSTANCE = new GenericOrmXml2_1Definition();
+
+ /**
+ * Return the singleton
+ */
+ public static OrmXmlDefinition instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Enforce singleton usage
+ */
+ private GenericOrmXml2_1Definition() {
+ super();
+ }
+
+ public JptResourceType getResourceType() {
+ return this.getResourceType(XmlEntityMappings.CONTENT_TYPE, JPA2_1.SCHEMA_VERSION);
+ }
+
+ public EFactory getResourceNodeFactory() {
+ return OrmFactory.eINSTANCE;
+ }
+
+ @Override
+ protected OrmXmlContextNodeFactory buildContextNodeFactory() {
+ return new GenericOrmXml2_0ContextNodeFactory();
+ }
+
+ @Override
+ protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
+ CollectionTools.addAll(definitions, ATTRIBUTE_MAPPING_DEFINITIONS);
+ }
+
+ /**
+ * Order should not matter here; but we'll use the same order as for Java.
+ * @see Generic2_1JpaPlatformProvider
+ */
+ protected static final OrmAttributeMappingDefinition[] ATTRIBUTE_MAPPING_DEFINITIONS = new OrmAttributeMappingDefinition[] {
+ OrmTransientMappingDefinition.instance(),
+ OrmElementCollectionMapping2_0Definition.instance(),
+ OrmIdMappingDefinition.instance(),
+ OrmVersionMappingDefinition.instance(),
+ OrmBasicMappingDefinition.instance(),
+ OrmEmbeddedMappingDefinition.instance(),
+ OrmEmbeddedIdMappingDefinition.instance(),
+ OrmManyToManyMappingDefinition.instance(),
+ OrmManyToOneMappingDefinition.instance(),
+ OrmOneToManyMappingDefinition.instance(),
+ OrmOneToOneMappingDefinition.instance(),
+ NullOrmAttributeMappingDefinition.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
new file mode 100644
index 0000000..f6fed3b
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaPlatformFactory.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * 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 org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.jpa.core.JpaPlatform;
+import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
+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.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.persistence.jpa.jpql.parser.JPQLGrammar2_1;
+
+/**
+ * All the state in the JPA platform should be "static" (i.e. unchanging once
+ * it is initialized).
+ */
+public class Generic2_1JpaPlatformFactory
+ implements JpaPlatformFactory
+{
+ public static final String ID = "generic2_1"; //$NON-NLS-1$
+
+ /**
+ * zero-argument constructor
+ */
+ public Generic2_1JpaPlatformFactory() {
+ super();
+ }
+
+ public JpaPlatform buildJpaPlatform(String id) {
+ return new GenericJpaPlatform(
+ id,
+ this.buildJpaVersion(),
+ new GenericJpaFactory2_0(),
+ new JpaAnnotationProvider(Generic2_0JpaAnnotationDefinitionProvider.instance()),
+ Generic2_1JpaPlatformProvider.instance(),
+ this.buildJpaPlatformVariation(),
+ JPQLGrammar2_1.instance());
+ }
+
+ private JpaPlatform.Version buildJpaVersion() {
+ return new GenericJpaPlatformVersion(JpaProject2_1.FACET_VERSION_STRING);
+ }
+
+ protected JpaPlatformVariation buildJpaPlatformVariation() {
+ return new JpaPlatformVariation() {
+ //table_per_class inheritance support is optional in the 2.1 spec
+ public Supported getTablePerConcreteClassInheritanceIsSupported() {
+ return Supported.MAYBE;
+ }
+ public boolean isJoinTableOverridable() {
+ return true;
+ }
+ public AccessType[] getSupportedAccessTypes(JptResourceType resourceType) {
+ return GENERIC_SUPPORTED_ACCESS_TYPES;
+ }
+ };
+ }
+} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaPlatformProvider.java
new file mode 100644
index 0000000..bedb684
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/Generic2_1JpaPlatformProvider.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * 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.JptResourceType;
+import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
+import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
+import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
+import org.eclipse.jpt.jpa.core.ResourceDefinition;
+import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
+import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
+import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
+import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
+import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
+import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
+import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
+import org.eclipse.jpt.jpa.core.internal.context.java.JarDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.java.JavaSourceFileDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXmlDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaBasicMappingDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaElementCollectionMappingDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEmbeddableDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEmbeddedIdMappingDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEmbeddedMappingDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEntityDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaIdMappingDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaManyToManyMappingDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaManyToOneMappingDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaMappedSuperclassDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaOneToManyMappingDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaOneToOneMappingDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaVersionMappingDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmXml2_0Definition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmXml2_1Definition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.persistence.GenericPersistenceXml2_0Definition;
+
+/**
+ * All the state in the JPA platform should be "static" (i.e. unchanging once
+ * it is initialized).
+ */
+public class Generic2_1JpaPlatformProvider
+ extends AbstractJpaPlatformProvider
+{
+ // singleton
+ private static final JpaPlatformProvider INSTANCE = new Generic2_1JpaPlatformProvider();
+
+ /**
+ * Return the singleton
+ */
+ public static JpaPlatformProvider instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Enforce singleton usage
+ */
+ private Generic2_1JpaPlatformProvider() {
+ super();
+ }
+
+
+ // ********** resource models **********
+
+ @Override
+ protected void addMostRecentSupportedResourceTypesTo(ArrayList<JptResourceType> types) {
+ CollectionTools.addAll(types, MOST_RECENT_SUPPORTED_RESOURCE_TYPES);
+ }
+
+ // order should not be important here
+ protected static final JptResourceType[] MOST_RECENT_SUPPORTED_RESOURCE_TYPES = new JptResourceType[] {
+ JavaSourceFileDefinition.instance().getResourceType(),
+ JarDefinition.instance().getResourceType(),
+ GenericPersistenceXml2_0Definition.instance().getResourceType(),
+ GenericOrmXml2_1Definition.instance().getResourceType()
+ };
+
+ @Override
+ protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
+ CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
+ }
+
+ // order should not be important here
+ protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
+ JavaResourceModelProvider.instance(),
+ JarResourceModelProvider.instance(),
+ PersistenceResourceModelProvider.instance(),
+ OrmResourceModelProvider.instance()
+ };
+
+
+ // ********** Java type mappings **********
+
+ @Override
+ protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
+ CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
+ }
+
+ // order matches that used by the Reference Implementation (EclipseLink)
+ protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
+ JavaEntityDefinition2_0.instance(),
+ JavaEmbeddableDefinition2_0.instance(),
+ JavaMappedSuperclassDefinition2_0.instance()
+ };
+
+
+ // ********** Java attribute mappings **********
+
+ @Override
+ protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
+ CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
+ }
+
+ // order matches that used by the Reference Implementation (EclipseLink)
+ protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
+ JavaEmbeddedMappingDefinition2_0.instance(),
+ JavaBasicMappingDefinition2_0.instance()
+ };
+
+ @Override
+ protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
+ CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
+ }
+
+ // order matches that used by the Reference Implementation (EclipseLink)
+ protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
+ JavaTransientMappingDefinition.instance(),
+ JavaElementCollectionMappingDefinition2_0.instance(),
+ JavaIdMappingDefinition2_0.instance(),
+ JavaVersionMappingDefinition2_0.instance(),
+ JavaBasicMappingDefinition2_0.instance(),
+ JavaEmbeddedMappingDefinition2_0.instance(),
+ JavaEmbeddedIdMappingDefinition2_0.instance(),
+ JavaManyToManyMappingDefinition2_0.instance(),
+ JavaManyToOneMappingDefinition2_0.instance(),
+ JavaOneToManyMappingDefinition2_0.instance(),
+ JavaOneToOneMappingDefinition2_0.instance()
+ };
+
+
+ // ********** resource definitions **********
+
+ @Override
+ protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
+ CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
+ }
+
+ protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
+ JavaSourceFileDefinition.instance(),
+ JarDefinition.instance(),
+ GenericPersistenceXmlDefinition.instance(),
+ GenericPersistenceXml2_0Definition.instance(),
+ GenericOrmXmlDefinition.instance(),
+ GenericOrmXml2_0Definition.instance(),
+ GenericOrmXml2_1Definition.instance()
+ };
+}
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 9f424d7..2aec359 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,6 +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.osgi.service.resolver.VersionRange;
public class GenericEclipseLinkBundlesLibraryValidator
@@ -33,6 +34,9 @@ public class GenericEclipseLinkBundlesLibraryValidator
else if (config.getProjectFacetVersion().equals(JpaProject2_0.FACET_VERSION)) {
versionRanges = new VersionRange[] {new VersionRange("[2.0, 3.0)")}; //$NON-NLS-1$
}
+ else if (config.getProjectFacetVersion().equals(JpaProject2_1.FACET_VERSION)) {
+ versionRanges = new VersionRange[] {new VersionRange("[2.5, 3.0)")}; //$NON-NLS-1$
+ }
bundleVersionRanges.put(bundleName, versionRanges);
return validate(jpaConfig, bundleVersionRanges);
}
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 f4d780a..3d214a7 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,6 +16,7 @@ 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.resource.java.EntityAnnotation;
@@ -29,6 +30,9 @@ public class GenericJpaUserLibraryValidator
if (config.getProjectFacetVersion().compareTo(JpaProject2_0.FACET_VERSION) >= 0) {
classNames.add(ElementCollection2_0Annotation.ANNOTATION_NAME);
}
+ if (config.getProjectFacetVersion().compareTo(JpaProject2_1.FACET_VERSION) >= 0) {
+ classNames.add("javax.persistence.Convert"); //$NON-NLS-1$
+ }
return LibraryValidatorTools.validateClasspathEntries(jpaConfig.resolve(), classNames);
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/AbstractJpaFileCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/AbstractJpaFileCreationDataModelProvider.java
index 56363b9..cd470af 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/AbstractJpaFileCreationDataModelProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/AbstractJpaFileCreationDataModelProvider.java
@@ -13,7 +13,6 @@ import java.util.Set;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.content.IContentType;
@@ -27,8 +26,6 @@ import org.eclipse.jpt.jpa.core.JpaWorkspace;
import org.eclipse.jpt.jpa.core.internal.JptCoreMessages;
import org.eclipse.jpt.jpa.core.internal.plugin.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.platform.JpaPlatformManager;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
public abstract class AbstractJpaFileCreationDataModelProvider
extends AbstractJptFileCreationDataModelProvider
@@ -88,23 +85,6 @@ public abstract class AbstractJpaFileCreationDataModelProvider
// **************** validation *********************************************
@Override
- public IStatus validate(String propertyName) {
- IStatus status = super.validate(propertyName);
- if (! status.isOK()) {
- return status;
- }
- if (propertyName.equals(CONTAINER_PATH)
- || propertyName.equals(VERSION)) {
- status = validateVersion();
- }
- if (! status.isOK()) {
- return status;
- }
-
- return status;
- }
-
- @Override
protected IStatus validateContainerPathAndFileName() {
IStatus status = super.validateContainerPathAndFileName();
if (! status.isOK()) {
@@ -127,31 +107,6 @@ public abstract class AbstractJpaFileCreationDataModelProvider
return Status.OK_STATUS;
}
- protected IStatus validateVersion() {
- if (getProject() == null) {
- return Status.OK_STATUS;
- }
- String fileVersion = getStringProperty(VERSION);
- if (! fileVersionSupported(fileVersion)) {
- return JptJpaCorePlugin.instance().buildErrorStatus(JptCoreMessages.VALIDATE_FILE_VERSION_NOT_SUPPORTED);
- }
- try {
- String jpaFacetVersion = getJpaFacetVersion(getProject());
- if (! fileVersionSupportedForFacetVersion(fileVersion, jpaFacetVersion)) {
- return JptJpaCorePlugin.instance().buildErrorStatus(JptCoreMessages.VALIDATE_FILE_VERSION_NOT_SUPPORTED_FOR_FACET_VERSION);
- }
- }
- catch (CoreException ce) {
- // project should have been validated already, so assume that this will never get hit
- // fall through to final return
- }
- return Status.OK_STATUS;
- }
-
- protected abstract boolean fileVersionSupported(String fileVersion);
-
- protected abstract boolean fileVersionSupportedForFacetVersion(String fileVersion, String jpaFacetVersion);
-
// **************** helper methods *****************************************
@@ -176,11 +131,6 @@ public abstract class AbstractJpaFileCreationDataModelProvider
return (JpaProject.Reference) project.getAdapter(JpaProject.Reference.class);
}
- protected String getJpaFacetVersion(IProject project) throws CoreException {
- IFacetedProject fproj = ProjectFacetsManager.create(project);
- return fproj.getProjectFacetVersion(JpaProject.FACET).getVersionString();
- }
-
protected boolean hasSupportedPlatform(IProject project) {
JpaProject jpaProject = this.getJpaProject(project);
return (jpaProject != null) && this.platformIsSupported(jpaProject.getJpaPlatform());
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/OrmFileCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/OrmFileCreationDataModelProvider.java
index 90a1e8d..79ef801 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/OrmFileCreationDataModelProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/OrmFileCreationDataModelProvider.java
@@ -26,9 +26,7 @@ import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
import org.eclipse.jpt.jpa.core.internal.JptCoreMessages;
import org.eclipse.jpt.jpa.core.internal.plugin.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.resource.orm.AccessType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
@@ -194,21 +192,6 @@ public class OrmFileCreationDataModelProvider
return Status.OK_STATUS;
}
- @Override
- protected boolean fileVersionSupported(String fileVersion) {
- return (fileVersion.equals(JPA.SCHEMA_VERSION)
- || fileVersion.equals(JPA2_0.SCHEMA_VERSION));
- }
-
- @Override
- protected boolean fileVersionSupportedForFacetVersion(String fileVersion, String jpaFacetVersion) {
- if (jpaFacetVersion.equals(JpaProject.FACET_VERSION_STRING)
- && fileVersion.equals(JPA2_0.SCHEMA_VERSION)) {
- return false;
- }
- return true;
- }
-
protected IStatus validatePersistenceUnit() {
boolean addToPUnit = getBooleanProperty(ADD_TO_PERSISTENCE_UNIT);
String projectName = getProject().getName();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/PersistenceFileCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/PersistenceFileCreationDataModelProvider.java
index b6fa490..37741b5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/PersistenceFileCreationDataModelProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/operations/PersistenceFileCreationDataModelProvider.java
@@ -11,10 +11,7 @@ package org.eclipse.jpt.jpa.core.internal.operations;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.resource.persistence.JPA;
import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.jpa.core.resource.persistence.v2_0.JPA2_0;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
public class PersistenceFileCreationDataModelProvider
@@ -46,21 +43,6 @@ public class PersistenceFileCreationDataModelProvider
// **************** validation *********************************************
-
- @Override
- protected boolean fileVersionSupported(String fileVersion) {
- return (fileVersion.equals(JPA.SCHEMA_VERSION)
- || fileVersion.equals(JPA2_0.SCHEMA_VERSION));
- }
-
- @Override
- protected boolean fileVersionSupportedForFacetVersion(String fileVersion, String jpaFacetVersion) {
- if (jpaFacetVersion.equals(JpaProject.FACET_VERSION_STRING)
- && fileVersion.equals(JPA2_0.SCHEMA_VERSION)) {
- return false;
- }
- return true;
- }
@Override
protected boolean platformIsSupported(JpaPlatform jpaPlatform) {
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/JpaProject2_1.java
new file mode 100644
index 0000000..4e74ceb
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2/JpaProject2_1.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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;
+
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+/**
+ * JPA 2.1 project.
+ * <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 JpaProject2_1
+ extends JpaProject2_0
+{
+ // ********** JPA facet **********
+
+ /**
+ * The JPA 2.1 project facet version string.
+ * <p>
+ * Value: {@value}
+ */
+ String FACET_VERSION_STRING = "2.1"; //$NON-NLS-1$
+
+ /**
+ * The JPA 2.1 project facet version.
+ */
+ IProjectFacetVersion FACET_VERSION = FACET.getVersion(FACET_VERSION_STRING);
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntityMappings.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntityMappings.java
index 9f699d3..01398a1 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntityMappings.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntityMappings.java
@@ -30,6 +30,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
import org.eclipse.jpt.jpa.core.internal.plugin.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
+import org.eclipse.jpt.jpa.core.resource.orm.v2_1.JPA2_1;
import org.eclipse.text.edits.ReplaceEdit;
import org.eclipse.wst.common.internal.emf.resource.Translator;
@@ -1039,6 +1040,7 @@ public class XmlEntityMappings extends ERootObjectImpl implements XmlQueryContai
HashMap<String, String> map = new HashMap<String, String>();
map.put(JPA.SCHEMA_VERSION, JPA.SCHEMA_LOCATION);
map.put(JPA2_0.SCHEMA_VERSION, JPA2_0.SCHEMA_LOCATION);
+ map.put(JPA2_1.SCHEMA_VERSION, JPA2_1.SCHEMA_LOCATION);
return map;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/v2_1/JPA2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/v2_1/JPA2_1.java
new file mode 100644
index 0000000..6e96a89
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/v2_1/JPA2_1.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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.resource.orm.v2_1;
+
+import org.eclipse.jpt.jpa.core.resource.orm.JPA;
+
+/**
+ * JPA 2.1 orm.xml-related stuff (elements, attributes 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.3
+ * @since 3.3
+ */
+@SuppressWarnings("nls")
+public interface JPA2_1
+ extends JPA
+{
+ String SCHEMA_NAMESPACE = JPA.SCHEMA_NAMESPACE;
+ String SCHEMA_LOCATION = "http://java.sun.com/xml/ns/persistence/orm_2_1.xsd";
+ String SCHEMA_VERSION = "2.1";
+
+ // JPA 2.1 specific nodes
+
+}
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 e0ffd59..8031464 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
@@ -62,4 +62,5 @@ Export-Package: org.eclipse.jpt.jpa.eclipselink.core,
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.resource.orm.v2_4
+ org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4,
+ org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties
index 8ba919a..76409b2 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties
@@ -33,5 +33,6 @@ ECLIPSELINK2_1_x_PLATFORM = EclipseLink 2.1.x
ECLIPSELINK2_2_x_PLATFORM = EclipseLink 2.2.x
ECLIPSELINK2_3_x_PLATFORM = EclipseLink 2.3.x
ECLIPSELINK2_4_x_PLATFORM = EclipseLink 2.4.x
+ECLIPSELINK2_5_x_PLATFORM = EclipseLink 2.5.x
builderName = Eclipselink Static Weaving Builder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml
index 3c0b3a8..254b5ca 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml
@@ -108,6 +108,13 @@
<base-type id="org.eclipse.jpt.jpa.core.resource.orm_2_0"/>
</resource-type>
+ <resource-type
+ id="org.eclipse.jpt.jpa.eclipselink.core.resource.orm_2_5"
+ content-type="org.eclipse.jpt.jpa.eclipselink.core.content.orm"
+ version="2.5">
+ <base-type id="org.eclipse.jpt.jpa.core.resource.orm_2_1"/>
+ </resource-type>
+
</extension>
@@ -175,6 +182,13 @@
factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_4JpaPlatformFactory"
group="eclipselink"
jpaFacetVersion="2.0"/>
+
+ <jpaPlatform
+ id="eclipselink2_5"
+ label="%ECLIPSELINK2_5_x_PLATFORM"
+ factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_5JpaPlatformFactory"
+ group="eclipselink"
+ jpaFacetVersion="2.1"/>
</extension>
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
new file mode 100644
index 0000000..c0f180e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_5JpaPlatformFactory.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * 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.eclipselink.core.internal;
+
+import org.eclipse.jpt.common.core.AnnotationProvider;
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.jpa.core.JpaPlatform;
+import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
+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.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;
+
+public class EclipseLink2_5JpaPlatformFactory
+ implements JpaPlatformFactory
+{
+ /**
+ * Version string for EclipseLink platform version 2.5
+ */
+ public static final String VERSION = "2.5"; //$NON-NLS-1$
+
+ /**
+ * zero-argument constructor
+ */
+ public EclipseLink2_5JpaPlatformFactory() {
+ super();
+ }
+
+ public JpaPlatform buildJpaPlatform(String id) {
+ return new GenericJpaPlatform(
+ id,
+ buildJpaVersion(),
+ new EclipseLink2_4JpaFactory(),
+ buildAnnotationProvider(),
+ EclipseLink2_5JpaPlatformProvider.instance(),
+ buildJpaVariation(),
+ EclipseLinkJPQLGrammar2_5.instance());
+ }
+
+ protected JpaPlatform.Version buildJpaVersion() {
+ return new EclipseLinkJpaPlatformVersion(VERSION, JpaProject2_1.FACET_VERSION_STRING);
+ }
+
+ protected AnnotationProvider buildAnnotationProvider() {
+ return new JpaAnnotationProvider(
+ Generic2_0JpaAnnotationDefinitionProvider.instance(),
+ EclipseLink2_4JpaAnnotationDefinitionProvider.instance());
+ }
+
+ protected JpaPlatformVariation buildJpaVariation() {
+ return new JpaPlatformVariation() {
+ public Supported getTablePerConcreteClassInheritanceIsSupported() {
+ return Supported.YES;
+ }
+ public boolean isJoinTableOverridable() {
+ return true;
+ }
+ public AccessType[] getSupportedAccessTypes(JptResourceType resourceType) {
+ return resourceType.isKindOf(EclipseLinkOrmXml2_1Definition.instance().getResourceType()) ?
+ EclipseLink2_1JpaPlatformFactory.SUPPORTED_ACCESS_TYPES :
+ GENERIC_SUPPORTED_ACCESS_TYPES;
+ }
+ };
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_5JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_5JpaPlatformProvider.java
new file mode 100644
index 0000000..0e2e341
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_5JpaPlatformProvider.java
@@ -0,0 +1,204 @@
+/*******************************************************************************
+ * 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.eclipselink.core.internal;
+
+import java.util.ArrayList;
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
+import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
+import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
+import org.eclipse.jpt.jpa.core.ResourceDefinition;
+import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
+import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
+import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
+import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
+import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
+import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
+import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
+import org.eclipse.jpt.jpa.core.internal.context.java.JarDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.java.JavaSourceFileDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmXml2_0Definition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmXml2_1Definition;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.persistence.GenericPersistenceXml2_0Definition;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaArrayMappingDefinition2_3;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition2_0;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition2_0;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaElementCollectionMappingDefinition2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddedIdMappingDefinition2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddedMappingDefinition2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition2_3;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition2_3;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaStructureMappingDefinition2_3;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition2_0;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition2_0;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_1Definition;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_2Definition;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_0Definition;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_1Definition;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_2Definition;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_3Definition;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_4Definition;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_5Definition;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLink2_4PersistenceXmlDefinition;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
+
+/**
+ * EclipseLink 2.5 platform config
+ */
+public class EclipseLink2_5JpaPlatformProvider
+ extends AbstractJpaPlatformProvider
+{
+ // singleton
+ private static final JpaPlatformProvider INSTANCE = new EclipseLink2_5JpaPlatformProvider();
+
+ /**
+ * Return the singleton
+ */
+ public static JpaPlatformProvider instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Enforce singleton usage
+ */
+ private EclipseLink2_5JpaPlatformProvider() {
+ super();
+ }
+
+
+ // ********** resource models **********
+
+ @Override
+ protected void addMostRecentSupportedResourceTypesTo(ArrayList<JptResourceType> types) {
+ CollectionTools.addAll(types, MOST_RECENT_SUPPORTED_RESOURCE_TYPES);
+ }
+
+ // order should not be important here
+ protected static final JptResourceType[] MOST_RECENT_SUPPORTED_RESOURCE_TYPES = new JptResourceType[] {
+ JavaSourceFileDefinition.instance().getResourceType(),
+ JarDefinition.instance().getResourceType(),
+ GenericPersistenceXml2_0Definition.instance().getResourceType(),
+ GenericOrmXml2_1Definition.instance().getResourceType(),
+ EclipseLinkOrmXml2_5Definition.instance().getResourceType()
+ };
+
+ @Override
+ protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
+ CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
+ }
+
+ // order should not be important here
+ protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
+ JavaResourceModelProvider.instance(),
+ JarResourceModelProvider.instance(),
+ PersistenceResourceModelProvider.instance(),
+ OrmResourceModelProvider.instance(),
+ EclipseLinkOrmResourceModelProvider.instance()
+ };
+
+
+ // ********** resource definitions **********
+
+ @Override
+ protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
+ CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
+ }
+
+ protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
+ JavaSourceFileDefinition.instance(),
+ JarDefinition.instance(),
+ EclipseLinkPersistenceXmlDefinition.instance(),
+ EclipseLink2_4PersistenceXmlDefinition.instance(),
+ GenericOrmXmlDefinition.instance(),
+ GenericOrmXml2_0Definition.instance(),
+ GenericOrmXml2_1Definition.instance(),
+ EclipseLinkOrmXmlDefinition.instance(),
+ EclipseLinkOrmXml1_1Definition.instance(),
+ EclipseLinkOrmXml1_2Definition.instance(),
+ EclipseLinkOrmXml2_0Definition.instance(),
+ EclipseLinkOrmXml2_1Definition.instance(),
+ EclipseLinkOrmXml2_2Definition.instance(),
+ EclipseLinkOrmXml2_3Definition.instance(),
+ EclipseLinkOrmXml2_4Definition.instance(),
+ EclipseLinkOrmXml2_5Definition.instance()
+ };
+
+
+ // ********* Java type mappings *********
+
+ @Override
+ protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
+ CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS_2_5);
+ }
+
+ // order matches that used by EclipseLink
+ // NB: no EclipseLink-specific mappings
+ protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS_2_5 = new JavaTypeMappingDefinition[] {
+ EclipseLinkJavaEntityDefinition2_3.instance(),
+ EclipseLinkJavaEmbeddableDefinition2_2.instance(),
+ EclipseLinkJavaMappedSuperclassDefinition2_3.instance()
+ };
+
+
+ // ********* Java attribute mappings *********
+
+ @Override
+ protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
+ CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS_2_5);
+ }
+
+ // order matches that used by EclipseLink
+ // NB: no change from EclipseLink 1.2 to 2.0
+ protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS_2_5 = new DefaultJavaAttributeMappingDefinition[] {
+ EclipseLinkJavaEmbeddedMappingDefinition2_2.instance(),
+ EclipseLinkJavaOneToManyMappingDefinition2_2.instance(),
+ EclipseLinkJavaOneToOneMappingDefinition2_2.instance(),
+ EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance(),
+ EclipseLinkJavaBasicMappingDefinition2_2.instance()
+ };
+
+ @Override
+ protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
+ CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS_2_5);
+ }
+
+ // order matches that used by EclipseLink
+ protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS_2_5 = new JavaAttributeMappingDefinition[] {
+ JavaTransientMappingDefinition.instance(),
+ EclipseLinkJavaBasicCollectionMappingDefinition2_0.instance(),
+ EclipseLinkJavaBasicMapMappingDefinition2_0.instance(),
+ EclipseLinkJavaArrayMappingDefinition2_3.instance(),
+ EclipseLinkJavaElementCollectionMappingDefinition2_2.instance(),
+ EclipseLinkJavaIdMappingDefinition2_2.instance(),
+ EclipseLinkJavaVersionMappingDefinition2_2.instance(),
+ EclipseLinkJavaBasicMappingDefinition2_2.instance(),
+ EclipseLinkJavaStructureMappingDefinition2_3.instance(),
+ EclipseLinkJavaEmbeddedMappingDefinition2_2.instance(),
+ EclipseLinkJavaEmbeddedIdMappingDefinition2_2.instance(),
+ EclipseLinkJavaTransformationMappingDefinition2_0.instance(),
+ EclipseLinkJavaManyToManyMappingDefinition2_2.instance(),
+ EclipseLinkJavaManyToOneMappingDefinition2_2.instance(),
+ EclipseLinkJavaOneToManyMappingDefinition2_2.instance(),
+ EclipseLinkJavaOneToOneMappingDefinition2_2.instance(),
+ EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance()
+ };
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java
index 598e5e1..2cd13e5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java
@@ -105,6 +105,8 @@ public class EclipseLinkJpaPlatformFactory
* @see EclipseLink2_1JpaPlatformFactory#VERSION
* @see EclipseLink2_2JpaPlatformFactory#VERSION
* @see EclipseLink2_3JpaPlatformFactory#VERSION
+ * @see EclipseLink2_4JpaPlatformFactory#VERSION
+ * @see EclipseLink2_5JpaPlatformFactory#VERSION
*/
public boolean isCompatibleWithEclipseLinkVersion(String version) {
return VersionComparator.INTEGER_VERSION_COMPARATOR.compare(this.eclipseLinkVersion, version) >= 0;
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_5Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_5Definition.java
new file mode 100644
index 0000000..91d4741
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_5Definition.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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.eclipselink.core.internal.context.orm;
+
+import java.util.ArrayList;
+
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.utility.internal.collection.CollectionTools;
+import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
+import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
+import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
+import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
+import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_5.EclipseLink2_5;
+
+
+public class EclipseLinkOrmXml2_5Definition
+ extends AbstractEclipseLinkOrmXmlDefinition {
+
+ // singleton
+ private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml2_5Definition();
+
+
+ /**
+ * Return the singleton.
+ */
+ public static OrmXmlDefinition instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Enforce singleton usage
+ */
+ private EclipseLinkOrmXml2_5Definition() {
+ super();
+ }
+
+
+ public JptResourceType getResourceType() {
+ return this.getResourceType(XmlEntityMappings.CONTENT_TYPE, EclipseLink2_5.SCHEMA_VERSION);
+ }
+
+ @Override
+ protected OrmXmlContextNodeFactory buildContextNodeFactory() {
+ return new EclipseLinkOrmXml2_4ContextNodeFactory();
+ }
+
+ @Override
+ protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
+ CollectionTools.addAll(definitions, EclipseLinkOrmXml2_3Definition.ECLIPSELINK_2_3_ATTRIBUTE_MAPPING_DEFINITIONS);
+ }
+
+} \ 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/operations/EclipseLinkOrmFileCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
index 79b5b2f..43c3d17 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
@@ -10,19 +10,10 @@
package org.eclipse.jpt.jpa.eclipselink.core.internal.operations;
import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
import org.eclipse.jpt.jpa.core.JpaPlatform;
import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
public class EclipseLinkOrmFileCreationDataModelProvider
@@ -52,28 +43,6 @@ public class EclipseLinkOrmFileCreationDataModelProvider
}
@Override
- protected boolean fileVersionSupported(String fileVersion) {
- return ArrayTools.contains(ECLIPSE_LINK_SCHEMA_VERSIONS, fileVersion);
- }
-
- protected static final String[] ECLIPSE_LINK_SCHEMA_VERSIONS = new String[] {
- EclipseLink.SCHEMA_VERSION,
- EclipseLink1_1.SCHEMA_VERSION,
- EclipseLink1_2.SCHEMA_VERSION,
- EclipseLink2_0.SCHEMA_VERSION,
- EclipseLink2_1.SCHEMA_VERSION,
- EclipseLink2_2.SCHEMA_VERSION,
- EclipseLink2_3.SCHEMA_VERSION,
- EclipseLink2_4.SCHEMA_VERSION
- };
-
- @Override
- protected boolean fileVersionSupportedForFacetVersion(String fileVersion, String jpaFacetVersion) {
- // assume that platform has been policed for facet version already
- return true;
- }
-
- @Override
protected boolean platformIsSupported(JpaPlatform jpaPlatform) {
return jpaPlatform.getConfig().getGroupConfig().equals(EclipseLinkPlatform.GROUP);
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java
index 1916a9d..0d1b2aa 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java
@@ -47,6 +47,8 @@ public class EclipseLinkPlatform {
public static final JpaPlatformConfig VERSION_2_4 = getJpaPlatformConfig("eclipselink2_4"); //$NON-NLS-1$
+ public static final JpaPlatformConfig VERSION_2_5 = getJpaPlatformConfig("eclipselink2_5"); //$NON-NLS-1$
+
private static JpaPlatformGroupConfig getJpaPlatformGroupConfig(String platformGroupID) {
return getJpaPlatformManager().getJpaPlatformGroupConfig(platformGroupID);
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java
index a78dc7f..3a60f1f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java
@@ -59,6 +59,7 @@ import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntityMappings_2_4;
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlUuidGenerator_2_4;
+import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_5.EclipseLink2_5;
import org.eclipse.wst.common.internal.emf.resource.Translator;
/**
@@ -1343,7 +1344,7 @@ public class XmlEntityMappings extends org.eclipse.jpt.jpa.core.resource.orm.Xml
// ********** version -> schema location mapping **********
- private static HashMap<String, String> SCHEMA_LOCATIONS = buildSchemaLocations();
+ public static final HashMap<String, String> SCHEMA_LOCATIONS = buildSchemaLocations();
private static HashMap<String, String> buildSchemaLocations() {
HashMap<String, String> map = new HashMap<String, String>();
@@ -1355,6 +1356,7 @@ public class XmlEntityMappings extends org.eclipse.jpt.jpa.core.resource.orm.Xml
map.put(EclipseLink2_2.SCHEMA_VERSION, EclipseLink2_2.SCHEMA_LOCATION);
map.put(EclipseLink2_3.SCHEMA_VERSION, EclipseLink2_3.SCHEMA_LOCATION);
map.put(EclipseLink2_4.SCHEMA_VERSION, EclipseLink2_4.SCHEMA_LOCATION);
+ map.put(EclipseLink2_5.SCHEMA_VERSION, EclipseLink2_5.SCHEMA_LOCATION);
return map;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java
index a0591ee..0eff78c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java
@@ -10,12 +10,12 @@
package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
+import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
@SuppressWarnings("nls")
public interface EclipseLink2_4
- extends EclipseLink2_2
+ extends EclipseLink2_3
{
String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_4.xsd";
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_5/EclipseLink2_5.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_5/EclipseLink2_5.java
new file mode 100644
index 0000000..2d07da0
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_5/EclipseLink2_5.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * 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.eclipselink.core.resource.orm.v2_5;
+
+import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
+import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
+
+
+@SuppressWarnings("nls")
+public interface EclipseLink2_5
+ extends EclipseLink2_4
+{
+ String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
+ String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_5.xsd";
+ String SCHEMA_VERSION = "2.5";
+
+ // EclipseLink 2.5 specific nodes
+
+} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.xml b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.xml
index 212aa26..eb3ec91 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.xml
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.xml
@@ -53,6 +53,11 @@
id="eclipselink2_4.ui"
jpaPlatform="eclipselink2_4"
factoryClass="org.eclipse.jpt.jpa.eclipselink.ui.internal.platform.EclipseLink2_4JpaPlatformUiFactory"/>
+
+ <jpaPlatformUi
+ id="eclipselink2_5.ui"
+ jpaPlatform="eclipselink2_5"
+ factoryClass="org.eclipse.jpt.jpa.eclipselink.ui.internal.platform.EclipseLink2_5JpaPlatformUiFactory"/>
</extension>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/UpgradeToEclipseLinkMappingFileXmlResourceHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/UpgradeToEclipseLinkMappingFileXmlResourceHandler.java
index fa2d4a7..7f38f9d 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/UpgradeToEclipseLinkMappingFileXmlResourceHandler.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/UpgradeToEclipseLinkMappingFileXmlResourceHandler.java
@@ -11,7 +11,6 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.commands;
import java.io.File;
import java.io.IOException;
-import java.util.HashMap;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
@@ -34,13 +33,6 @@ import org.eclipse.jpt.common.core.resource.xml.JptXmlResource;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.plugin.JptJpaEclipseLinkUiPlugin;
import org.eclipse.ui.handlers.HandlerUtil;
import org.w3c.dom.Document;
@@ -130,22 +122,10 @@ public class UpgradeToEclipseLinkMappingFileXmlResourceHandler
}
protected static String getSchemaLocationForVersion(String schemaVersion) {
- return SCHEMA_LOCATIONS.get(schemaVersion);
- }
-
- private static HashMap<String, String> SCHEMA_LOCATIONS = buildSchemaLocations();
-
- private static HashMap<String, String> buildSchemaLocations() {
- HashMap<String, String> map = new HashMap<String, String>();
- map.put(EclipseLink.SCHEMA_VERSION, EclipseLink.SCHEMA_LOCATION);
- map.put(EclipseLink1_1.SCHEMA_VERSION, EclipseLink1_1.SCHEMA_LOCATION);
- map.put(EclipseLink1_2.SCHEMA_VERSION, EclipseLink1_2.SCHEMA_LOCATION);
- map.put(EclipseLink2_0.SCHEMA_VERSION, EclipseLink2_0.SCHEMA_LOCATION);
- map.put(EclipseLink2_1.SCHEMA_VERSION, EclipseLink2_1.SCHEMA_LOCATION);
- map.put(EclipseLink2_2.SCHEMA_VERSION, EclipseLink2_2.SCHEMA_LOCATION);
- map.put(EclipseLink2_3.SCHEMA_VERSION, EclipseLink2_3.SCHEMA_LOCATION);
- map.put(EclipseLink2_4.SCHEMA_VERSION, EclipseLink2_4.SCHEMA_LOCATION);
- return map;
+ String schemaLocation = XmlEntityMappings.SCHEMA_LOCATIONS.get(schemaVersion);
+ if (schemaLocation == null) {
+ JptJpaEclipseLinkUiPlugin.instance().logError(new Throwable("No schema location defined for version: " + schemaVersion)); //$NON-NLS-1$
+ }
+ return schemaLocation;
}
-
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_5UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_5UiDefinition.java
new file mode 100644
index 0000000..04d86cf
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_5UiDefinition.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * 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.eclipselink.ui.internal.details.orm;
+
+import java.util.List;
+
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.jpa.core.context.AttributeMapping;
+import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_5Definition;
+import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmBasicMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmIdMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmElementCollectionMapping2_0UiDefinition;
+
+
+public class EclipseLinkOrmXml2_5UiDefinition
+ extends EclipseLinkOrmXml2_1UiDefinition
+{
+ // singleton
+ private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml2_5UiDefinition();
+
+
+ /**
+ * Return the singleton
+ */
+ public static ResourceUiDefinition instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Enforce singleton usage
+ */
+ private EclipseLinkOrmXml2_5UiDefinition() {
+ super();
+ }
+
+ @Override
+ protected OrmXmlUiFactory buildOrmXmlUiFactory() {
+ return new EclipseLinkOrmXml2_3UiFactory();
+ }
+
+ @Override
+ public boolean providesUi(JptResourceType resourceType) {
+ return resourceType.equals(EclipseLinkOrmXml2_5Definition.instance().getResourceType());
+ }
+
+ @Override
+ protected void addOrmAttributeMappingUiDefinitionsTo(List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
+ definitions.add(OrmIdMappingUiDefinition.instance());
+ definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
+ definitions.add(OrmBasicMappingUiDefinition.instance());
+ definitions.add(OrmVersionMappingUiDefinition.instance());
+ definitions.add(OrmManyToOneMappingUiDefinition.instance());
+ definitions.add(OrmOneToManyMappingUiDefinition.instance());
+ definitions.add(OrmOneToOneMappingUiDefinition.instance());
+ definitions.add(OrmManyToManyMappingUiDefinition.instance());
+ definitions.add(OrmEmbeddedMappingUiDefinition.instance());
+ definitions.add(OrmTransientMappingUiDefinition.instance());
+
+ definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
+ definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
+ definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
+ definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
+
+ definitions.add(OrmElementCollectionMapping2_0UiDefinition.instance());
+ definitions.add(OrmEclipseLinkArrayMapping2_3UiDefinition.instance());
+ definitions.add(OrmEclipseLinkStructureMapping2_3UiDefinition.instance());
+ }
+} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_5JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_5JpaPlatformUiFactory.java
new file mode 100644
index 0000000..82fce86
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_5JpaPlatformUiFactory.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * 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.eclipselink.ui.internal.platform;
+
+import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
+
+public class EclipseLink2_5JpaPlatformUiFactory
+ extends EclipseLink2_0JpaPlatformUiFactory
+{
+ /**
+ * Zero arg constructor for extension point
+ */
+ public EclipseLink2_5JpaPlatformUiFactory() {
+ super();
+ }
+
+ @Override
+ public JpaPlatformUi buildJpaPlatformUi() {
+ return new EclipseLink2_0JpaPlatformUi(
+ EclipseLinkJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
+ EclipseLink2_5JpaPlatformUiProvider.instance()
+ );
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_5JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_5JpaPlatformUiProvider.java
new file mode 100644
index 0000000..0e5a58f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_5JpaPlatformUiProvider.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * 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.eclipselink.ui.internal.platform;
+
+import java.util.List;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.EclipseLink2_3JavaResourceUiDefinition;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappings2_0DetailsProvider;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappings2_3DetailsProvider;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_1UiDefinition;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_2UiDefinition;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_0UiDefinition;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_1UiDefinition;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_2UiDefinition;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_3UiDefinition;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_4UiDefinition;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_5UiDefinition;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
+import org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.EclipseLinkPersistenceXml2_4UiDefinition;
+import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
+import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmXml2_0UiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmXml2_1UiDefinition;
+
+
+public class EclipseLink2_5JpaPlatformUiProvider
+ extends AbstractJpaPlatformUiProvider {
+
+ // singleton
+ private static final JpaPlatformUiProvider INSTANCE = new EclipseLink2_5JpaPlatformUiProvider();
+
+
+ /**
+ * Return the singleton.
+ */
+ public static JpaPlatformUiProvider instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Ensure single instance.
+ */
+ private EclipseLink2_5JpaPlatformUiProvider() {
+ super();
+ }
+
+
+ // ********** details providers **********
+
+ @Override
+ protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
+ providers.add(JavaPersistentTypeDetailsProvider.instance());
+ providers.add(JavaPersistentAttributeDetailsProvider.instance());
+ providers.add(EntityMappingsDetailsProvider.instance());
+ providers.add(OrmPersistentTypeDetailsProvider.instance());
+ providers.add(OrmPersistentAttributeDetailsProvider.instance());
+ providers.add(EntityMappings2_0DetailsProvider.instance());
+ providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
+ providers.add(EclipseLinkEntityMappings2_0DetailsProvider.instance());
+ providers.add(EclipseLinkEntityMappings2_3DetailsProvider.instance());
+ }
+
+
+ // ********** resource ui definitions **********
+
+ @Override
+ protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
+ definitions.add(EclipseLink2_3JavaResourceUiDefinition.instance());
+ definitions.add(OrmXmlUiDefinition.instance());
+ definitions.add(OrmXml2_0UiDefinition.instance());
+ definitions.add(OrmXml2_1UiDefinition.instance());
+ definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
+ definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
+ definitions.add(EclipseLinkOrmXml1_2UiDefinition.instance());
+ definitions.add(EclipseLinkOrmXml2_0UiDefinition.instance());
+ definitions.add(EclipseLinkOrmXml2_1UiDefinition.instance());
+ definitions.add(EclipseLinkOrmXml2_2UiDefinition.instance());
+ definitions.add(EclipseLinkOrmXml2_3UiDefinition.instance());
+ definitions.add(EclipseLinkOrmXml2_4UiDefinition.instance());
+ definitions.add(EclipseLinkOrmXml2_5UiDefinition.instance());
+ definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
+ definitions.add(EclipseLinkPersistenceXml2_4UiDefinition.instance());
+ }
+} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml b/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml
index ecbdeeb..133c4be 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml
@@ -226,6 +226,11 @@
id="generic2_0.ui"
jpaPlatform="generic2_0"
factoryClass="org.eclipse.jpt.jpa.ui.internal.jpa2.platform.generic.Generic2_0JpaPlatformUiFactory"/>
+
+ <jpaPlatformUi
+ id="generic2_1.ui"
+ jpaPlatform="generic2_1"
+ factoryClass="org.eclipse.jpt.jpa.ui.internal.jpa2.platform.generic.Generic2_1JpaPlatformUiFactory"/>
</extension>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Generic2_1JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Generic2_1JpaPlatformUiProvider.java
new file mode 100644
index 0000000..29c15d0
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Generic2_1JpaPlatformUiProvider.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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.ui.internal.jpa2;
+
+import java.util.List;
+import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
+import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.details.java.Generic2_0JavaResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmXml2_0UiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmXml2_1UiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.PersistenceXml2_0UiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceXmlUiDefinition;
+
+/**
+ * All the state in the JPA platform should be "static" (i.e. unchanging once
+ * it is initialized).
+ */
+public class Generic2_1JpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
+{
+
+ // singleton
+ private static final JpaPlatformUiProvider INSTANCE = new Generic2_1JpaPlatformUiProvider();
+
+ /**
+ * Return the singleton.
+ */
+ public static JpaPlatformUiProvider instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Ensure single instance.
+ */
+ private Generic2_1JpaPlatformUiProvider() {
+ super();
+ }
+
+
+ // ********** details providers **********
+
+ @Override
+ protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
+ providers.add(JavaPersistentTypeDetailsProvider.instance());
+ providers.add(JavaPersistentAttributeDetailsProvider.instance());
+ providers.add(EntityMappingsDetailsProvider.instance());
+ providers.add(OrmPersistentTypeDetailsProvider.instance());
+ providers.add(OrmPersistentAttributeDetailsProvider.instance());
+ providers.add(EntityMappings2_0DetailsProvider.instance());
+ }
+
+
+ // ********** resource ui definitions **********
+
+ @Override
+ protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
+ definitions.add(Generic2_0JavaResourceUiDefinition.instance());
+ definitions.add(OrmXmlUiDefinition.instance());
+ definitions.add(OrmXml2_0UiDefinition.instance());
+ definitions.add(OrmXml2_1UiDefinition.instance());
+ definitions.add(PersistenceXmlUiDefinition.instance());
+ definitions.add(PersistenceXml2_0UiDefinition.instance());
+ }
+} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmXml2_1UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmXml2_1UiDefinition.java
new file mode 100644
index 0000000..7f7f6e0
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmXml2_1UiDefinition.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * 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.ui.internal.jpa2.details.orm;
+
+import java.util.List;
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
+import org.eclipse.jpt.jpa.core.context.AttributeMapping;
+import org.eclipse.jpt.jpa.core.context.TypeMapping;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmXml2_1Definition;
+import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmBasicMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddableUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEntityUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmIdMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.GenericOrmXml2_0UiFactory;
+
+public class OrmXml2_1UiDefinition
+ extends AbstractOrmXmlResourceUiDefinition
+{
+ // singleton
+ private static final ResourceUiDefinition INSTANCE = new OrmXml2_1UiDefinition();
+
+
+ /**
+ * Return the singleton
+ */
+ public static ResourceUiDefinition instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Enforce singleton usage
+ */
+ private OrmXml2_1UiDefinition() {
+ super();
+ }
+
+
+ @Override
+ protected OrmXmlUiFactory buildOrmXmlUiFactory() {
+ return new GenericOrmXml2_0UiFactory();
+ }
+
+ public boolean providesUi(JptResourceType resourceType) {
+ return resourceType.equals(GenericOrmXml2_1Definition.instance().getResourceType());
+ }
+
+ public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
+ return OrmXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
+ }
+
+ @Override
+ protected void addOrmAttributeMappingUiDefinitionsTo(List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
+ definitions.add(OrmIdMappingUiDefinition.instance());
+ definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
+ definitions.add(OrmBasicMappingUiDefinition.instance());
+ definitions.add(OrmVersionMappingUiDefinition.instance());
+ definitions.add(OrmManyToOneMappingUiDefinition.instance());
+ definitions.add(OrmOneToManyMappingUiDefinition.instance());
+ definitions.add(OrmOneToOneMappingUiDefinition.instance());
+ definitions.add(OrmManyToManyMappingUiDefinition.instance());
+ definitions.add(OrmEmbeddedMappingUiDefinition.instance());
+ definitions.add(OrmTransientMappingUiDefinition.instance());
+
+ definitions.add(OrmElementCollectionMapping2_0UiDefinition.instance());
+ }
+
+ @Override
+ protected void addOrmTypeMappingUiDefinitionsTo(List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
+ definitions.add(OrmEntityUiDefinition.instance());
+ definitions.add(OrmMappedSuperclassUiDefinition.instance());
+ definitions.add(OrmEmbeddableUiDefinition.instance());
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/platform/generic/Generic2_1JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/platform/generic/Generic2_1JpaPlatformUiFactory.java
new file mode 100644
index 0000000..2b39f48
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/platform/generic/Generic2_1JpaPlatformUiFactory.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 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.ui.internal.jpa2.platform.generic;
+
+import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
+import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.Generic2_0JpaPlatformUiProvider;
+import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUi;
+import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUiFactory;
+
+public class Generic2_1JpaPlatformUiFactory
+ implements JpaPlatformUiFactory
+{
+ /**
+ * Zero arg constructor for extension point
+ */
+ public Generic2_1JpaPlatformUiFactory() {
+ super();
+ }
+
+ public JpaPlatformUi buildJpaPlatformUi() {
+ return new GenericJpaPlatformUi(
+ GenericJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
+ Generic2_0JpaPlatformUiProvider.instance()
+ );
+ }
+}