Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshminarayana Nekkanti2018-09-25 03:41:59 +0000
committerLakshminarayana Nekkanti2020-02-05 22:52:20 +0000
commite36bfbad4a2381f3e9490e383b2a67da16744dbf (patch)
tree6765b42a8ffe384d626e23a7950de40ba4ee2571
parent06199397f5dd8ff785c2974e2840a455a09788e1 (diff)
downloadwebtools.dali-master.tar.gz
webtools.dali-master.tar.xz
webtools.dali-master.zip
Bug 522302 - [JPA 2.2] Missing project facet and false error forHEADR3_18master
persistence.xml Change-Id: I07477d1e6a65274be5963b2c3eeefbe0da209c36 Signed-off-by: Lakshminarayana Nekkanti <narayana.nekkanti@gmail.com>
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/feature.xml3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/pom.xml2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/META-INF/MANIFEST.MF7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntityMappings.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/persistence/XmlPersistence.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/plugin.xml32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/pom.xml2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/AbstractJpaProject.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceXmlContextModel.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/context/persistence/schemagen/NullGenericSchemaGeneration2_2.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaFactory2_2.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaPlatformFactory2_2.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaPlatformProvider2_2.java196
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/orm/GenericOrmXmlDefinition2_2.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/persistence/GenericPersistenceXmlContextModelFactory2_2.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/persistence/GenericPersistenceXmlDefinition2_2.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/persistence/schemagen/GenericSchemaGeneration2_2.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericEclipseLinkBundlesLibraryValidator.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/libval/GenericJpaUserLibraryValidator.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/JpaFactory2_2.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/JpaProject2_2.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/context/persistence/PersistenceUnit2_2.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/context/persistence/PersistenceXmlContextModelFactory2_2.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/context/persistence/schemagen/SchemaGeneration2_2.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/v2_2/JPA2_2.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/persistence/v2_2/JPA2_2.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/pom.xml2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/details/orm/GenericOrmXmlUiFactory2_2.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/GenericJpaPlatformUiProvider2_2.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/details/orm/OrmEntityComposite2_2.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/details/orm/OrmXmlUiDefinition2_2.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/DataLoadingComposite2_2.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceUnitSchemaGenerationEditorPage2_2.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceUnitSchemaGenerationEditorPageDefinition2_2.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceXmlUiDefinition2_2.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/SchemaGenerationComposite2_2.java537
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/platform/generic/GenericJpaPlatformUiFactory2_2.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2_2/details/JpaUiFactory2_2.java16
42 files changed, 1872 insertions, 24 deletions
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa.feature/feature.xml
index 623b18f2fc..6f8eb07bef 100644
--- a/jpa/features/org.eclipse.jpt.jpa.feature/feature.xml
+++ b/jpa/features/org.eclipse.jpt.jpa.feature/feature.xml
@@ -11,11 +11,10 @@
Contributors:
IBM Corporation - initial API and implementation
-->
-
<feature
id="org.eclipse.jpt.jpa.feature"
label="%featureName"
- version="3.5.101.qualifier"
+ version="3.6.0.qualifier"
provider-name="%providerName"
plugin="org.eclipse.jpt.jpa.branding"
license-feature="org.eclipse.license"
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/pom.xml b/jpa/features/org.eclipse.jpt.jpa.feature/pom.xml
index 14feb367ba..76b75c760c 100644
--- a/jpa/features/org.eclipse.jpt.jpa.feature/pom.xml
+++ b/jpa/features/org.eclipse.jpt.jpa.feature/pom.xml
@@ -22,7 +22,7 @@
<groupId>org.eclipse.webtools.dali</groupId>
<artifactId>org.eclipse.jpt.jpa.feature</artifactId>
- <version>3.5.101-SNAPSHOT</version>
+ <version>3.6.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<build>
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 37b2076057..56a2c30b46 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
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.jpt.jpa.core;singleton:=true
-Bundle-Version: 3.5.1.qualifier
+Bundle-Version: 3.6.0.qualifier
Bundle-Activator: org.eclipse.jpt.jpa.core.internal.plugin.JptJpaCorePlugin
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
@@ -72,6 +72,9 @@ Export-Package: org.eclipse.jpt.jpa.core,
org.eclipse.jpt.jpa.core.internal.jpa2_1.resource.java;x-internal:=true,
org.eclipse.jpt.jpa.core.internal.jpa2_1.resource.java.binary;x-internal:=true,
org.eclipse.jpt.jpa.core.internal.jpa2_1.resource.java.source;x-internal:=true,
+ org.eclipse.jpt.jpa.core.internal.jpa2_2;x-internal:=true,
+ org.eclipse.jpt.jpa.core.internal.jpa2_2.context.orm;x-internal:=true,
+ org.eclipse.jpt.jpa.core.internal.jpa2_2.context.persistence;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,
@@ -98,6 +101,8 @@ Export-Package: org.eclipse.jpt.jpa.core,
org.eclipse.jpt.jpa.core.jpa2_1.context.persistence,
org.eclipse.jpt.jpa.core.jpa2_1.context.persistence.schemagen,
org.eclipse.jpt.jpa.core.jpa2_1.resource.java,
+ org.eclipse.jpt.jpa.core.jpa2_2.context.persistence,
+ org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.schemagen,
org.eclipse.jpt.jpa.core.jpql,
org.eclipse.jpt.jpa.core.jpql.spi,
org.eclipse.jpt.jpa.core.libprov,
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntityMappings.java b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntityMappings.java
index 6c60fbc556..b6af306145 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntityMappings.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/orm/XmlEntityMappings.java
@@ -30,6 +30,7 @@ import org.eclipse.jpt.jpa.core.resource.orm.v2_1.XmlConverter_2_1;
import org.eclipse.jpt.jpa.core.resource.orm.v2_1.XmlEntityMappings_2_1;
import org.eclipse.jpt.jpa.core.resource.orm.v2_1.XmlNamedStoredProcedureQuery_2_1;
import org.eclipse.jpt.jpa.core.resource.orm.v2_1.XmlQueryContainer_2_1;
+import org.eclipse.jpt.jpa.core.resource.orm.v2_2.JPA2_2;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.jpa.core.internal.plugin.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
@@ -1168,6 +1169,7 @@ public class XmlEntityMappings extends ERootObjectImpl implements XmlQueryContai
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);
+ map.put(JPA2_2.SCHEMA_VERSION, JPA2_2.SCHEMA_LOCATION);
return map;
}
@@ -1186,6 +1188,7 @@ public class XmlEntityMappings extends ERootObjectImpl implements XmlQueryContai
map.put(JPA.SCHEMA_VERSION, JPA.SCHEMA_NAMESPACE);
map.put(JPA2_0.SCHEMA_VERSION, JPA2_0.SCHEMA_NAMESPACE);
map.put(JPA2_1.SCHEMA_VERSION, JPA2_1.SCHEMA_NAMESPACE);
+ map.put(JPA2_2.SCHEMA_VERSION, JPA2_2.SCHEMA_NAMESPACE);
return map;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/persistence/XmlPersistence.java b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/persistence/XmlPersistence.java
index 17e9ccf368..784108892c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/persistence/XmlPersistence.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/model/src/org/eclipse/jpt/jpa/core/resource/persistence/XmlPersistence.java
@@ -26,6 +26,7 @@ import org.eclipse.jpt.common.core.resource.xml.ERootObjectImpl;
import org.eclipse.jpt.jpa.core.internal.plugin.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.resource.persistence.v2_0.JPA2_0;
import org.eclipse.jpt.jpa.core.resource.persistence.v2_1.JPA2_1;
+import org.eclipse.jpt.jpa.core.resource.persistence.v2_2.JPA2_2;
import org.eclipse.wst.common.internal.emf.resource.Translator;
/**
@@ -211,6 +212,7 @@ public class XmlPersistence extends ERootObjectImpl
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);
+ map.put(JPA2_2.SCHEMA_VERSION, JPA2_2.SCHEMA_LOCATION);
return map;
}
@@ -229,6 +231,7 @@ public class XmlPersistence extends ERootObjectImpl
map.put(JPA.SCHEMA_VERSION, JPA.SCHEMA_NAMESPACE);
map.put(JPA2_0.SCHEMA_VERSION, JPA2_0.SCHEMA_NAMESPACE);
map.put(JPA2_1.SCHEMA_VERSION, JPA2_1.SCHEMA_NAMESPACE);
+ map.put(JPA2_2.SCHEMA_VERSION, JPA2_2.SCHEMA_NAMESPACE);
return map;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties
index f3b694a452..30937ad75b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.properties
@@ -36,6 +36,7 @@ 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
+GENERIC_2_2_PLATFORM_LABEL=Generic 2.2
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 c75ace8dd1..90adc1817e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.xml
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/plugin.xml
@@ -61,6 +61,13 @@
forcePluginActivation="true"/>
</definition>
+ <!-- Return whether a resource's project has the JPA 2.2 facet. -->
+ <definition id="org.eclipse.jpt.jpa.expression.hasJpa2_2Facet">
+ <test property="org.eclipse.wst.common.project.facet.core.projectFacet"
+ value="jpt.jpa:2.2"
+ forcePluginActivation="true"/>
+ </definition>
+
<!--
Return whether a resource's project (or any project referencing the resource's project)
has the JPA facet.
@@ -229,6 +236,11 @@
version="2.1"/>
<resource-type
+ content-type="org.eclipse.jpt.jpa.core.content.persistence"
+ id="org.eclipse.jpt.jpa.core.resource.persistence_2_2"
+ version="2.2"/>
+
+ <resource-type
id="org.eclipse.jpt.jpa.core.resource.orm_1_0"
content-type="org.eclipse.jpt.jpa.core.content.orm"
version="1.0"/>
@@ -243,6 +255,11 @@
content-type="org.eclipse.jpt.jpa.core.content.orm"
version="2.1"/>
+ <resource-type
+ id="org.eclipse.jpt.jpa.core.resource.orm_2_2"
+ content-type="org.eclipse.jpt.jpa.core.content.orm"
+ version="2.2"/>
+
</extension>
@@ -347,6 +364,14 @@
jpaFacetVersion="2.1"
default="false"/>
+ <jpaPlatform
+ id="generic2_2"
+ label="%GENERIC_2_2_PLATFORM_LABEL"
+ factoryClass="org.eclipse.jpt.jpa.core.internal.jpa2_2.GenericJpaPlatformFactory2_2"
+ group="generic"
+ jpaFacetVersion="2.2"
+ default="false"/>
+
</extension>
@@ -367,7 +392,6 @@
</extension>
-
<!-- ***** library validators ***** -->
<extension
@@ -618,6 +642,12 @@
</constraint>
</project-facet-version>
+ <project-facet-version facet="jpt.jpa" version="2.2">
+ <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/pom.xml b/jpa/plugins/org.eclipse.jpt.jpa.core/pom.xml
index fef837c9dd..51005ca7b3 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/pom.xml
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/pom.xml
@@ -22,6 +22,6 @@
<groupId>org.eclipse.webtools.dali</groupId>
<artifactId>org.eclipse.jpt.jpa.core</artifactId>
- <version>3.5.1-SNAPSHOT</version>
+ <version>3.6.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
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 47e15fd347..9b6921fd8b 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
@@ -88,7 +88,7 @@ import org.eclipse.jpt.jpa.core.internal.plugin.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.jpa2.JpaMetamodelSynchronizer2_0;
import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
import org.eclipse.jpt.jpa.core.jpa2.context.JpaContextRoot2_0;
-import org.eclipse.jpt.jpa.core.jpa2_1.JpaProject2_1;
+import org.eclipse.jpt.jpa.core.jpa2_2.JpaProject2_2;
import org.eclipse.jpt.jpa.core.libprov.JpaLibraryProviderInstallOperationConfig;
import org.eclipse.jpt.jpa.core.resource.ResourceMappingFile;
import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
@@ -126,7 +126,7 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
*/
public abstract class AbstractJpaProject
extends AbstractJpaModel<JpaModel>
- implements JpaProject2_1
+ implements JpaProject2_2
{
/**
* The JPA project manager.
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java
index d18c2b0a17..fe5cbf37f1 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java
@@ -1,8 +1,8 @@
/*******************************************************************************
- * Copyright (c) 2007, 2016 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2018 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0, which accompanies this distribution
- * and is available at https://www.eclipse.org/legal/epl-2.0/.
+ * 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
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.runtime.CoreException;
@@ -89,7 +90,7 @@ import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.persistence.connection.NullConnection2_0;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.persistence.options.NullOptions2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2_1.context.persistence.schemagen.NullGenericSchemaGeneration2_1;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.context.persistence.schemagen.NullGenericSchemaGeneration2_2;
import org.eclipse.jpt.jpa.core.internal.plugin.JptJpaCorePlugin;
import org.eclipse.jpt.jpa.core.jpa2.JpaFactory2_0;
import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
@@ -100,8 +101,8 @@ import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.Connection2_
import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.Options2_0;
import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode2_0;
import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.ValidationMode2_0;
-import org.eclipse.jpt.jpa.core.jpa2_1.context.persistence.PersistenceUnit2_1;
-import org.eclipse.jpt.jpa.core.jpa2_1.context.persistence.schemagen.SchemaGeneration2_1;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.PersistenceUnit2_2;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.schemagen.SchemaGeneration2_2;
import org.eclipse.jpt.jpa.core.jpql.JpaJpqlQueryHelper;
import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
@@ -125,7 +126,7 @@ import org.eclipse.wst.validation.internal.provisional.core.IReporter;
*/
public abstract class AbstractPersistenceUnit
extends AbstractPersistenceXmlContextModel<Persistence>
- implements PersistenceUnit2_1
+ implements PersistenceUnit2_2
{
protected final XmlPersistenceUnit xmlPersistenceUnit;
@@ -207,8 +208,8 @@ public abstract class AbstractPersistenceUnit
protected final Set<IFile> metamodelFiles = Collections.synchronizedSet(new HashSet<IFile>());
- //****** JPA 2.1 features
- protected SchemaGeneration2_1 schemaGeneration;
+ //****** JPA 2.2 features
+ protected SchemaGeneration2_2 schemaGeneration;
// ********** construction/initialization **********
@@ -1180,10 +1181,10 @@ public abstract class AbstractPersistenceUnit
new NullOptions2_0(this);
}
- protected SchemaGeneration2_1 buildSchemaGeneration() {
- return this.isPersistenceXml2_1Compatible() ?
- this.getContextModelFactory2_1().buildSchemaGeneration(this) :
- new NullGenericSchemaGeneration2_1(this);
+ protected SchemaGeneration2_2 buildSchemaGeneration() {
+ return this.isPersistenceXml2_2Compatible() ?
+ this.getContextModelFactory2_2().buildSchemaGeneration(this) :
+ new NullGenericSchemaGeneration2_2(this);
}
protected void syncProperties(IProgressMonitor monitor) {
@@ -1406,7 +1407,7 @@ public abstract class AbstractPersistenceUnit
// ********** PersistenceUnit2_1 implementation **********
- public SchemaGeneration2_1 getSchemaGeneration() {
+ public SchemaGeneration2_2 getSchemaGeneration() {
return this.schemaGeneration;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceXmlContextModel.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceXmlContextModel.java
index c33bdcb35a..4e828b900b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceXmlContextModel.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceXmlContextModel.java
@@ -16,8 +16,10 @@ import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlDefinition;
import org.eclipse.jpt.jpa.core.internal.context.AbstractJpaContextModel;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.persistence.GenericPersistenceXmlDefinition2_0;
import org.eclipse.jpt.jpa.core.internal.jpa2_1.context.persistence.GenericPersistenceXmlDefinition2_1;
+import org.eclipse.jpt.jpa.core.internal.jpa2_2.context.persistence.GenericPersistenceXmlDefinition2_2;
import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceXmlContextModelFactory2_0;
import org.eclipse.jpt.jpa.core.jpa2_1.context.persistence.PersistenceXmlContextModelFactory2_1;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.PersistenceXmlContextModelFactory2_2;
/**
* Use this abstract class for context models that are part of an
@@ -51,6 +53,10 @@ public abstract class AbstractPersistenceXmlContextModel<P extends JpaContextMod
return this.getResourceType().isKindOf(GenericPersistenceXmlDefinition2_1.instance().getResourceType());
}
+ protected boolean isPersistenceXml2_2Compatible() {
+ return this.getResourceType().isKindOf(GenericPersistenceXmlDefinition2_2.instance().getResourceType());
+ }
+
/**
* Call {@link #isPersistenceXml2_0Compatible()} before calling this method.
*/
@@ -65,6 +71,13 @@ public abstract class AbstractPersistenceXmlContextModel<P extends JpaContextMod
return (PersistenceXmlContextModelFactory2_1) this.getContextModelFactory();
}
+ /**
+ * Call {@link #isPersistenceXml2_1Compatible()} before calling this method.
+ */
+ protected PersistenceXmlContextModelFactory2_2 getContextModelFactory2_2() {
+ return (PersistenceXmlContextModelFactory2_2) this.getContextModelFactory();
+ }
+
protected PersistenceXmlContextModelFactory getContextModelFactory() {
return this.getPersistenceXmlDefinition().getContextModelFactory();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/context/persistence/schemagen/NullGenericSchemaGeneration2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/context/persistence/schemagen/NullGenericSchemaGeneration2_2.java
new file mode 100644
index 0000000000..d24bd07574
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_1/context/persistence/schemagen/NullGenericSchemaGeneration2_2.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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.context.persistence.schemagen;
+
+import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.schemagen.SchemaGeneration2_2;
+
+/**
+ * schema generation
+ */
+public class NullGenericSchemaGeneration2_2 extends NullGenericSchemaGeneration2_1 implements SchemaGeneration2_2 {
+
+ public NullGenericSchemaGeneration2_2(PersistenceUnit parent) {
+ super(parent);
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaFactory2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaFactory2_2.java
new file mode 100644
index 0000000000..9600cdf4d9
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaFactory2_2.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2;
+
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.GenericJpaFactory2_1;
+import org.eclipse.jpt.jpa.core.jpa2_2.JpaFactory2_2;
+
+/**
+ * Central class that allows extenders to easily replace implementations of
+ * various Dali interfaces.
+ */
+public class GenericJpaFactory2_2 extends GenericJpaFactory2_1 implements JpaFactory2_2 {
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaPlatformFactory2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaPlatformFactory2_2.java
new file mode 100644
index 0000000000..36613bb138
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaPlatformFactory2_2.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2;
+
+import org.eclipse.jpt.jpa.core.JpaPlatform;
+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_1.GenericJpaAnnotationDefinitionProvider2_1;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.GenericJpaPlatformFactory2_1;
+import org.eclipse.persistence.jpa.jpql.parser.JPQLGrammar2_1;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+/**
+ * All the state in the JPA platform should be "static" (i.e. unchanging once it
+ * is initialized).
+ */
+public class GenericJpaPlatformFactory2_2 extends GenericJpaPlatformFactory2_1 {
+ public static final String ID = "generic2_2"; //$NON-NLS-1$
+
+ public JpaPlatform buildJpaPlatform(JpaPlatform.Config config) {
+ return new GenericJpaPlatform(config, this.buildJpaVersion(config.getJpaFacetVersion()),
+ new GenericJpaFactory2_2(),
+ new JpaAnnotationProvider(GenericJpaAnnotationDefinitionProvider2_1.instance()),
+ GenericJpaPlatformProvider2_2.instance(), this.buildJpaPlatformVariation(), JPQLGrammar2_1.instance());
+ }
+
+ private JpaPlatform.Version buildJpaVersion(IProjectFacetVersion jpaFacetVersion) {
+ return new GenericJpaPlatformVersion(jpaFacetVersion.getVersionString());
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaPlatformProvider2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaPlatformProvider2_2.java
new file mode 100644
index 0000000000..5b65d3b965
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/GenericJpaPlatformProvider2_2.java
@@ -0,0 +1,196 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2;
+
+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.JpaResourceDefinition;
+import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
+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.JavaManagedTypeDefinition;
+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.JavaPersistentTypeDefinition;
+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.GenericOrmXmlDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2.context.persistence.GenericPersistenceXmlDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.context.java.JavaConverterTypeDefinition2_1;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.context.orm.GenericOrmXmlDefinition2_1;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.context.persistence.GenericPersistenceXmlDefinition2_1;
+import org.eclipse.jpt.jpa.core.internal.jpa2_2.context.orm.GenericOrmXmlDefinition2_2;
+import org.eclipse.jpt.jpa.core.internal.jpa2_2.context.persistence.GenericPersistenceXmlDefinition2_2;
+
+/**
+ * All the state in the JPA platform should be "static" (i.e. unchanging once
+ * it is initialized).
+ */
+public class GenericJpaPlatformProvider2_2
+ extends AbstractJpaPlatformProvider
+{
+ // singleton
+ private static final JpaPlatformProvider INSTANCE = new GenericJpaPlatformProvider2_2();
+
+ /**
+ * Return the singleton
+ */
+ public static JpaPlatformProvider instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Enforce singleton usage
+ */
+ private GenericJpaPlatformProvider2_2() {
+ 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(),
+ GenericPersistenceXmlDefinition2_2.instance().getResourceType(),
+ GenericOrmXmlDefinition2_2.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 managed types *********
+
+ /**
+ * To the specified list, add java managed type definitions to use for
+ * analyzing the type given all annotations on it. The order is
+ * important, as once a managed type definition tests positive for a
+ * type, all following managed type definitions are ignored.
+ */
+ @Override
+ protected void addJavaManagedTypeDefinitionsTo(ArrayList<JavaManagedTypeDefinition> definitions) {
+ CollectionTools.addAll(definitions, JAVA_MANAGED_TYPE_DEFINITIONS_2_2);
+ }
+
+ protected static final JavaManagedTypeDefinition[] JAVA_MANAGED_TYPE_DEFINITIONS_2_2 = new JavaManagedTypeDefinition[] {
+ JavaPersistentTypeDefinition.instance(),
+ JavaConverterTypeDefinition2_1.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<JpaResourceDefinition> definitions) {
+ CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
+ }
+
+ protected static final JpaResourceDefinition[] RESOURCE_DEFINITIONS = new JpaResourceDefinition[] {
+ JavaSourceFileDefinition.instance(),
+ JarDefinition.instance(),
+ GenericPersistenceXmlDefinition.instance(),
+ GenericPersistenceXmlDefinition2_0.instance(),
+ GenericPersistenceXmlDefinition2_1.instance(),
+ GenericPersistenceXmlDefinition2_2.instance(),
+ GenericOrmXmlDefinition.instance(),
+ GenericOrmXmlDefinition2_0.instance(),
+ GenericOrmXmlDefinition2_1.instance(),
+ GenericOrmXmlDefinition2_2.instance()
+ };
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/orm/GenericOrmXmlDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/orm/GenericOrmXmlDefinition2_2.java
new file mode 100644
index 0000000000..03ab96c734
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/orm/GenericOrmXmlDefinition2_2.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.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.OrmManagedTypeDefinition;
+import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextModelFactory;
+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.OrmPersistentTypeDefinition;
+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.internal.jpa2.context.orm.OrmElementCollectionMappingDefinition2_0;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.GenericJpaPlatformProvider2_1;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.context.orm.GenericOrmXmlContextModelFactory2_1;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.context.orm.OrmConverterTypeDefinition2_1;
+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.persistence.v2_2.JPA2_2;
+
+public class GenericOrmXmlDefinition2_2
+ extends AbstractOrmXmlDefinition
+{
+ // singleton
+ private static final OrmXmlDefinition INSTANCE = new GenericOrmXmlDefinition2_2();
+
+ /**
+ * Return the singleton
+ */
+ public static OrmXmlDefinition instance() {
+ return INSTANCE;
+ }
+
+
+ /**
+ * Enforce singleton usage
+ */
+ private GenericOrmXmlDefinition2_2() {
+ super();
+ }
+
+ public JptResourceType getResourceType() {
+ return this.getResourceType(XmlEntityMappings.CONTENT_TYPE, JPA2_2.SCHEMA_VERSION);
+ }
+
+ public EFactory getResourceModelFactory() {
+ return OrmFactory.eINSTANCE;
+ }
+
+ @Override
+ protected OrmXmlContextModelFactory buildContextModelFactory() {
+ return new GenericOrmXmlContextModelFactory2_1();
+ }
+
+ // ********* Managed Types *********
+
+ @Override
+ protected void addManagedTypeDefinitionsTo(ArrayList<OrmManagedTypeDefinition> definitions) {
+ CollectionTools.addAll(definitions, MANAGED_TYPE_DEFINITIONS_2_2);
+ }
+
+ protected static final OrmManagedTypeDefinition[] MANAGED_TYPE_DEFINITIONS_2_2 = new OrmManagedTypeDefinition[] {
+ OrmPersistentTypeDefinition.instance(),
+ OrmConverterTypeDefinition2_1.instance(),
+ };
+
+ @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 GenericJpaPlatformProvider2_1
+ */
+ protected static final OrmAttributeMappingDefinition[] ATTRIBUTE_MAPPING_DEFINITIONS = new OrmAttributeMappingDefinition[] {
+ OrmTransientMappingDefinition.instance(),
+ OrmElementCollectionMappingDefinition2_0.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_2/context/persistence/GenericPersistenceXmlContextModelFactory2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/persistence/GenericPersistenceXmlContextModelFactory2_2.java
new file mode 100644
index 0000000000..0994e12bf6
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/persistence/GenericPersistenceXmlContextModelFactory2_2.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.context.persistence;
+
+import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.context.persistence.GenericPersistenceXmlContextModelFactory2_1;
+import org.eclipse.jpt.jpa.core.internal.jpa2_2.context.persistence.schemagen.GenericSchemaGeneration2_2;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.PersistenceXmlContextModelFactory2_2;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.schemagen.SchemaGeneration2_2;
+
+public class GenericPersistenceXmlContextModelFactory2_2 extends GenericPersistenceXmlContextModelFactory2_1
+ implements PersistenceXmlContextModelFactory2_2 {
+
+ public SchemaGeneration2_2 buildSchemaGeneration(PersistenceUnit parent) {
+ return new GenericSchemaGeneration2_2(parent);
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/persistence/GenericPersistenceXmlDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/persistence/GenericPersistenceXmlDefinition2_2.java
new file mode 100644
index 0000000000..9ec5b45676
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/persistence/GenericPersistenceXmlDefinition2_2.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.context.persistence;
+
+import org.eclipse.emf.ecore.EFactory;
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlContextModelFactory;
+import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlDefinition;
+import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceXmlDefinition;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.context.persistence.GenericPersistenceXmlContextModelFactory2_1;
+import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistence;
+import org.eclipse.jpt.jpa.core.resource.persistence.v2_0.PersistenceV2_0Factory;
+import org.eclipse.jpt.jpa.core.resource.persistence.v2_2.JPA2_2;
+
+public class GenericPersistenceXmlDefinition2_2 extends AbstractPersistenceXmlDefinition {
+ // singleton
+ private static final PersistenceXmlDefinition INSTANCE = new GenericPersistenceXmlDefinition2_2();
+
+ /**
+ * Return the singleton
+ */
+ public static PersistenceXmlDefinition instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Enforce singleton usage
+ */
+ private GenericPersistenceXmlDefinition2_2() {
+ super();
+ }
+
+ public JptResourceType getResourceType() {
+ return this.getResourceType(XmlPersistence.CONTENT_TYPE, JPA2_2.SCHEMA_VERSION);
+ }
+
+ public EFactory getResourceModelFactory() {
+ return PersistenceV2_0Factory.eINSTANCE;
+ }
+
+ @Override
+ protected PersistenceXmlContextModelFactory buildContextModelFactory() {
+ return new GenericPersistenceXmlContextModelFactory2_2();
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/persistence/schemagen/GenericSchemaGeneration2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/persistence/schemagen/GenericSchemaGeneration2_2.java
new file mode 100644
index 0000000000..90e79b6c85
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2_2/context/persistence/schemagen/GenericSchemaGeneration2_2.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.context.persistence.schemagen;
+
+import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.jpa.core.internal.jpa2_1.context.persistence.schemagen.GenericSchemaGeneration2_1;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.schemagen.SchemaGeneration2_2;
+
+public class GenericSchemaGeneration2_2 extends GenericSchemaGeneration2_1 implements SchemaGeneration2_2 {
+
+ public GenericSchemaGeneration2_2(PersistenceUnit parent) {
+ super(parent);
+ }
+}
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 920572aef2..656c204ba6 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
@@ -17,6 +17,7 @@ import org.eclipse.jpt.common.core.libval.LibraryValidator;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
import org.eclipse.jpt.jpa.core.jpa2_1.JpaProject2_1;
+import org.eclipse.jpt.jpa.core.jpa2_2.JpaProject2_2;
import org.eclipse.jst.common.project.facet.core.libprov.osgi.OsgiBundlesLibraryProviderInstallOperationConfig;
import org.eclipse.osgi.service.resolver.VersionRange;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
@@ -45,6 +46,7 @@ public class GenericEclipseLinkBundlesLibraryValidator
versionRanges.put(JpaProject.FACET_VERSION, buildJpa1_0BundleVersionRanges());
versionRanges.put(JpaProject2_0.FACET_VERSION, buildJpa2_0BundleVersionRanges());
versionRanges.put(JpaProject2_1.FACET_VERSION, buildJpa2_1BundleVersionRanges());
+ versionRanges.put(JpaProject2_2.FACET_VERSION, buildJpa2_2BundleVersionRanges());
return versionRanges;
}
@@ -65,4 +67,10 @@ public class GenericEclipseLinkBundlesLibraryValidator
versionRanges.put("javax.persistence", new VersionRange("[2.5, 3.0)"));
return versionRanges;
}
+
+ private static HashMap<String, VersionRange> buildJpa2_2BundleVersionRanges() {
+ HashMap<String, VersionRange> versionRanges = new HashMap<String, VersionRange>();
+ versionRanges.put("javax.persistence", new VersionRange("[2.5, 3.0)"));//TODO Need to find and update
+ return versionRanges;
+ }
}
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 5e0b2119f8..9adfd2ac38 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
@@ -10,6 +10,7 @@
package org.eclipse.jpt.jpa.core.internal.libval;
import java.util.ArrayList;
+
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jpt.common.core.internal.libval.LibraryValidatorTools;
import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
@@ -18,6 +19,7 @@ import org.eclipse.jpt.jpa.core.internal.libprov.JpaUserLibraryProviderInstallOp
import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollectionAnnotation2_0;
import org.eclipse.jpt.jpa.core.jpa2_1.JpaProject2_1;
+import org.eclipse.jpt.jpa.core.jpa2_2.JpaProject2_2;
import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
public class GenericJpaUserLibraryValidator
@@ -33,6 +35,9 @@ public class GenericJpaUserLibraryValidator
if (config.getProjectFacetVersion().compareTo(JpaProject2_1.FACET_VERSION) >= 0) {
classNames.add("javax.persistence.Convert"); //$NON-NLS-1$
}
+ if (config.getProjectFacetVersion().compareTo(JpaProject2_2.FACET_VERSION) >= 0) {
+ classNames.add("javax.persistence.Convert"); //$NON-NLS-1$ //TODO for 2.2
+ }
return LibraryValidatorTools.validateClasses(jpaConfig, classNames);
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/JpaFactory2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/JpaFactory2_2.java
new file mode 100644
index 0000000000..94689c52b6
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/JpaFactory2_2.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2;
+
+import org.eclipse.jpt.jpa.core.jpa2_1.JpaFactory2_1;
+
+/**
+ * JPA 2.2 factory
+ * <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.
+ */
+public interface JpaFactory2_2 extends JpaFactory2_1 {
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/JpaProject2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/JpaProject2_2.java
new file mode 100644
index 0000000000..7d289aa8bc
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/JpaProject2_2.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2;
+
+import org.eclipse.jpt.jpa.core.jpa2_1.JpaProject2_1;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+/**
+ * JPA 2.2 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.
+ *
+ */
+public interface JpaProject2_2 extends JpaProject2_1 {
+ // ********** JPA facet **********
+
+ /**
+ * The JPA 2.2 project facet version string.
+ * <p>
+ * Value: {@value}
+ */
+ String FACET_VERSION_STRING = "2.2"; //$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/jpa2_2/context/persistence/PersistenceUnit2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/context/persistence/PersistenceUnit2_2.java
new file mode 100644
index 0000000000..bbb8325e16
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/context/persistence/PersistenceUnit2_2.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.context.persistence;
+
+import org.eclipse.jpt.jpa.core.jpa2_1.context.persistence.PersistenceUnit2_1;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.schemagen.SchemaGeneration2_2;
+
+/**
+ * JPA 2.2 <code>persistence-unit</code>
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still under
+ * development and expected to change significantly before reaching stability.
+ * It is available at this early stage to solicit feedback from pioneering
+ * adopters on the understanding that any code that uses this API will almost
+ * certainly be broken (repeatedly) as the API evolves.
+ */
+public interface PersistenceUnit2_2 extends PersistenceUnit2_1 {
+ // ********** properties **********
+
+ SchemaGeneration2_2 getSchemaGeneration();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/context/persistence/PersistenceXmlContextModelFactory2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/context/persistence/PersistenceXmlContextModelFactory2_2.java
new file mode 100644
index 0000000000..509c4d29cd
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/context/persistence/PersistenceXmlContextModelFactory2_2.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.context.persistence;
+
+import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.jpa.core.jpa2_1.context.persistence.PersistenceXmlContextModelFactory2_1;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.schemagen.SchemaGeneration2_2;
+
+/**
+ * JPA 2.2 <code>persistence.xml</code> factory
+ * <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.
+ */
+public interface PersistenceXmlContextModelFactory2_2 extends PersistenceXmlContextModelFactory2_1 {
+
+ SchemaGeneration2_2 buildSchemaGeneration(PersistenceUnit parent);
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/context/persistence/schemagen/SchemaGeneration2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/context/persistence/schemagen/SchemaGeneration2_2.java
new file mode 100644
index 0000000000..4b8ff94e01
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2_2/context/persistence/schemagen/SchemaGeneration2_2.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.context.persistence.schemagen;
+
+import org.eclipse.jpt.jpa.core.jpa2_1.context.persistence.schemagen.SchemaGeneration2_1;
+
+/**
+ * JPA 2.2 schema generation
+ */
+public interface SchemaGeneration2_2 extends SchemaGeneration2_1 {
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/v2_2/JPA2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/v2_2/JPA2_2.java
new file mode 100644
index 0000000000..63876311d5
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/orm/v2_2/JPA2_2.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2;
+
+import org.eclipse.jpt.jpa.core.resource.orm.v2_1.JPA2_1;
+
+/**
+ * JPA 2.2 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.
+ */
+public interface JPA2_2 extends JPA2_1 {
+ String SCHEMA_NAMESPACE = "http://xmlns.jcp.org/xml/ns/persistence/orm";
+ String SCHEMA_LOCATION = "http://xmlns.jcp.org/xml/ns/persistence/orm_2_2.xsd";
+ String SCHEMA_VERSION = "2.2";
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/persistence/v2_2/JPA2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/persistence/v2_2/JPA2_2.java
new file mode 100644
index 0000000000..2824fe2982
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/resource/persistence/v2_2/JPA2_2.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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.persistence.v2_2;
+
+import org.eclipse.jpt.jpa.core.resource.persistence.v2_1.JPA2_1;
+
+/**
+ * JPA persistence2_2.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_2 extends JPA2_1 {
+ String SCHEMA_NAMESPACE = "http://xmlns.jcp.org/xml/ns/persistence";
+ String SCHEMA_LOCATION = "http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd";
+ String SCHEMA_VERSION = "2.2";
+
+ // no JPA 2.2 specific nodes...
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF
index cc0b8042bd..8e46af5ada 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.jpt.jpa.ui;singleton:=true
-Bundle-Version: 3.4.201.qualifier
+Bundle-Version: 3.6.0.qualifier
Bundle-Activator: org.eclipse.jpt.jpa.ui.internal.plugin.JptJpaUiPlugin
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml b/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml
index 5945f75e25..2fcaa7573b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml
@@ -230,6 +230,11 @@
jpaPlatform="generic2_1"
factoryClass="org.eclipse.jpt.jpa.ui.internal.jpa2_1.platform.generic.GenericJpaPlatformUiFactory2_1"/>
+ <jpaPlatformUi
+ id="generic2_2.ui"
+ jpaPlatform="generic2_2"
+ factoryClass="org.eclipse.jpt.jpa.ui.internal.jpa2_2.platform.generic.GenericJpaPlatformUiFactory2_2"/>
+
</extension>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/pom.xml b/jpa/plugins/org.eclipse.jpt.jpa.ui/pom.xml
index 72bd05f1f5..c7f277da3f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/pom.xml
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/pom.xml
@@ -22,6 +22,6 @@
<groupId>org.eclipse.webtools.dali</groupId>
<artifactId>org.eclipse.jpt.jpa.ui</artifactId>
- <version>3.4.201-SNAPSHOT</version>
+ <version>3.6.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/details/orm/GenericOrmXmlUiFactory2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/details/orm/GenericOrmXmlUiFactory2_2.java
new file mode 100644
index 0000000000..54c8b6d6d9
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/details/orm/GenericOrmXmlUiFactory2_2.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_1.details.orm;
+
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.jpt.common.ui.WidgetFactory;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.jpa.core.context.Entity;
+import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmEntity2_0;
+import org.eclipse.jpt.jpa.ui.details.JpaComposite;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_2.details.orm.OrmEntityComposite2_2;
+import org.eclipse.jpt.jpa.ui.jpa2_2.details.JpaUiFactory2_2;
+import org.eclipse.swt.widgets.Composite;
+
+public class GenericOrmXmlUiFactory2_2 extends GenericOrmXmlUiFactory2_1 implements JpaUiFactory2_2 {
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public JpaComposite createEntityComposite(PropertyValueModel<? extends Entity> entityModel,
+ Composite parentComposite, WidgetFactory widgetFactory, ResourceManager resourceManager) {
+ return new OrmEntityComposite2_2((PropertyValueModel<? extends OrmEntity2_0>) entityModel, parentComposite,
+ widgetFactory, resourceManager);
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/GenericJpaPlatformUiProvider2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/GenericJpaPlatformUiProvider2_2.java
new file mode 100644
index 0000000000..2c32ee288e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/GenericJpaPlatformUiProvider2_2.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2;
+
+import java.util.List;
+
+import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
+import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmXmlUiDefinition2_0;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.PersistenceXmlUiDefinition2_0;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_1.details.java.GenericJavaResourceUiDefinition2_1;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_1.details.orm.OrmXmlUiDefinition2_1;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_1.persistence.PersistenceXmlUiDefinition2_1;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_2.details.orm.OrmXmlUiDefinition2_2;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_2.persistence.PersistenceXmlUiDefinition2_2;
+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 GenericJpaPlatformUiProvider2_2 extends AbstractJpaPlatformUiProvider
+{
+
+ // singleton
+ private static final JpaPlatformUiProvider INSTANCE = new GenericJpaPlatformUiProvider2_2();
+
+ /**
+ * Return the singleton.
+ */
+ public static JpaPlatformUiProvider instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Ensure single instance.
+ */
+ private GenericJpaPlatformUiProvider2_2() {
+ super();
+ }
+
+
+ // ********** resource ui definitions **********
+
+ @Override
+ protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
+ definitions.add(GenericJavaResourceUiDefinition2_1.instance());
+ definitions.add(OrmXmlUiDefinition.instance());
+ definitions.add(OrmXmlUiDefinition2_0.instance());
+ definitions.add(OrmXmlUiDefinition2_1.instance());
+ definitions.add(OrmXmlUiDefinition2_2.instance());
+ definitions.add(PersistenceXmlUiDefinition.instance());
+ definitions.add(PersistenceXmlUiDefinition2_0.instance());
+ definitions.add(PersistenceXmlUiDefinition2_1.instance());
+ definitions.add(PersistenceXmlUiDefinition2_2.instance());
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/details/orm/OrmEntityComposite2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/details/orm/OrmEntityComposite2_2.java
new file mode 100644
index 0000000000..8492c216de
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/details/orm/OrmEntityComposite2_2.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.details.orm;
+
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.jpt.common.ui.WidgetFactory;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmEntity2_0;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_1.details.QueriesComposite2_1;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_1.details.orm.OrmEntityComposite2_1;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public class OrmEntityComposite2_2 extends OrmEntityComposite2_1 {
+ public OrmEntityComposite2_2(PropertyValueModel<? extends OrmEntity2_0> entityModel, Composite parentComposite,
+ WidgetFactory widgetFactory, ResourceManager resourceManager) {
+ super(entityModel, parentComposite, widgetFactory, resourceManager);
+ }
+
+ @Override
+ protected Control initializeQueriesSection(Composite container) {
+ return new QueriesComposite2_1(this, this.buildQueryContainerModel(), container).getControl();
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/details/orm/OrmXmlUiDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/details/orm/OrmXmlUiDefinition2_2.java
new file mode 100644
index 0000000000..b7a4337282
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/details/orm/OrmXmlUiDefinition2_2.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.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.internal.jpa2_2.context.orm.GenericOrmXmlDefinition2_2;
+import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
+import org.eclipse.jpt.jpa.ui.details.JpaUiFactory;
+import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.BasicMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedIdMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.IdMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.ManyToManyMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.ManyToOneMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.OneToManyMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.OneToOneMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.TransientMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.VersionMappingUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
+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.ElementCollectionMappingUiDefinition2_0;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_1.details.orm.EntityMappingsDetailsProvider2_1;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_1.details.orm.GenericOrmXmlUiFactory2_2;
+
+public class OrmXmlUiDefinition2_2 extends AbstractOrmXmlResourceUiDefinition {
+ // singleton
+ private static final ResourceUiDefinition INSTANCE = new OrmXmlUiDefinition2_2();
+
+ /**
+ * Return the singleton
+ */
+ public static ResourceUiDefinition instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Enforce singleton usage
+ */
+ private OrmXmlUiDefinition2_2() {
+ super();
+ }
+
+ @Override
+ protected JpaUiFactory buildUiFactory() {
+ return new GenericOrmXmlUiFactory2_2();
+ }
+
+ public boolean providesUi(JptResourceType resourceType) {
+ return resourceType.equals(GenericOrmXmlDefinition2_2.instance().getResourceType());
+ }
+
+ // ********** details providers **********
+
+ @Override
+ protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
+ providers.add(OrmPersistentTypeDetailsProvider.instance());
+ providers.add(OrmPersistentAttributeDetailsProvider.instance());
+ providers.add(EntityMappingsDetailsProvider2_1.instance());
+ }
+
+ // ********** structure view factory provider **********
+
+ public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
+ return OrmXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
+ }
+
+ @Override
+ protected void addSpecifiedAttributeMappingUiDefinitionsTo(List<MappingUiDefinition> definitions) {
+ definitions.add(IdMappingUiDefinition.instance());
+ definitions.add(EmbeddedIdMappingUiDefinition.instance());
+ definitions.add(BasicMappingUiDefinition.instance());
+ definitions.add(VersionMappingUiDefinition.instance());
+ definitions.add(ManyToOneMappingUiDefinition.instance());
+ definitions.add(OneToManyMappingUiDefinition.instance());
+ definitions.add(OneToOneMappingUiDefinition.instance());
+ definitions.add(ManyToManyMappingUiDefinition.instance());
+ definitions.add(EmbeddedMappingUiDefinition.instance());
+ definitions.add(TransientMappingUiDefinition.instance());
+
+ definitions.add(ElementCollectionMappingUiDefinition2_0.instance());
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/DataLoadingComposite2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/DataLoadingComposite2_2.java
new file mode 100644
index 0000000000..ab26e92d41
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/DataLoadingComposite2_2.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.persistence;
+
+import org.eclipse.jpt.common.ui.internal.widgets.Pane;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.jpa.core.jpa2_1.context.persistence.schemagen.SchemaGeneration2_1;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.schemagen.SchemaGeneration2_2;
+import org.eclipse.jpt.jpa.ui.jpa2_1.persistence.JptJpaUiPersistenceMessages2_1;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * DataLoadingComposite
+ */
+public class DataLoadingComposite2_2 extends Pane<SchemaGeneration2_2>
+{
+ public DataLoadingComposite2_2(
+ Pane<SchemaGeneration2_2> parent,
+ Composite container) {
+ super(parent, container);
+ }
+
+ public DataLoadingComposite2_2(
+ Pane<?> parent,
+ PropertyValueModel<SchemaGeneration2_2> schemaGenModel,
+ Composite container) {
+ super(parent, schemaGenModel, container);
+ }
+
+ @Override
+ protected Composite addComposite(Composite parent) {
+ return this.addTitledGroup(
+ parent,
+ JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_DATA_LOADING_GROUP_TITLE,
+ 2,
+ null
+ );
+ }
+
+ @Override
+ protected void initializeLayout(Composite parentComposite) {
+
+ // SqlLoadScriptSource
+ this.addLabel(parentComposite, JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_SQL_LOAD_SCRIPT_SOURCE_LABEL);
+ this.addText(parentComposite, this.buildSqlLoadScriptSourceHolder());
+ }
+
+ // ********** SqlLoadScriptSource **********
+
+ private ModifiablePropertyValueModel<String> buildSqlLoadScriptSourceHolder() {
+ return new PropertyAspectAdapter<SchemaGeneration2_1, String>(
+ this.getSubjectHolder(),
+ SchemaGeneration2_2.SQL_LOAD_SCRIPT_SOURCE_PROPERTY)
+ {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getSqlLoadScriptSource();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setSqlLoadScriptSource(value);
+ }
+ };
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceUnitSchemaGenerationEditorPage2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceUnitSchemaGenerationEditorPage2_2.java
new file mode 100644
index 0000000000..3859df3973
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceUnitSchemaGenerationEditorPage2_2.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.persistence;
+
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.jpt.common.ui.WidgetFactory;
+import org.eclipse.jpt.common.ui.internal.widgets.Pane;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.schemagen.SchemaGeneration2_2;
+import org.eclipse.jpt.jpa.ui.jpa2_1.persistence.JptJpaUiPersistenceMessages2_1;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.ExpandableComposite;
+import org.eclipse.ui.forms.widgets.Section;
+
+public class PersistenceUnitSchemaGenerationEditorPage2_2 extends Pane<SchemaGeneration2_2> {
+ public PersistenceUnitSchemaGenerationEditorPage2_2(PropertyValueModel<SchemaGeneration2_2> subjectModel,
+ Composite parent, WidgetFactory widgetFactory, ResourceManager resourceManager) {
+ super(subjectModel, parent, widgetFactory, resourceManager);
+ }
+
+ @Override
+ protected void initializeLayout(Composite container) {
+ Section section = this.getWidgetFactory().createSection(container,
+ ExpandableComposite.TITLE_BAR | Section.DESCRIPTION);
+ section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ section.setText(JptJpaUiPersistenceMessages2_1.PERSISTENCE_UNIT_SCHEMA_GENERATION2_1_EDITOR_PAGE_TITLE);
+ section.setDescription(
+ JptJpaUiPersistenceMessages2_1.PERSISTENCE_UNIT_SCHEMA_GENERATION2_1_EDITOR_PAGE_DESCRIPTION);
+
+ Composite client = this.getWidgetFactory().createComposite(section);
+ GridLayout layout = new GridLayout(2, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ layout.marginTop = 0;
+ layout.marginLeft = 0;
+ layout.marginBottom = 0;
+ layout.marginRight = 0;
+ client.setLayout(layout);
+ client.setLayoutData(new GridData(GridData.FILL_BOTH));
+ section.setClient(client);
+
+ // ********** Schema Generation properties **********
+
+ SchemaGenerationComposite2_2 schemaGenerationComposite = new SchemaGenerationComposite2_2(this, client);
+ GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.horizontalSpan = 2;
+ schemaGenerationComposite.getControl().setLayoutData(gridData);
+
+ // ********** Data Loading **********
+
+ DataLoadingComposite2_2 dataLoadingComposite = new DataLoadingComposite2_2(this, client);
+ gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.horizontalSpan = 2;
+ dataLoadingComposite.getControl().setLayoutData(gridData);
+
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceUnitSchemaGenerationEditorPageDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceUnitSchemaGenerationEditorPageDefinition2_2.java
new file mode 100644
index 0000000000..ed8a2d557c
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceUnitSchemaGenerationEditorPageDefinition2_2.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.persistence;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ResourceManager;
+import org.eclipse.jpt.common.ui.WidgetFactory;
+import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.common.utility.internal.transformer.AbstractTransformer;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.common.utility.transformer.Transformer;
+import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.PersistenceUnit2_2;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.schemagen.SchemaGeneration2_2;
+import org.eclipse.jpt.jpa.ui.editors.JpaEditorPageDefinition;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.PersistenceUnitEditorPageDefinition2_0;
+import org.eclipse.jpt.jpa.ui.jpa2_1.persistence.JptJpaUiPersistenceMessages2_1;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * PersistenceUnitSchemaGeneration2_1EditorPageDefinition
+ */
+public class PersistenceUnitSchemaGenerationEditorPageDefinition2_2 extends PersistenceUnitEditorPageDefinition2_0 {
+ // singleton
+ private static final JpaEditorPageDefinition INSTANCE = new PersistenceUnitSchemaGenerationEditorPageDefinition2_2();
+
+ /**
+ * Return the singleton.
+ */
+ public static JpaEditorPageDefinition instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Ensure single instance.
+ */
+ private PersistenceUnitSchemaGenerationEditorPageDefinition2_2() {
+ super();
+ }
+
+ public ImageDescriptor getTitleImageDescriptor() {
+ return null;
+ }
+
+ public String getTitleText() {
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_SCHEMA_GENERATION_TAB_TITLE;
+ }
+
+ public String getHelpID() {
+ // TODO
+ return null;
+ }
+
+ @Override
+ protected void buildEditorPageContent(Composite parent, WidgetFactory widgetFactory,
+ ResourceManager resourceManager, PropertyValueModel<PersistenceUnit> persistenceUnitModel) {
+ new PersistenceUnitSchemaGenerationEditorPage2_2(buildSchemaGenerationModel(persistenceUnitModel), parent,
+ widgetFactory, resourceManager);
+ }
+
+ public static TransformationPropertyValueModel<PersistenceUnit, SchemaGeneration2_2> buildSchemaGenerationModel(
+ PropertyValueModel<PersistenceUnit> persistenceUnitModel) {
+ return new TransformationPropertyValueModel<PersistenceUnit, SchemaGeneration2_2>(persistenceUnitModel,
+ SCHEMAGEN_TRANSFORMER);
+ }
+
+ public static final Transformer<PersistenceUnit, SchemaGeneration2_2> SCHEMAGEN_TRANSFORMER = new SchemaGenerationTransformer();
+
+ public static class SchemaGenerationTransformer extends AbstractTransformer<PersistenceUnit, SchemaGeneration2_2> {
+ @Override
+ protected SchemaGeneration2_2 transform_(PersistenceUnit persistenceUnit) {
+ return ((PersistenceUnit2_2) persistenceUnit).getSchemaGeneration();
+ }
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceXmlUiDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceXmlUiDefinition2_2.java
new file mode 100644
index 0000000000..83ec747975
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/PersistenceXmlUiDefinition2_2.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.persistence;
+
+import java.util.List;
+
+import org.eclipse.jpt.common.core.JptResourceType;
+import org.eclipse.jpt.jpa.core.internal.jpa2_2.context.persistence.GenericPersistenceXmlDefinition2_2;
+import org.eclipse.jpt.jpa.ui.JavaManagedTypeUiDefinition;
+import org.eclipse.jpt.jpa.ui.PersistenceResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.editors.JpaEditorPageDefinition;
+import org.eclipse.jpt.jpa.ui.internal.AbstractPersistenceResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.PersistenceUnitConnectionEditorPageDefinition2_0;
+import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.PersistenceUnitOptionsEditorPageDefinition2_0;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_1.JavaConverterTypeUiDefinition2_1;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_1.persistence.PersistenceUnitSchemaGenerationEditorPageDefinition2_1;
+import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceUnitGeneralEditorPageDefinition;
+import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceUnitPropertiesEditorPageDefinition;
+
+public class PersistenceXmlUiDefinition2_2 extends AbstractPersistenceResourceUiDefinition {
+ // singleton
+ private static final PersistenceResourceUiDefinition INSTANCE = new PersistenceXmlUiDefinition2_2();
+
+ /**
+ * Return the singleton
+ */
+ public static PersistenceResourceUiDefinition instance() {
+ return INSTANCE;
+ }
+
+ /**
+ * Enforce singleton usage
+ */
+ private PersistenceXmlUiDefinition2_2() {
+ super();
+ }
+
+ @Override
+ protected void addEditorPageDefinitionsTo(List<JpaEditorPageDefinition> definitions) {
+ definitions.add(PersistenceUnitGeneralEditorPageDefinition.instance());
+ definitions.add(PersistenceUnitConnectionEditorPageDefinition2_0.instance());
+ definitions.add(PersistenceUnitOptionsEditorPageDefinition2_0.instance());
+ definitions.add(PersistenceUnitSchemaGenerationEditorPageDefinition2_1.instance());
+ definitions.add(PersistenceUnitPropertiesEditorPageDefinition.instance());
+ definitions.add(PersistenceUnitSchemaGenerationEditorPageDefinition2_2.instance());
+ }
+
+ public boolean providesUi(JptResourceType resourceType) {
+ return resourceType.equals(GenericPersistenceXmlDefinition2_2.instance().getResourceType());
+ }
+
+ @Override
+ protected void addJavaManagedTypeUiDefinitionsTo(List<JavaManagedTypeUiDefinition> definitions) {
+ super.addJavaManagedTypeUiDefinitionsTo(definitions);
+ definitions.add(JavaConverterTypeUiDefinition2_1.instance());
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/SchemaGenerationComposite2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/SchemaGenerationComposite2_2.java
new file mode 100644
index 0000000000..9debed3ee8
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/persistence/SchemaGenerationComposite2_2.java
@@ -0,0 +1,537 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.persistence;
+
+import java.util.Collection;
+import org.eclipse.jpt.common.ui.JptCommonUiMessages;
+import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
+import org.eclipse.jpt.common.ui.internal.widgets.Pane;
+import org.eclipse.jpt.common.ui.internal.widgets.TriStateCheckBox;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
+import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
+import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.jpa.core.jpa2_1.context.persistence.SchemaGenerationAction2_1;
+import org.eclipse.jpt.jpa.core.jpa2_1.context.persistence.SchemaGenerationTarget2_1;
+import org.eclipse.jpt.jpa.core.jpa2_1.context.persistence.schemagen.SchemaGeneration2_1;
+import org.eclipse.jpt.jpa.core.jpa2_2.context.persistence.schemagen.SchemaGeneration2_2;
+import org.eclipse.jpt.jpa.ui.jpa2_1.persistence.JptJpaUiPersistenceMessages2_1;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * SchemaGenerationComposite
+ */
+public class SchemaGenerationComposite2_2 extends Pane<SchemaGeneration2_2> {
+ public SchemaGenerationComposite2_2(Pane<SchemaGeneration2_2> parent, Composite container) {
+ super(parent, container);
+ }
+
+ public SchemaGenerationComposite2_2(Pane<?> parent, PropertyValueModel<SchemaGeneration2_2> schemaGenModel,
+ Composite container) {
+ super(parent, schemaGenModel, container);
+ }
+
+ @Override
+ protected Composite addComposite(Composite parent) {
+ return this.addTitledGroup(parent,
+ JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_SCHEMA_GENERATION_GROUP_TITLE, 2, null);
+ }
+
+ @Override
+ protected void initializeLayout(Composite parentComposite) {
+ // DatabaseAction
+ this.addLabel(parentComposite, JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_DATABASE_ACTION);
+ this.buildDatabaseActionCombo(parentComposite);
+ // ScriptsAction
+ this.addLabel(parentComposite, JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_SCRIPTS_GENERATION);
+ this.buildScriptsActionCombo(parentComposite);
+ // CreateSource
+ this.addLabel(parentComposite,
+ JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_METADATA_AND_SCRIPT_CREATION);
+ this.buildCreateSourceCombo(parentComposite);
+ // DropSource
+ this.addLabel(parentComposite,
+ JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_METADATA_AND_SCRIPT_DROPPING);
+ this.buildDropSourceCombo(parentComposite);
+
+ // Create Database Schemas
+ TriStateCheckBox createDatabaseSchemasCheckBox = this.buildCreateDatabaseSchemasCheckBox(parentComposite);
+ GridData gridData = new GridData();
+ gridData.horizontalSpan = 2;
+ createDatabaseSchemasCheckBox.getCheckBox().setLayoutData(gridData);
+
+ // ScriptsCreateTarget
+ this.addLabel(parentComposite,
+ JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_SCRIPTS_CREATE_TARGET);
+ this.addText(parentComposite, this.buildScriptsCreateTargetHolder());
+
+ // ScriptsDropTarget
+ this.addLabel(parentComposite, JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_SCRIPTS_DROP_TARGET);
+ this.addText(parentComposite, this.buildScriptsDropTargetHolder());
+
+ // DatabaseProductName
+ this.addLabel(parentComposite,
+ JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_DATABASE_PRODUCT_NAME);
+ this.addText(parentComposite, this.buildDatabaseProductNameHolder());
+
+ // DatabaseMajorVersion
+ this.addLabel(parentComposite,
+ JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_DATABASE_MAJOR_VERSION);
+ this.addText(parentComposite, this.buildDatabaseMajorVersionHolder());
+
+ // DatabaseMinorVersion
+ this.addLabel(parentComposite,
+ JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_DATABASE_MINOR_VERSION);
+ this.addText(parentComposite, this.buildDatabaseMinorVersionHolder());
+
+ // CreateScriptSource
+ this.addLabel(parentComposite, JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_CREATE_SCRIPT_SOURCE);
+ this.addText(parentComposite, this.buildCreateScriptSourceHolder());
+
+ // DropScriptSource
+ this.addLabel(parentComposite, JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_DROP_SCRIPT_SOURCE);
+ this.addText(parentComposite, this.buildDropScriptSourceHolder());
+
+ // Connection
+ this.addLabel(parentComposite, JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_CONNECTION);
+ this.addText(parentComposite, this.buildConnectionHolder());
+ }
+
+ // ********** ScriptsCreateTarget **********
+
+ private ModifiablePropertyValueModel<String> buildScriptsCreateTargetHolder() {
+ return new PropertyAspectAdapter<SchemaGeneration2_1, String>(this.getSubjectHolder(),
+ SchemaGeneration2_1.SCRIPTS_CREATE_TARGET_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getScriptsCreateTarget();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setScriptsCreateTarget(value);
+ }
+ };
+ }
+
+ // ********** ScriptsDropTarget **********
+
+ private ModifiablePropertyValueModel<String> buildScriptsDropTargetHolder() {
+ return new PropertyAspectAdapter<SchemaGeneration2_1, String>(this.getSubjectHolder(),
+ SchemaGeneration2_1.SCRIPTS_DROP_TARGET_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getScriptsDropTarget();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setScriptsDropTarget(value);
+ }
+ };
+ }
+
+ // ********** DatabaseProductName **********
+
+ private ModifiablePropertyValueModel<String> buildDatabaseProductNameHolder() {
+ return new PropertyAspectAdapter<SchemaGeneration2_1, String>(this.getSubjectHolder(),
+ SchemaGeneration2_1.DATABASE_PRODUCT_NAME_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getDatabaseProductName();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setDatabaseProductName(value);
+ }
+ };
+ }
+
+ // ********** DatabaseMajorVersion **********
+
+ private ModifiablePropertyValueModel<String> buildDatabaseMajorVersionHolder() {
+ return new PropertyAspectAdapter<SchemaGeneration2_1, String>(this.getSubjectHolder(),
+ SchemaGeneration2_1.DATABASE_MAJOR_VERSION_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getDatabaseMajorVersion();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setDatabaseMajorVersion(value);
+ }
+ };
+ }
+
+ // ********** DatabaseMinorVersion **********
+
+ private ModifiablePropertyValueModel<String> buildDatabaseMinorVersionHolder() {
+ return new PropertyAspectAdapter<SchemaGeneration2_1, String>(this.getSubjectHolder(),
+ SchemaGeneration2_1.DATABASE_MINOR_VERSION_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getDatabaseMinorVersion();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setDatabaseMinorVersion(value);
+ }
+ };
+ }
+
+ // ********** CreateScriptSource **********
+
+ private ModifiablePropertyValueModel<String> buildCreateScriptSourceHolder() {
+ return new PropertyAspectAdapter<SchemaGeneration2_1, String>(this.getSubjectHolder(),
+ SchemaGeneration2_1.CREATE_SCRIPT_SOURCE_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getCreateScriptSource();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setCreateScriptSource(value);
+ }
+ };
+ }
+
+ // ********** DropScriptSource **********
+
+ private ModifiablePropertyValueModel<String> buildDropScriptSourceHolder() {
+ return new PropertyAspectAdapter<SchemaGeneration2_1, String>(this.getSubjectHolder(),
+ SchemaGeneration2_1.DROP_SCRIPT_SOURCE_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getDropScriptSource();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setDropScriptSource(value);
+ }
+ };
+ }
+
+ // ********** Connection **********
+
+ private ModifiablePropertyValueModel<String> buildConnectionHolder() {
+ return new PropertyAspectAdapter<SchemaGeneration2_1, String>(this.getSubjectHolder(),
+ SchemaGeneration2_1.CONNECTION_PROPERTY) {
+ @Override
+ protected String buildValue_() {
+ return this.subject.getConnection();
+ }
+
+ @Override
+ protected void setValue_(String value) {
+ if (value.length() == 0) {
+ value = null;
+ }
+ this.subject.setConnection(value);
+ }
+ };
+ }
+
+ // ********* Create Database Schemas **********
+
+ private TriStateCheckBox buildCreateDatabaseSchemasCheckBox(Composite container) {
+ return this.addTriStateCheckBoxWithDefault(container,
+ JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_CREATE_DATABASE_SCHEMAS_LABEL,
+ this.buildCreateDatabaseSchemasHolder(), this.buildCreateDatabaseSchemasStringHolder(), null // TODO
+ // HelpContextIds
+ );
+ }
+
+ private ModifiablePropertyValueModel<Boolean> buildCreateDatabaseSchemasHolder() {
+ return new PropertyAspectAdapter<SchemaGeneration2_1, Boolean>(this.getSubjectHolder(),
+ SchemaGeneration2_1.CREATE_DATABASE_SCHEMAS_PROPERTY) {
+ @Override
+ protected Boolean buildValue_() {
+ return this.subject.getCreateDatabaseSchemas();
+ }
+
+ @Override
+ protected void setValue_(Boolean value) {
+ this.subject.setCreateDatabaseSchemas(value);
+ }
+ };
+ }
+
+ private PropertyValueModel<String> buildCreateDatabaseSchemasStringHolder() {
+ return new TransformationPropertyValueModel<Boolean, String>(this.buildDefaultCreateDatabaseSchemasHolder()) {
+ @Override
+ protected String transform(Boolean value) {
+ if (value != null) {
+ String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.BOOLEAN_TRUE
+ : JptCommonUiMessages.BOOLEAN_FALSE;
+ return NLS.bind(
+ JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_DEFAULT_CREATE_DATABASE_SCHEMAS_LABEL,
+ defaultStringValue);
+ }
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_COMPOSITE_CREATE_DATABASE_SCHEMAS_LABEL;
+ }
+ };
+ }
+
+ private PropertyValueModel<Boolean> buildDefaultCreateDatabaseSchemasHolder() {
+ return new PropertyAspectAdapter<SchemaGeneration2_1, Boolean>(this.getSubjectHolder(),
+ SchemaGeneration2_1.CREATE_DATABASE_SCHEMAS_PROPERTY) {
+ @Override
+ protected Boolean buildValue_() {
+ if (this.subject.getCreateDatabaseSchemas() != null) {
+ return null;
+ }
+ return this.subject.getDefaultCreateDatabaseSchemas();
+ }
+ };
+ }
+
+ // ********** DatabaseAction **********
+ private EnumFormComboViewer<SchemaGeneration2_1, SchemaGenerationAction2_1> buildDatabaseActionCombo(
+ Composite container) {
+
+ return new EnumFormComboViewer<SchemaGeneration2_1, SchemaGenerationAction2_1>(this, this.getSubjectHolder(),
+ container) {
+ @Override
+ protected void addPropertyNames(Collection<String> propertyNames) {
+ super.addPropertyNames(propertyNames);
+ propertyNames.add(SchemaGeneration2_1.SCHEMAGEN_DATABASE_ACTION_PROPERTY);
+ }
+
+ @Override
+ protected SchemaGenerationAction2_1[] getChoices() {
+ return SchemaGenerationAction2_1.values();
+ }
+
+ @Override
+ protected SchemaGenerationAction2_1 getDefaultValue() {
+ return this.getSubject().getDefaultSchemaGenDatabaseAction();
+ }
+
+ @Override
+ protected String displayString(SchemaGenerationAction2_1 value) {
+ switch (value) {
+ case none:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_ACTION_NONE;
+ case create:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_ACTION_CREATE;
+ case drop_and_create:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_ACTION_DROP_AND_CREATE;
+ case drop:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_ACTION_DROP;
+ default:
+ throw new IllegalStateException();
+ }
+ }
+
+ @Override
+ protected SchemaGenerationAction2_1 getValue() {
+ return this.getSubject().getSchemaGenDatabaseAction();
+ }
+
+ @Override
+ protected void setValue(SchemaGenerationAction2_1 value) {
+ this.getSubject().setSchemaGenDatabaseAction(value);
+ }
+ };
+ }
+
+ // ********** ScriptsAction **********
+ private EnumFormComboViewer<SchemaGeneration2_1, SchemaGenerationAction2_1> buildScriptsActionCombo(
+ Composite container) {
+
+ return new EnumFormComboViewer<SchemaGeneration2_1, SchemaGenerationAction2_1>(this, this.getSubjectHolder(),
+ container) {
+ @Override
+ protected void addPropertyNames(Collection<String> propertyNames) {
+ super.addPropertyNames(propertyNames);
+ propertyNames.add(SchemaGeneration2_1.SCHEMAGEN_SCRIPTS_ACTION_PROPERTY);
+ }
+
+ @Override
+ protected SchemaGenerationAction2_1[] getChoices() {
+ return SchemaGenerationAction2_1.values();
+ }
+
+ @Override
+ protected SchemaGenerationAction2_1 getDefaultValue() {
+ return this.getSubject().getDefaultSchemaGenScriptsAction();
+ }
+
+ @Override
+ protected String displayString(SchemaGenerationAction2_1 value) {
+ switch (value) {
+ case none:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_ACTION_NONE;
+ case create:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_ACTION_CREATE;
+ case drop_and_create:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_ACTION_DROP_AND_CREATE;
+ case drop:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_ACTION_DROP;
+ default:
+ throw new IllegalStateException();
+ }
+ }
+
+ @Override
+ protected SchemaGenerationAction2_1 getValue() {
+ return this.getSubject().getSchemaGenScriptsAction();
+ }
+
+ @Override
+ protected void setValue(SchemaGenerationAction2_1 value) {
+ this.getSubject().setSchemaGenScriptsAction(value);
+ }
+
+ // @Override
+ // protected String getHelpId() {
+ // return // TODO -
+ // }
+ };
+ }
+
+ // ********** CreateSource **********
+ private EnumFormComboViewer<SchemaGeneration2_1, SchemaGenerationTarget2_1> buildCreateSourceCombo(
+ Composite container) {
+
+ return new EnumFormComboViewer<SchemaGeneration2_1, SchemaGenerationTarget2_1>(this, this.getSubjectHolder(),
+ container) {
+ @Override
+ protected void addPropertyNames(Collection<String> propertyNames) {
+ super.addPropertyNames(propertyNames);
+ propertyNames.add(SchemaGeneration2_1.SCHEMAGEN_CREATE_SOURCE_PROPERTY);
+ }
+
+ @Override
+ protected SchemaGenerationTarget2_1[] getChoices() {
+ return SchemaGenerationTarget2_1.values();
+ }
+
+ @Override
+ protected SchemaGenerationTarget2_1 getDefaultValue() {
+ return this.getSubject().getDefaultSchemaGenCreateSource();
+ }
+
+ @Override
+ protected String displayString(SchemaGenerationTarget2_1 value) {
+ switch (value) {
+ case metadata:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_TARGET_METADATA;
+ case script:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_TARGET_SCRIPT;
+ case metadata_then_script:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_TARGET_METADATA_THEN_SCRIPT;
+ case script_then_metadata:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_TARGET_SCRIPT_THEN_METADATA;
+ default:
+ throw new IllegalStateException();
+ }
+ }
+
+ @Override
+ protected SchemaGenerationTarget2_1 getValue() {
+ return this.getSubject().getSchemaGenCreateSource();
+ }
+
+ @Override
+ protected void setValue(SchemaGenerationTarget2_1 value) {
+ this.getSubject().setSchemaGenCreateSource(value);
+ }
+
+ // @Override
+ // protected String getHelpId() {
+ // return // TODO -
+ // }
+ };
+ }
+
+ // ********** DropSource **********
+ private EnumFormComboViewer<SchemaGeneration2_1, SchemaGenerationTarget2_1> buildDropSourceCombo(
+ Composite container) {
+
+ return new EnumFormComboViewer<SchemaGeneration2_1, SchemaGenerationTarget2_1>(this, this.getSubjectHolder(),
+ container) {
+ @Override
+ protected void addPropertyNames(Collection<String> propertyNames) {
+ super.addPropertyNames(propertyNames);
+ propertyNames.add(SchemaGeneration2_1.SCHEMAGEN_DROP_SOURCE_PROPERTY);
+ }
+
+ @Override
+ protected SchemaGenerationTarget2_1[] getChoices() {
+ return SchemaGenerationTarget2_1.values();
+ }
+
+ @Override
+ protected SchemaGenerationTarget2_1 getDefaultValue() {
+ return this.getSubject().getDefaultSchemaGenDropSource();
+ }
+
+ @Override
+ protected String displayString(SchemaGenerationTarget2_1 value) {
+ switch (value) {
+ case metadata:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_TARGET_METADATA;
+ case script:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_TARGET_SCRIPT;
+ case metadata_then_script:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_TARGET_METADATA_THEN_SCRIPT;
+ case script_then_metadata:
+ return JptJpaUiPersistenceMessages2_1.SCHEMA_GENERATION_TARGET_SCRIPT_THEN_METADATA;
+ default:
+ throw new IllegalStateException();
+ }
+ }
+
+ @Override
+ protected SchemaGenerationTarget2_1 getValue() {
+ return this.getSubject().getSchemaGenDropSource();
+ }
+
+ @Override
+ protected void setValue(SchemaGenerationTarget2_1 value) {
+ this.getSubject().setSchemaGenDropSource(value);
+ }
+
+ // @Override
+ // protected String getHelpId() {
+ // return // TODO -
+ // }
+ };
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/platform/generic/GenericJpaPlatformUiFactory2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/platform/generic/GenericJpaPlatformUiFactory2_2.java
new file mode 100644
index 0000000000..4723d4ab49
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_2/platform/generic/GenericJpaPlatformUiFactory2_2.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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_2.platform.generic;
+
+import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
+import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
+import org.eclipse.jpt.jpa.ui.internal.jpa2_2.GenericJpaPlatformUiProvider2_2;
+import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUi;
+import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUiFactory;
+
+public class GenericJpaPlatformUiFactory2_2 implements JpaPlatformUiFactory {
+
+ public JpaPlatformUi buildJpaPlatformUi() {
+ return new GenericJpaPlatformUi(GenericJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
+ GenericJpaPlatformUiProvider2_2.instance());
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2_2/details/JpaUiFactory2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2_2/details/JpaUiFactory2_2.java
new file mode 100644
index 0000000000..0caf95d479
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2_2/details/JpaUiFactory2_2.java
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2018 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.jpa2_2.details;
+
+import org.eclipse.jpt.jpa.ui.jpa2_1.details.JpaUiFactory2_1;
+
+public interface JpaUiFactory2_2 extends JpaUiFactory2_1 {
+ // nothing
+}

Back to the top