GERONIMO-6572 prepare JPA-2.2 spec api


git-svn-id: https://svn.apache.org/repos/asf/geronimo/specs/trunk@1854299 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/geronimo-jpa_2.2_spec/LICENSE b/geronimo-jpa_2.2_spec/LICENSE
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/LICENSE
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
diff --git a/geronimo-jpa_2.2_spec/NOTICE b/geronimo-jpa_2.2_spec/NOTICE
new file mode 100644
index 0000000..8282830
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/NOTICE
@@ -0,0 +1,7 @@
+
+Apache Geronimo JSR-338 JPA 2.2 Spec API
+Copyright 2003-2018 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
diff --git a/geronimo-jpa_2.2_spec/pom.xml b/geronimo-jpa_2.2_spec/pom.xml
new file mode 100644
index 0000000..b10b3eb
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/pom.xml
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0 
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.geronimo.genesis</groupId>
+    <artifactId>genesis-java8-flava</artifactId>
+    <version>2.3</version>
+    <relativePath />
+  </parent>
+
+  <groupId>org.apache.geronimo.specs</groupId>
+  <artifactId>geronimo-jpa_2.2_spec</artifactId>
+  <packaging>bundle</packaging>
+  <name>Apache Geronimo JPA Spec 2.2</name>
+  <version>1.0-SNAPSHOT</version>
+
+  <description>Implementation of JSR-338 JPA 2.2 Spec API</description>
+
+  <url>http://geronimo.apache.org/maven/${siteId}/${project.version}</url>
+  <distributionManagement>
+    <site>
+      <id>apache-website</id>
+      <url>${site.deploy.url}/maven/${siteId}/${project.version}</url>
+    </site>
+  </distributionManagement>
+
+  <properties>
+    <siteId>specs/${project.artifactId}</siteId>
+  </properties>
+
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-jpa_2.2_spec/</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-jpa_2.2_spec/
+    </developerConnection>
+    <url>http://svn.apache.org/viewcvs.cgi/geronimo/specs/trunk/geronimo-jpa_2.2_spec/</url>
+  </scm>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.osgi.core</artifactId>
+      <version>1.4.0</version>
+      <scope>compile</scope>
+      <optional>true</optional>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>org.osgi.foundation</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.felix</groupId>
+      <artifactId>org.osgi.compendium</artifactId>
+      <version>1.2.0</version>
+      <scope>compile</scope>
+      <optional>true</optional>
+      <exclusions>
+        <exclusion>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>org.osgi.core</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>org.osgi.foundation</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.apache.felix</groupId>
+          <artifactId>javax.servlet</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-osgi-locator</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-eclipse-plugin</artifactId>
+          <configuration>
+            <addVersionToProjectName>true</addVersionToProjectName>
+          </configuration>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <version>3.5.0</version>
+        <configuration>
+          <instructions>
+            <Bundle-SymbolicName>${project.groupId}.${project.artifactId};singleton=true</Bundle-SymbolicName>
+            <Bundle-Activator>org.apache.geronimo.specs.jpa.PersistenceActivator</Bundle-Activator>
+            <Specification-Title>JSR-338 Java Persistence API 2.1</Specification-Title>
+            <Specification-Vendor>Sun Microsystems, Inc.</Specification-Vendor>
+            <Specification-Version>2.1</Specification-Version>
+            <Private-Package>org.apache.geronimo.specs.jpa.*;org.apache.geronimo.osgi.locator</Private-Package>
+            <!-- The OSGi specification requires these packages be exported as 1.1.  Unfortunately,
+                 there are bundles out there that are currently expecting to use a 2.0 version.  The duplicate
+                 package exports are done to prevent breaking those packages -->
+            <Export-Package>
+              javax.persistence;version=1.2;jpa=2.1,
+              javax.persistence.criteria;version=1.2;jpa=2.1,
+              javax.persistence.metamodel;version=1.2;jpa=2.1,
+              javax.persistence.spi;version=1.2;jpa=2.1,
+              javax.persistence;version=2.1,
+              javax.persistence.criteria;version=2.1,
+              javax.persistence.metamodel;version=2.1,
+              javax.persistence.spi;version=2.1
+            </Export-Package>
+            <!-- bnd is not correctly handling these imports using wildcards, so they
+                 need to be explicitly specified -->
+            <Import-Package>
+              javax.persistence;version=1.2,
+              javax.persistence.criteria;version=1.2,
+              javax.persistence.metamodel;version=1.2,
+              javax.persistence.spi;version=1.2,
+              javax.sql;resolution:=optional,
+              org.osgi.framework;resolution:=optional,
+              org.osgi.util.tracker;resolution:=optional,
+              org.apache.geronimo.osgi.registry.api;resolution:=optional
+            </Import-Package>
+            <Provide-Capability><![CDATA[
+               osgi.contract;osgi.contract=JavaJPA;uses:="${packages;NAMED;javax.*}";version:List<Version>='2.1,2.0,1.0'
+            ]]></Provide-Capability>
+          </instructions>
+          <unpackBundle>true</unpackBundle>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/geronimo-jpa_2.2_spec/run_sigtest.sh b/geronimo-jpa_2.2_spec/run_sigtest.sh
new file mode 100755
index 0000000..cb8e6d2
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/run_sigtest.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements.  See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership.  The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied.  See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+
+# file to run the JPA signature tests
+
+
+# HOWTO:
+#
+# Download sigtestdev.jar from http://download.java.net/sigtest/2.2/Rel/
+# Copy to a local folder and set SIGTEST_HOME to it.
+
+
+# not needed, we don't have deps to other specs in JPA
+# mvn clean dependency:copy-dependencies
+
+# generate the SIG for the RI
+curl  http://repo1.maven.org/maven2/org/eclipse/persistence/javax.persistence/2.2.1/javax.persistence-2.2.1.jar > ./target/javax.persistence-2.2.1.jar
+java -jar ${SIGTEST_HOME}/lib/sigtestdev.jar Setup -classpath ${JAVA_HOME}/jre/lib/rt.jar:./target/javax.persistence-2.2.1.jar -Package javax.persistence  -FileName target/javax.persistence-2.2.1.sig -static
+
+# this generates the signature for our own jpa api
+java -jar ${SIGTEST_HOME}/lib/sigtestdev.jar Setup -classpath ${JAVA_HOME}/jre/lib/rt.jar:./target/geronimo-jpa_2.2_spec-1.0-SNAPSHOT.jar -Package javax.persistence  -FileName target/geronimo-jpa-api.sig -static
+
+# then open the 2 generated sig files in a diff browser and the only difference should be some internal variables.
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Access.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Access.java
new file mode 100644
index 0000000..b59f7a9
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Access.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface Access {
+
+    AccessType value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AccessType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AccessType.java
new file mode 100644
index 0000000..b1660f2
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AccessType.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public enum AccessType {
+
+    FIELD,
+
+    PROPERTY
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AssociationOverride.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AssociationOverride.java
new file mode 100644
index 0000000..950908a
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AssociationOverride.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+@Target({TYPE, METHOD, FIELD}) 
+@Retention(RUNTIME)
+
+public @interface AssociationOverride {
+
+    String name();
+
+    JoinColumn[] joinColumns() default {};
+
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+    JoinTable joinTable() default @JoinTable;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AssociationOverrides.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AssociationOverrides.java
new file mode 100644
index 0000000..72c505b
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AssociationOverrides.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE, METHOD, FIELD}) 
+@Retention(RUNTIME)
+
+public @interface AssociationOverrides {
+
+    AssociationOverride[] value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeConverter.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeConverter.java
new file mode 100644
index 0000000..6b7b5de
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeConverter.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+public interface AttributeConverter<X,Y> {
+
+    public Y convertToDatabaseColumn (X attribute);
+
+    public X convertToEntityAttribute (Y dbData);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeNode.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeNode.java
new file mode 100644
index 0000000..a1105a1
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeNode.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import java.util.Map;
+
+public interface AttributeNode<T> {
+
+    public String getAttributeName();
+
+    public Map<Class, Subgraph> getSubgraphs();
+
+    public Map<Class, Subgraph> getKeySubgraphs();
+}
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeOverride.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeOverride.java
new file mode 100644
index 0000000..1dd84d5
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeOverride.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE, METHOD, FIELD}) 
+@Retention(RUNTIME)
+
+public @interface AttributeOverride {
+
+    String name();
+
+    Column column();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeOverrides.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeOverrides.java
new file mode 100644
index 0000000..7ef2a04
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/AttributeOverrides.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE, METHOD, FIELD}) 
+@Retention(RUNTIME)
+
+public @interface AttributeOverrides {
+
+    AttributeOverride[] value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Basic.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Basic.java
new file mode 100644
index 0000000..4ee53c1
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Basic.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.EAGER;
+
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+public @interface Basic {
+
+    FetchType fetch() default EAGER;
+
+    boolean optional() default true;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Cache.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Cache.java
new file mode 100644
index 0000000..d89f27e
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Cache.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+public interface Cache {
+
+    public boolean contains(Class cls, Object primaryKey);
+
+    public void evict(Class cls, Object primaryKey);
+
+    public void evict(Class cls);
+
+    public void evictAll();
+
+    public <T> T unwrap(Class<T> cls);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CacheRetrieveMode.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CacheRetrieveMode.java
new file mode 100644
index 0000000..b6f7ba8
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CacheRetrieveMode.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+public enum CacheRetrieveMode {
+
+    USE,
+
+    BYPASS  
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CacheStoreMode.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CacheStoreMode.java
new file mode 100644
index 0000000..75fe1e7
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CacheStoreMode.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+public enum CacheStoreMode {
+
+    USE,
+
+    BYPASS,
+
+    REFRESH
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Cacheable.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Cacheable.java
new file mode 100644
index 0000000..82f74f8
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Cacheable.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+
+@Target( { TYPE })
+@Retention(RUNTIME)
+public @interface Cacheable {
+
+    boolean value() default true;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CascadeType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CascadeType.java
new file mode 100644
index 0000000..7483486
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CascadeType.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+public enum CascadeType { 
+
+    ALL, 
+
+    PERSIST, 
+
+    MERGE, 
+
+    REMOVE,
+
+    REFRESH,
+
+    DETACH
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CollectionTable.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CollectionTable.java
new file mode 100644
index 0000000..34a60e0
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/CollectionTable.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface CollectionTable {
+
+    String name() default "";
+
+    String catalog() default "";
+
+    String schema() default "";
+
+     JoinColumn[] joinColumns() default {};
+
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+    UniqueConstraint[] uniqueConstraints() default {};
+
+    Index[] indexes() default {};
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Column.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Column.java
new file mode 100644
index 0000000..e5a5330
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Column.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+public @interface Column {
+
+    String name() default "";
+
+    boolean unique() default false;
+
+    boolean nullable() default true;
+
+    boolean insertable() default true;
+
+    boolean updatable() default true;
+
+    String columnDefinition() default "";
+
+    String table() default "";
+
+    int length() default 255;
+
+    int precision() default 0;
+
+    int scale() default 0;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ColumnResult.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ColumnResult.java
new file mode 100644
index 0000000..681805d
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ColumnResult.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({}) 
+@Retention(RUNTIME)
+
+public @interface ColumnResult { 
+
+    String name();
+
+    Class type() default void.class;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ConstraintMode.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ConstraintMode.java
new file mode 100644
index 0000000..b4753c9
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ConstraintMode.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+public enum ConstraintMode {
+
+	CONSTRAINT,
+
+	NO_CONSTRAINT,
+
+        PROVIDER_DEFAULT
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ConstructorResult.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ConstructorResult.java
new file mode 100644
index 0000000..ed4d7ae
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ConstructorResult.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({}) 
+@Retention(RUNTIME)
+
+public @interface ConstructorResult { 
+
+    Class targetClass();
+
+    ColumnResult[] columns();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Convert.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Convert.java
new file mode 100644
index 0000000..3d2776d
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Convert.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({METHOD, FIELD, TYPE}) @Retention(RUNTIME)
+public @interface Convert {
+
+  Class converter() default void.class;
+
+  String attributeName() default "";
+
+  boolean disableConversion() default false;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Converter.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Converter.java
new file mode 100644
index 0000000..f0b04aa
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Converter.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({TYPE}) @Retention(RUNTIME)
+public @interface Converter {
+     boolean autoApply() default false;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Converts.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Converts.java
new file mode 100644
index 0000000..712d08d
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Converts.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({METHOD, FIELD, TYPE})
+@Retention(RUNTIME)
+public @interface Converts {
+
+  Convert[] value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/DiscriminatorColumn.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/DiscriminatorColumn.java
new file mode 100644
index 0000000..24728ff
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/DiscriminatorColumn.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.DiscriminatorType.STRING;
+
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+
+public @interface DiscriminatorColumn {
+
+    String name() default "DTYPE";
+
+    DiscriminatorType discriminatorType() default STRING;
+
+    String columnDefinition() default "";
+
+    int length() default 31;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/DiscriminatorType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/DiscriminatorType.java
new file mode 100644
index 0000000..0b2dc80
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/DiscriminatorType.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public enum DiscriminatorType { 
+
+    STRING,
+
+    CHAR,
+
+    INTEGER
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/DiscriminatorValue.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/DiscriminatorValue.java
new file mode 100644
index 0000000..1c5e860
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/DiscriminatorValue.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+
+public @interface DiscriminatorValue {
+
+    String value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ElementCollection.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ElementCollection.java
new file mode 100644
index 0000000..daeb630
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ElementCollection.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.LAZY;
+
+
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface ElementCollection {
+
+    Class targetClass() default void.class;
+    FetchType fetch() default LAZY;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Embeddable.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Embeddable.java
new file mode 100644
index 0000000..90c36cb
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Embeddable.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Documented
+@Target({TYPE}) 
+@Retention(RUNTIME)
+public @interface Embeddable {
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Embedded.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Embedded.java
new file mode 100644
index 0000000..be8f73f
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Embedded.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface Embedded {
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EmbeddedId.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EmbeddedId.java
new file mode 100644
index 0000000..f8d288d
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EmbeddedId.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface EmbeddedId {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Entity.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Entity.java
new file mode 100644
index 0000000..8759f21
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Entity.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Documented
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface Entity {
+
+	String name() default "";
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityExistsException.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityExistsException.java
new file mode 100644
index 0000000..ab812ad
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityExistsException.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public class EntityExistsException extends PersistenceException {
+
+    public EntityExistsException() {
+        super();
+    }
+
+    public EntityExistsException(String message) {
+        super(message);
+    }
+    public EntityExistsException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public EntityExistsException(Throwable cause) {
+        super(cause);
+    }
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityGraph.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityGraph.java
new file mode 100644
index 0000000..af28329
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityGraph.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import javax.persistence.metamodel.Attribute;
+import java.util.List;
+
+public interface EntityGraph<T> {
+
+    public String getName();
+
+    public void addAttributeNodes(String ... attributeName);
+
+    public void addAttributeNodes(Attribute<T, ?> ... attribute);
+
+    public <X> Subgraph<X> addSubgraph(Attribute<T, X> attribute);
+
+    public <X> Subgraph<? extends X> addSubgraph(Attribute<T, X> attribute, Class<? extends X> type);
+
+    public <X> Subgraph<X> addSubgraph(String attributeName);
+
+    public <X> Subgraph<X> addSubgraph(String attributeName, Class<X> type);
+
+    public <X> Subgraph<X> addKeySubgraph(Attribute<T, X> attribute);
+
+    public <X> Subgraph<? extends X> addKeySubgraph(Attribute<T, X> attribute, Class<? extends X> type);
+
+    public <X> Subgraph<X> addKeySubgraph(String attributeName);
+
+    public <X> Subgraph<X> addKeySubgraph(String attributeName, Class<X> type);
+
+
+    public <T> Subgraph<? extends T> addSubclassSubgraph(Class<? extends T> type);
+//    public <S extends T> Subgraph<S> addSubclassSubgraph(Class<S> type);
+
+
+    public List<AttributeNode<?>> getAttributeNodes();
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityListeners.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityListeners.java
new file mode 100644
index 0000000..422c446
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityListeners.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+public @interface EntityListeners {
+
+    Class[] value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityManager.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityManager.java
new file mode 100644
index 0000000..9bcc9a8
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityManager.java
@@ -0,0 +1,149 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.util.Map;
+import java.util.List;
+import javax.persistence.metamodel.Metamodel;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.CriteriaUpdate;
+import javax.persistence.criteria.CriteriaDelete;
+
+public interface EntityManager {
+
+    public void persist(Object entity);
+    
+    public <T> T merge(T entity);
+
+    public void remove(Object entity);
+    
+    public <T> T find(Class<T> entityClass, Object primaryKey);
+    
+    public <T> T find(Class<T> entityClass, Object primaryKey, 
+                      Map<String, Object> properties); 
+    
+    public <T> T find(Class<T> entityClass, Object primaryKey,
+                      LockModeType lockMode);
+
+    public <T> T find(Class<T> entityClass, Object primaryKey,
+                      LockModeType lockMode, 
+                      Map<String, Object> properties);
+
+    public <T> T getReference(Class<T> entityClass, 
+                                  Object primaryKey);
+
+    public void flush();
+
+    public void setFlushMode(FlushModeType flushMode);
+
+    public FlushModeType getFlushMode();
+
+    public void lock(Object entity, LockModeType lockMode);
+
+    public void lock(Object entity, LockModeType lockMode,
+                     Map<String, Object> properties);
+
+    public void refresh(Object entity);
+
+    public void refresh(Object entity,
+                            Map<String, Object> properties); 
+
+    public void refresh(Object entity, LockModeType lockMode);
+
+    public void refresh(Object entity, LockModeType lockMode,
+                        Map<String, Object> properties);
+    
+    public void clear();
+
+    public void detach(Object entity); 
+
+    public boolean contains(Object entity);
+
+    public LockModeType getLockMode(Object entity);
+
+    public void setProperty(String propertyName, Object value);
+
+    public Map<String, Object> getProperties();
+
+    public Query createQuery(String qlString);
+
+    public <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery); 
+
+    public Query createQuery(CriteriaUpdate updateQuery);
+
+    public Query createQuery(CriteriaDelete deleteQuery);
+
+    public <T> TypedQuery<T> createQuery(String qlString, Class<T> resultClass);
+
+    public Query createNamedQuery(String name);
+
+    public <T> TypedQuery<T> createNamedQuery(String name, Class<T> resultClass);
+
+    public Query createNativeQuery(String sqlString);
+
+    public Query createNativeQuery(String sqlString, Class resultClass);
+
+    public Query createNativeQuery(String sqlString, String resultSetMapping);
+
+    public StoredProcedureQuery createNamedStoredProcedureQuery(String name);
+
+    public StoredProcedureQuery createStoredProcedureQuery(String procedureName);
+
+    public StoredProcedureQuery createStoredProcedureQuery(
+	       String procedureName, Class... resultClasses);
+
+    public StoredProcedureQuery createStoredProcedureQuery(
+              String procedureName, String... resultSetMappings);
+
+    public void joinTransaction();
+
+    public boolean isJoinedToTransaction();
+
+    public <T> T unwrap(Class<T> cls); 
+
+    public Object getDelegate();
+
+    public void close();
+
+    public boolean isOpen();
+
+    public EntityTransaction getTransaction();
+
+    public EntityManagerFactory getEntityManagerFactory();
+
+    public CriteriaBuilder getCriteriaBuilder();
+
+    public Metamodel getMetamodel();
+
+    public <T> EntityGraph<T> createEntityGraph(Class<T> rootType);
+
+    public EntityGraph<?> createEntityGraph(String graphName);
+
+    public  EntityGraph<?> getEntityGraph(String graphName);
+
+    public <T> List<EntityGraph<? super T>> getEntityGraphs(Class<T> entityClass);
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityManagerFactory.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityManagerFactory.java
new file mode 100644
index 0000000..c93a226
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityManagerFactory.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.util.Map;
+import javax.persistence.metamodel.Metamodel;
+import javax.persistence.criteria.CriteriaBuilder;
+
+public interface EntityManagerFactory {
+
+    public EntityManager createEntityManager();
+    
+    public EntityManager createEntityManager(Map map);
+
+    public EntityManager createEntityManager(SynchronizationType synchronizationType);
+
+    public EntityManager createEntityManager(SynchronizationType synchronizationType, Map map);
+
+    public CriteriaBuilder getCriteriaBuilder();
+    
+    public Metamodel getMetamodel();
+
+    public boolean isOpen();
+    
+    public void close();
+
+    public Map<String, Object> getProperties();
+
+    public Cache getCache();
+
+    public PersistenceUnitUtil getPersistenceUnitUtil();
+
+    public void addNamedQuery(String name, Query query);
+
+    public <T> T unwrap(Class<T> cls);
+
+    public <T> void addNamedEntityGraph(String graphName, EntityGraph<T> entityGraph);
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityNotFoundException.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityNotFoundException.java
new file mode 100644
index 0000000..0950068
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityNotFoundException.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public class EntityNotFoundException extends PersistenceException {
+
+    public EntityNotFoundException() {
+        super();
+    }
+
+    public EntityNotFoundException(String message) {
+        super(message);
+    }
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityResult.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityResult.java
new file mode 100644
index 0000000..5155fa5
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityResult.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({}) 
+@Retention(RUNTIME)
+public @interface EntityResult { 
+
+    Class entityClass(); 
+
+    FieldResult[] fields() default {};
+
+    String discriminatorColumn() default "";
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityTransaction.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityTransaction.java
new file mode 100644
index 0000000..f841acc
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EntityTransaction.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public interface EntityTransaction {
+
+     public void begin();
+
+     public void commit();
+
+     public void rollback();
+
+     public void setRollbackOnly();
+
+     public boolean getRollbackOnly();
+
+     public boolean isActive();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EnumType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EnumType.java
new file mode 100644
index 0000000..8592aa2
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/EnumType.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+
+public enum EnumType {
+    ORDINAL,
+
+    STRING
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Enumerated.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Enumerated.java
new file mode 100644
index 0000000..5b2d8e2
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Enumerated.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.EnumType.ORDINAL;
+
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+public @interface Enumerated {
+
+    EnumType value() default ORDINAL;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ExcludeDefaultListeners.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ExcludeDefaultListeners.java
new file mode 100644
index 0000000..8c27fcd
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ExcludeDefaultListeners.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+public @interface ExcludeDefaultListeners {
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ExcludeSuperclassListeners.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ExcludeSuperclassListeners.java
new file mode 100644
index 0000000..c2fd402
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ExcludeSuperclassListeners.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+
+public @interface ExcludeSuperclassListeners {
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/FetchType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/FetchType.java
new file mode 100644
index 0000000..9d8c4cf
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/FetchType.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public enum FetchType {
+
+    LAZY,
+
+    EAGER
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/FieldResult.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/FieldResult.java
new file mode 100644
index 0000000..bbbb62a
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/FieldResult.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({}) 
+@Retention(RUNTIME)
+
+public @interface FieldResult { 
+
+    String name();
+
+    String column();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/FlushModeType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/FlushModeType.java
new file mode 100644
index 0000000..dc780b0
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/FlushModeType.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public enum FlushModeType {
+
+   COMMIT,
+
+   AUTO
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ForeignKey.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ForeignKey.java
new file mode 100644
index 0000000..3ef43be
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ForeignKey.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static javax.persistence.ConstraintMode.CONSTRAINT;
+
+@Target({})
+@Retention(RUNTIME)
+public @interface ForeignKey {
+
+    String name() default "";
+
+    ConstraintMode value() default CONSTRAINT;
+
+    String foreignKeyDefinition() default "";
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/GeneratedValue.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/GeneratedValue.java
new file mode 100644
index 0000000..8db4bd3
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/GeneratedValue.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.GenerationType.AUTO;
+
+
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface GeneratedValue {
+
+    GenerationType strategy() default AUTO;
+
+    String generator() default "";
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/GenerationType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/GenerationType.java
new file mode 100644
index 0000000..db19ea9
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/GenerationType.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public enum GenerationType { 
+
+    TABLE, 
+
+    SEQUENCE, 
+
+    IDENTITY, 
+
+    AUTO
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Id.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Id.java
new file mode 100644
index 0000000..b727d3f
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Id.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface Id {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/IdClass.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/IdClass.java
new file mode 100644
index 0000000..91cf930
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/IdClass.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE})
+@Retention(RUNTIME)
+
+public @interface IdClass {
+
+    Class value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Index.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Index.java
new file mode 100644
index 0000000..26cd0ec
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Index.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Target({})
+@Retention(RUNTIME)
+public @interface Index {
+
+    String name() default "";
+
+    String columnList();
+
+    boolean unique() default false;
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Inheritance.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Inheritance.java
new file mode 100644
index 0000000..f248663
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Inheritance.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.InheritanceType.SINGLE_TABLE;
+
+
+@Target({TYPE})
+@Retention(RUNTIME)
+
+public @interface Inheritance {
+
+    InheritanceType strategy() default SINGLE_TABLE;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/InheritanceType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/InheritanceType.java
new file mode 100644
index 0000000..47fb98e
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/InheritanceType.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public enum InheritanceType { 
+
+    SINGLE_TABLE, 
+
+    TABLE_PER_CLASS, 
+
+    JOINED 
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/JoinColumn.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/JoinColumn.java
new file mode 100644
index 0000000..f0c14da
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/JoinColumn.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface JoinColumn {
+
+    String name() default "";
+
+    String referencedColumnName() default "";
+
+    boolean unique() default false;
+
+    boolean nullable() default true;
+
+    boolean insertable() default true;
+
+    boolean updatable() default true;
+
+    String columnDefinition() default "";
+
+    String table() default "";
+
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/JoinColumns.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/JoinColumns.java
new file mode 100644
index 0000000..518282f
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/JoinColumns.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+public @interface JoinColumns {
+
+    JoinColumn[] value();
+
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/JoinTable.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/JoinTable.java
new file mode 100644
index 0000000..0f16aef
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/JoinTable.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+
+public @interface JoinTable {
+
+    String name() default "";
+
+    String catalog() default "";
+
+    String schema() default "";
+
+    JoinColumn[] joinColumns() default {};
+
+    JoinColumn[] inverseJoinColumns() default {};
+
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+    ForeignKey inverseForeignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+    UniqueConstraint[] uniqueConstraints() default {};
+
+    Index[] indexes() default {};
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Lob.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Lob.java
new file mode 100644
index 0000000..98b37b4
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Lob.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+public @interface Lob {
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/LockModeType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/LockModeType.java
new file mode 100644
index 0000000..a492a6d
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/LockModeType.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public enum LockModeType
+{
+    READ,
+
+    WRITE,
+
+    OPTIMISTIC,
+
+    OPTIMISTIC_FORCE_INCREMENT,
+
+    PESSIMISTIC_READ,
+
+    PESSIMISTIC_WRITE,
+
+    PESSIMISTIC_FORCE_INCREMENT,
+
+    NONE
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/LockTimeoutException.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/LockTimeoutException.java
new file mode 100644
index 0000000..90e7013
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/LockTimeoutException.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public class LockTimeoutException extends PersistenceException {
+    Object entity;
+
+    public LockTimeoutException() {
+        super();
+    }
+
+    public LockTimeoutException(String message) {
+        super(message);
+    }
+
+    public LockTimeoutException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public LockTimeoutException(Throwable cause) {
+        super(cause);
+    }
+
+    public LockTimeoutException(Object entity) {
+        this.entity = entity;
+    }
+
+    public LockTimeoutException(String message, Throwable cause, Object entity) {
+        super(message, cause);
+        this.entity = entity;
+    }
+    public Object getObject() {
+        return this.entity;
+    }
+}
+
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ManyToMany.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ManyToMany.java
new file mode 100644
index 0000000..1158b37
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ManyToMany.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.LAZY;
+
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+public @interface ManyToMany {
+
+    Class targetEntity() default void.class;
+
+    CascadeType[] cascade() default {};
+
+    FetchType fetch() default LAZY;
+
+    String mappedBy() default "";
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ManyToOne.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ManyToOne.java
new file mode 100644
index 0000000..ab4290a
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ManyToOne.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.EAGER;
+
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+
+public @interface ManyToOne {
+
+    Class targetEntity() default void.class;
+
+    CascadeType[] cascade() default {};
+
+    FetchType fetch() default EAGER;
+
+    boolean optional() default true;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKey.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKey.java
new file mode 100644
index 0000000..80842f5
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKey.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+public @interface MapKey {
+
+    String name() default "";
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyClass.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyClass.java
new file mode 100644
index 0000000..e684f03
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyClass.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface MapKeyClass {
+	Class value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyColumn.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyColumn.java
new file mode 100644
index 0000000..9f717f3
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyColumn.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface MapKeyColumn {
+
+	String name() default "";
+
+	boolean unique() default false;
+
+	boolean nullable() default false;
+
+	boolean insertable() default true;
+
+	boolean updatable() default true;
+
+	String columnDefinition() default "";
+
+	String table() default "";
+
+	int length() default 255;
+
+	int precision() default 0; 
+
+	int scale() default 0; 
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyEnumerated.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyEnumerated.java
new file mode 100644
index 0000000..3e85995
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyEnumerated.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.EnumType.ORDINAL;
+
+
+@Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface MapKeyEnumerated {
+    EnumType value() default ORDINAL;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyJoinColumn.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyJoinColumn.java
new file mode 100644
index 0000000..4317567
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyJoinColumn.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface MapKeyJoinColumn {
+	String name() default "";
+
+	String referencedColumnName() default "";
+
+	boolean unique() default false;
+
+	boolean nullable() default false;
+
+	boolean insertable() default true;
+
+	boolean updatable() default true;
+
+	String columnDefinition() default "";
+
+	String table() default "";
+
+        ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyJoinColumns.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyJoinColumns.java
new file mode 100644
index 0000000..f600053
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyJoinColumns.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface MapKeyJoinColumns {
+	MapKeyJoinColumn[] value();
+
+        ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyTemporal.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyTemporal.java
new file mode 100644
index 0000000..7d37f57
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapKeyTemporal.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+public @interface MapKeyTemporal {
+
+    TemporalType value();
+}
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MappedSuperclass.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MappedSuperclass.java
new file mode 100644
index 0000000..46de6b1
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MappedSuperclass.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Documented
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface MappedSuperclass {
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapsId.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapsId.java
new file mode 100644
index 0000000..69aa4ef
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/MapsId.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface MapsId {
+
+   String value() default ""; }
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedAttributeNode.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedAttributeNode.java
new file mode 100644
index 0000000..f333202
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedAttributeNode.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({})
+@Retention(RUNTIME)
+public @interface NamedAttributeNode {
+
+    String value();
+
+    String subgraph() default "";
+
+    String keySubgraph() default "";
+}
+
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedEntityGraph.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedEntityGraph.java
new file mode 100644
index 0000000..ff789da
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedEntityGraph.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface NamedEntityGraph {
+
+    String name() default "";
+
+    NamedAttributeNode[] attributeNodes() default {};
+
+    boolean includeAllAttributes() default false;
+
+    NamedSubgraph[] subgraphs() default {};
+
+    NamedSubgraph[] subclassSubgraphs() default {};
+}
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedEntityGraphs.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedEntityGraphs.java
new file mode 100644
index 0000000..c364b11
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedEntityGraphs.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface NamedEntityGraphs{
+    NamedEntityGraph[] value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedNativeQueries.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedNativeQueries.java
new file mode 100644
index 0000000..c7d7e46
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedNativeQueries.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence; 
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+public @interface NamedNativeQueries { 
+
+    NamedNativeQuery[] value ();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedNativeQuery.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedNativeQuery.java
new file mode 100644
index 0000000..b7cd3b2
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedNativeQuery.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+public @interface NamedNativeQuery { 
+
+    String name();
+
+    String query();
+
+    QueryHint[] hints() default {};
+
+    Class resultClass() default void.class; 
+
+    String resultSetMapping() default "";
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedQueries.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedQueries.java
new file mode 100644
index 0000000..160d639
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedQueries.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence; 
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE})  
+@Retention(RUNTIME) 
+public @interface NamedQueries { 
+
+     NamedQuery [] value (); 
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedQuery.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedQuery.java
new file mode 100644
index 0000000..cf1c3fa
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedQuery.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static javax.persistence.LockModeType.NONE;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+public @interface NamedQuery {
+
+    String name();
+
+    String query();
+
+    LockModeType lockMode() default NONE;
+    QueryHint[] hints() default {};
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedStoredProcedureQueries.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedStoredProcedureQueries.java
new file mode 100644
index 0000000..a7d30b0
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedStoredProcedureQueries.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence; 
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+public @interface NamedStoredProcedureQueries { 
+
+    NamedStoredProcedureQuery[] value ();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedStoredProcedureQuery.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedStoredProcedureQuery.java
new file mode 100644
index 0000000..af0a5fc
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedStoredProcedureQuery.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;  
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+public @interface NamedStoredProcedureQuery { 
+
+    String name();
+
+    String procedureName();
+
+    StoredProcedureParameter[] parameters() default {};
+
+    Class[] resultClasses() default {}; 
+
+    String[] resultSetMappings() default {};
+
+    QueryHint[] hints() default {};
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedSubgraph.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedSubgraph.java
new file mode 100644
index 0000000..f21ffbf
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NamedSubgraph.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({})
+@Retention(RUNTIME)
+public @interface NamedSubgraph {
+
+    String name();
+
+    Class type() default void.class;
+
+    NamedAttributeNode[] attributeNodes();
+}
+
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NoResultException.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NoResultException.java
new file mode 100644
index 0000000..777ab4c
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NoResultException.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+public class NoResultException extends PersistenceException {
+
+    public NoResultException() {
+        super();
+    }
+
+    public NoResultException(String message) {
+        super(message);
+    }
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NonUniqueResultException.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NonUniqueResultException.java
new file mode 100644
index 0000000..d31d468
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/NonUniqueResultException.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public class NonUniqueResultException extends PersistenceException {
+
+    public NonUniqueResultException() {
+        super();
+    }
+
+    public NonUniqueResultException(String message) {
+        super(message);
+    }
+}
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OneToMany.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OneToMany.java
new file mode 100644
index 0000000..e261194
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OneToMany.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.LAZY;
+
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+
+public @interface OneToMany {
+
+    Class targetEntity() default void.class;
+
+    CascadeType[] cascade() default {};
+
+    FetchType fetch() default LAZY;
+
+    String mappedBy() default "";
+
+    boolean orphanRemoval() default false;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OneToOne.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OneToOne.java
new file mode 100644
index 0000000..c67cc55
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OneToOne.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.EAGER;
+
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+
+public @interface OneToOne {
+
+    Class targetEntity() default void.class;
+
+    CascadeType[] cascade() default {};
+
+    FetchType fetch() default EAGER;
+
+    boolean optional() default true;
+
+    String mappedBy() default "";
+
+
+    boolean orphanRemoval() default false;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OptimisticLockException.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OptimisticLockException.java
new file mode 100644
index 0000000..45a62b4
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OptimisticLockException.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+public class OptimisticLockException extends PersistenceException {
+
+    Object entity;
+
+    public OptimisticLockException() {
+        super();
+    }
+
+    public OptimisticLockException(String message) {
+        super(message);
+    }
+
+    public OptimisticLockException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public OptimisticLockException(Throwable cause) {
+        super(cause);
+    }
+
+    public OptimisticLockException(Object entity) {
+        this.entity = entity;
+    }
+
+    public OptimisticLockException(String message, Throwable cause, Object entity) {
+        super(message, cause);
+        this.entity = entity;
+    }
+
+    public Object getEntity() {
+        return this.entity;
+    }
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OrderBy.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OrderBy.java
new file mode 100644
index 0000000..01c75db
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OrderBy.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+
+public @interface OrderBy {
+
+    String value() default "";
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OrderColumn.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OrderColumn.java
new file mode 100644
index 0000000..2a490d8
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/OrderColumn.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface OrderColumn {
+
+    String name() default "";
+
+    boolean nullable() default true;
+
+    boolean insertable() default true;
+
+    boolean updatable() default true;
+
+    String columnDefinition() default "";
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Parameter.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Parameter.java
new file mode 100644
index 0000000..2983f8e
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Parameter.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public interface Parameter<T> {
+
+    String getName();
+
+    Integer getPosition();
+
+     Class<T> getParameterType();
+}
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ParameterMode.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ParameterMode.java
new file mode 100644
index 0000000..f468b4c
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ParameterMode.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence; 
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+public enum ParameterMode {
+
+    IN,
+
+    INOUT,
+
+    OUT,
+
+    REF_CURSOR,
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Persistence.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Persistence.java
new file mode 100644
index 0000000..27a89ff
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Persistence.java
@@ -0,0 +1,381 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.persistence.spi.LoadState;
+import javax.persistence.spi.PersistenceProvider;
+import javax.persistence.spi.PersistenceProviderResolver;
+import javax.persistence.spi.PersistenceProviderResolverHolder;
+import javax.persistence.spi.ProviderUtil;
+
+import org.apache.geronimo.osgi.locator.ProviderLocator;
+
+/**
+ * Bootstrap class to obtain {@link javax.persistence.EntityManagerFactory}
+ * references.
+ *
+ * Contains Geronimo implemented code as required by the JPA spec.
+ *
+ * @version $Rev$ $Date$
+ */
+public class Persistence {
+
+    // The following variable is only here for TCK backward compatibility
+    @Deprecated
+    protected static final Set<PersistenceProvider> providers = new HashSet<PersistenceProvider>();
+
+    // The following string is only here for TCK backward compatibility
+    @Deprecated
+    public static final String PERSISTENCE_PROVIDER = "javax.persistence.spi.PeristenceProvider";
+
+    static final String PERSISTENCE_PROVIDER_PROPERTY = "javax.persistence.provider";
+
+    static final String PERSISTENCE_PROVIDER_SERVICE = "META-INF/services/"
+            + PersistenceProvider.class.getName();
+
+
+    public static EntityManagerFactory createEntityManagerFactory(
+            String persistenceUnitName) {
+        return createEntityManagerFactory(persistenceUnitName, Collections.EMPTY_MAP);
+    }
+
+    /**
+     * Geronimo implementation specific code
+     */
+    public static EntityManagerFactory createEntityManagerFactory(
+            String persistenceUnitName, Map properties) {
+
+        EntityManagerFactory factory = null;
+        Map props = properties;
+        if (props == null) {
+            props = Collections.EMPTY_MAP;
+        }
+
+        // get the discovered set of providers
+        List<PersistenceProvider> providers = getProviders();
+
+        /*
+         * Geronimo/OpenJPA 1.0 unique behavior - Start by loading a provider
+         * explicitly specified in the properties and return any exceptions.
+         * The spec doesn't forbid providers that aren't a service - it only
+         * states that they "should" be implemented as services in Sect. 9.2.
+         *
+         * For 2.0 - We only perform the above behavior if the specified
+         * provider is not in the discovered list.
+         *
+         * Note: This special non-spec defined case will rethrow any encountered
+         * Exceptions as a PersistenceException.
+         */
+        Object propVal = props.get(PERSISTENCE_PROVIDER_PROPERTY);
+        if ((propVal != null) && (propVal instanceof String)) {
+            boolean isLoaded = false;
+            String providerName = propVal.toString();
+            // search the discovered providers for this explicit provider
+            for (PersistenceProvider provider : providers) {
+                if (provider.getClass().getName().compareTo(providerName) == 0) {
+                    isLoaded = true;
+                    break;
+                }
+            }
+            /*
+             * Only try to explicitly create this provider if we didn't
+             * find it as a service, while rethrowing any exceptions to
+             * match the old 1.0 behavior
+             */
+            if (!isLoaded) {
+                factory = createFactory(
+                    providerName.toString(),
+                    persistenceUnitName,
+                    props);
+                if (factory != null) {
+                    return factory;
+                }
+            }
+        }
+
+        /*
+         * Now, the default JPA2 behavior of loading a provider from our resolver
+         *
+         * Note:  Change in behavior from 1.0, which always returned exceptions:
+         *   Spec states that a provider "must" return null if it
+         *   cannot fulfill an EMF request, so that if we have more than one
+         *   provider, then the other providers have a chance to return an EMF.
+         *   Now, we will return any exceptions wrapped in a
+         *   PersistenceException to match 1.0 behavior and provide more
+         *   diagnostics to the end user.
+         */
+
+        // capture any provider returned exceptions
+        Map<String, Throwable> exceptions = new HashMap<String, Throwable>();
+        // capture the provider names to use in the exception text if needed
+        StringBuffer foundProviders = null;
+
+        for (PersistenceProvider provider : providers) {
+            String providerName = provider.getClass().getName();
+            try {
+                factory = provider.createEntityManagerFactory(persistenceUnitName, props);
+            } catch (Exception e) {
+                // capture the exception details and give other providers a chance
+                exceptions.put(providerName, e);
+            }
+            if (factory != null) {
+                // we're done
+                return factory;
+            } else {
+                // update the list of providers we have tried
+                if (foundProviders == null) {
+                    foundProviders = new StringBuffer(providerName);
+                } else {
+                    foundProviders.append(", ");
+                    foundProviders.append(providerName);
+                }
+            }
+        }
+
+        // make sure our providers list is initialized for the exceptions below
+        if (foundProviders == null) {
+            foundProviders = new StringBuffer("NONE");
+        }
+
+        /*
+         * Spec doesn't mention any exceptions thrown by this method if no emf
+         * returned, but old 1.0 behavior always generated an EMF or exception.
+         */
+        if (exceptions.isEmpty()) {
+            // throw an exception with the PU name and providers we tried
+            throw new PersistenceException("No persistence providers available for \"" + persistenceUnitName +
+                "\" after trying the following discovered implementations: " + foundProviders);
+        } else {
+            // we encountered one or more exceptions, so format and throw as a single exception
+            throw createPersistenceException(
+                "Explicit persistence provider error(s) occurred for \"" + persistenceUnitName +
+                "\" after trying the following discovered implementations: " + foundProviders,
+                exceptions);
+        }
+    }
+
+    /*
+     * Geronimo/OpenJPA private helper code for PERSISTENCE_PROVIDER_PROPERTY
+     * @return EntityManagerFactory or null
+     * @throws PersistenceException
+     */
+    private static EntityManagerFactory createFactory(String providerName,
+            String persistenceUnitName, Map properties)
+            throws PersistenceException {
+
+        Class<?> providerClass;
+
+        // get our class loader
+        ClassLoader cl = PrivClassLoader.get(null);
+        if (cl == null)
+            cl = PrivClassLoader.get(Persistence.class);
+
+        try {
+            providerClass = ProviderLocator.loadClass(providerName, Persistence.class, cl);
+        } catch (Exception e) {
+            throw new PersistenceException("Invalid or inaccessible explicit provider class: " +
+                providerName, e);
+        }
+        try {
+            PersistenceProvider provider = (PersistenceProvider) providerClass.newInstance();
+            return provider.createEntityManagerFactory(persistenceUnitName, properties);
+        } catch (Exception e) {
+            throw new PersistenceException("Explicit error returned from provider: " +
+                providerName + " for PU: " + persistenceUnitName, e);
+        }
+    }
+
+
+    /**
+     * Geronimo/OpenJPA private helper code for creating a PersistenceException
+     * @param msg String to use as the exception message
+     * @param failures Persistence provider exceptions to add to the exception message
+     * @return PersistenceException
+     */
+    private static PersistenceException createPersistenceException(String msg, Map<String, Throwable> failures) {
+        String newline = System.getProperty("line.separator");
+        StringWriter strWriter = new StringWriter();
+        strWriter.append(msg);
+        if (failures.size() <= 1) {
+            // we caught an exception, so include it as the cause
+            Throwable t = null;
+            for (String providerName : failures.keySet()) {
+                t = failures.get(providerName);
+                strWriter.append(" from provider: ");
+                strWriter.append(providerName);
+                break;
+            }
+            return new PersistenceException(strWriter.toString(), t);
+        } else {
+            // we caught multiple exceptions, so format them into the message string and don't set a cause
+            strWriter.append(" with the following failures:");
+            strWriter.append(newline);
+            for (String providerName : failures.keySet()) {
+                strWriter.append(providerName);
+                strWriter.append(" returned: ");
+                failures.get(providerName).printStackTrace(new PrintWriter(strWriter));
+            }
+            strWriter.append(newline);
+            return new PersistenceException(strWriter.toString());
+        }
+    }
+
+    public static PersistenceUtil getPersistenceUtil() {
+        return new PersistenceUtilImpl();
+    }
+
+    public static void generateSchema(String persistenceUnitName, Map properties) {
+        final List<PersistenceProvider> providers = getProviders();
+        for (final PersistenceProvider provider : providers) {
+            if (provider.generateSchema( persistenceUnitName, properties)) {
+                return;
+            }
+        }
+        throw new PersistenceException("No provider for schema generation of unit '" + persistenceUnitName + "'");
+    }
+
+    private static List<PersistenceProvider> getProviders() {
+        // get the discovered set of providers
+        PersistenceProviderResolver resolver =
+                PersistenceProviderResolverHolder.getPersistenceProviderResolver();
+        // following will throw PersistenceExceptions for invalid services
+        return resolver.getPersistenceProviders();
+    }
+
+    /**
+     * Geronimo implementation specific code
+     */
+    private static class PersistenceUtilImpl implements PersistenceUtil {
+
+        /**
+         * Determines the load state of the attribute of an entity
+         * @see javax.persistence.PersistenceUtil#isLoaded(java.lang.Object, java.lang.String)
+         */
+            public boolean isLoaded(Object entity, String attributeName) {
+                boolean isLoaded = true;
+
+                // Get the list of persistence providers from the resolver
+                List<PersistenceProvider> pps = getProviders();
+
+                // Iterate through the list using ProviderUtil.isLoadedWithoutReference()
+                for (PersistenceProvider pp : pps) {
+                    try {
+                        ProviderUtil pu = pp.getProviderUtil();
+                        LoadState ls = pu.isLoadedWithoutReference(entity, attributeName);
+                        if (ls == LoadState.LOADED)
+                            return true;
+                        if (ls == LoadState.NOT_LOADED)
+                            return false;
+                    }
+                    catch (Throwable t) {
+                        // JPA 1.0 providers will not implement the getProviderUtil
+                        // method.  Eat the exception and try the next provider.
+                    }
+                 }
+                // Iterate through the list a second time using ProviderUtil.isLoadedWithReference()
+                for (PersistenceProvider pp : pps) {
+                    try {
+                        ProviderUtil pu = pp.getProviderUtil();
+                        LoadState ls = pu.isLoadedWithReference(entity, attributeName);
+                        if (ls == LoadState.LOADED)
+                            return true;
+                        if (ls == LoadState.NOT_LOADED)
+                            return false;
+                    }
+                    catch (Throwable t) {
+                        // JPA 1.0 providers will not implement the getProviderUtil
+                        // method.  Eat the exception and try the next provider.
+                    }
+                 }
+
+                // All providers returned a load state of unknown.  Return true.
+                return true;
+            }
+
+            public boolean isLoaded(Object entity) {
+                // Get the list of persistence providers from the resolver
+                List<PersistenceProvider> pps = getProviders();
+
+                // Iterate through the list of providers, using ProviderUtil to
+                // determine the load state
+                for (PersistenceProvider pp : pps) {
+                    try {
+                        ProviderUtil pu = pp.getProviderUtil();
+                        LoadState ls = pu.isLoaded(entity);
+                        if (ls == LoadState.LOADED)
+                            return true;
+                        if (ls == LoadState.NOT_LOADED)
+                            return false;
+                        // Otherwise, load state is unknown.  Query the next provider.
+                    }
+                    catch (Throwable t) {
+                        // JPA 1.0 providers will not implement the getProviderUtil
+                        // method.  Eat the exception and try the next provider.
+                    }
+                }
+
+                // All providers returned a load state of unknown.  Return true.
+                return true;
+            }
+    }
+
+    /**
+     * Geronimo/OpenJPA private helper code for handling class loaders
+     */
+    private static class PrivClassLoader implements PrivilegedAction<ClassLoader> {
+        private final Class<?> c;
+
+        public static ClassLoader get(Class<?> c) {
+            final PrivClassLoader action = new PrivClassLoader(c);
+            if (System.getSecurityManager() != null)
+                return AccessController.doPrivileged(action);
+            else
+                return action.run();
+        }
+
+        private PrivClassLoader(Class<?> c) {
+            this.c = c;
+        }
+
+        public ClassLoader run() {
+            if (c != null)
+                return c.getClassLoader();
+            else
+                return Thread.currentThread().getContextClassLoader();
+        }
+    }
+}
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceContext.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceContext.java
new file mode 100644
index 0000000..35bd5bf
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceContext.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface PersistenceContext {
+
+    String name() default "";
+
+    String unitName() default "";
+
+    PersistenceContextType type() default PersistenceContextType.TRANSACTION;
+
+    SynchronizationType synchronization() default SynchronizationType.SYNCHRONIZED;
+
+    PersistenceProperty[] properties() default {};
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceContextType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceContextType.java
new file mode 100644
index 0000000..e3657d1
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceContextType.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public enum PersistenceContextType {
+
+    TRANSACTION,
+
+    EXTENDED
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceContexts.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceContexts.java
new file mode 100644
index 0000000..2ba733a
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceContexts.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface PersistenceContexts {
+
+    PersistenceContext[] value();
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceException.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceException.java
new file mode 100644
index 0000000..099fb38
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceException.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+public class PersistenceException extends RuntimeException {
+
+    public PersistenceException() {
+        super();
+    }
+
+    public PersistenceException(String message) {
+        super(message);
+    }
+
+    public PersistenceException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public PersistenceException(Throwable cause) {
+        super(cause);
+    }
+}
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceProperty.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceProperty.java
new file mode 100644
index 0000000..96f5e63
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceProperty.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+@Target({})
+@Retention(RUNTIME)
+public @interface PersistenceProperty {
+
+    String name();
+
+    String value();
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUnit.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUnit.java
new file mode 100644
index 0000000..eacfbe4
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUnit.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface PersistenceUnit {
+
+    String name() default "";
+
+    String unitName() default "";
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUnitUtil.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUnitUtil.java
new file mode 100644
index 0000000..c46693a
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUnitUtil.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public interface PersistenceUnitUtil extends PersistenceUtil {
+
+    public boolean isLoaded(Object entity, String attributeName);
+
+    public boolean isLoaded(Object entity);
+
+    public Object getIdentifier(Object entity);
+} 
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUnits.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUnits.java
new file mode 100644
index 0000000..d28ecef
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUnits.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+
+
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface PersistenceUnits {
+
+    PersistenceUnit[] value();
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUtil.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUtil.java
new file mode 100644
index 0000000..605c361
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PersistenceUtil.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public interface PersistenceUtil {
+
+    public boolean isLoaded(Object entity, String attributeName);
+
+    public boolean isLoaded(Object entity);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PessimisticLockException.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PessimisticLockException.java
new file mode 100644
index 0000000..cba4402
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PessimisticLockException.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+public class PessimisticLockException extends PersistenceException {
+    Object entity;
+
+    public PessimisticLockException() {
+        super();
+    }
+
+    public PessimisticLockException(String message) {
+        super(message);
+    }
+
+    public PessimisticLockException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public PessimisticLockException(Throwable cause) {
+        super(cause);
+    }
+
+    public PessimisticLockException(Object entity) {
+        this.entity = entity;
+    }
+
+    public PessimisticLockException(String message, Throwable cause, Object entity) {
+        super(message, cause);
+        this.entity = entity;
+    }
+    
+    public Object getEntity() {
+        return this.entity;
+    }
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PessimisticLockScope.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PessimisticLockScope.java
new file mode 100644
index 0000000..5bfe836
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PessimisticLockScope.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+
+public enum PessimisticLockScope {
+
+    NORMAL,
+
+    EXTENDED
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostLoad.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostLoad.java
new file mode 100644
index 0000000..c3b9a82
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostLoad.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD}) 
+@Retention(RUNTIME)
+
+public @interface PostLoad {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostPersist.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostPersist.java
new file mode 100644
index 0000000..4703c90
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostPersist.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD})
+@Retention(RUNTIME)
+
+public @interface PostPersist {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostRemove.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostRemove.java
new file mode 100644
index 0000000..fd63d31
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostRemove.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD})
+@Retention(RUNTIME)
+
+public @interface PostRemove {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostUpdate.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostUpdate.java
new file mode 100644
index 0000000..b07154f
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PostUpdate.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD})
+@Retention(RUNTIME)
+
+public @interface PostUpdate {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PrePersist.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PrePersist.java
new file mode 100644
index 0000000..88bb1ef
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PrePersist.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD}) 
+@Retention(RUNTIME)
+
+public @interface PrePersist {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PreRemove.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PreRemove.java
new file mode 100644
index 0000000..5a37a16
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PreRemove.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD})
+@Retention(RUNTIME)
+
+public @interface PreRemove {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PreUpdate.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PreUpdate.java
new file mode 100644
index 0000000..dbbe09a
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PreUpdate.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD}) 
+@Retention(RUNTIME)
+
+public @interface PreUpdate {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PrimaryKeyJoinColumn.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PrimaryKeyJoinColumn.java
new file mode 100644
index 0000000..ef5910a
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PrimaryKeyJoinColumn.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface PrimaryKeyJoinColumn {
+
+    String name() default "";
+
+    String referencedColumnName() default "";
+
+    String columnDefinition() default "";
+
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PrimaryKeyJoinColumns.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PrimaryKeyJoinColumns.java
new file mode 100644
index 0000000..7ebc845
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/PrimaryKeyJoinColumns.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface PrimaryKeyJoinColumns {
+
+    PrimaryKeyJoinColumn[] value();
+
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Query.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Query.java
new file mode 100644
index 0000000..811eaff
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Query.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+
+package javax.persistence;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+import java.util.Map;
+
+
+public interface Query {
+
+    List getResultList();
+
+    Object getSingleResult();
+
+    int executeUpdate();
+
+    Query setMaxResults(int maxResult);
+
+    int getMaxResults();
+
+    Query setFirstResult(int startPosition);
+
+    int getFirstResult();
+
+    Query setHint(String hintName, Object value);
+
+    Map<String, Object> getHints();
+
+    <T> Query setParameter(Parameter<T> param, T value);
+
+    Query setParameter(Parameter<Calendar> param, Calendar value, 
+                       TemporalType temporalType);
+
+    Query setParameter(Parameter<Date> param, Date value, 
+                       TemporalType temporalType);
+
+    Query setParameter(String name, Object value);
+
+    Query setParameter(String name, Calendar value, 
+                       TemporalType temporalType);
+
+    Query setParameter(String name, Date value, 
+                       TemporalType temporalType);
+
+    Query setParameter(int position, Object value);
+
+    Query setParameter(int position, Calendar value,  
+                       TemporalType temporalType);
+
+    Query setParameter(int position, Date value,  
+                       TemporalType temporalType);
+
+    Set<Parameter<?>> getParameters();
+
+    Parameter<?> getParameter(String name);
+
+    <T> Parameter<T> getParameter(String name, Class<T> type);
+
+    Parameter<?> getParameter(int position);
+
+    <T> Parameter<T> getParameter(int position, Class<T> type);
+
+    boolean isBound(Parameter<?> param);
+
+    <T> T getParameterValue(Parameter<T> param);
+
+    Object getParameterValue(String name);
+
+    Object getParameterValue(int position);
+
+    Query setFlushMode(FlushModeType flushMode);
+
+    FlushModeType getFlushMode();
+
+    Query setLockMode(LockModeType lockMode);
+
+    LockModeType getLockMode();
+
+    <T> T unwrap(Class<T> cls);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/QueryHint.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/QueryHint.java
new file mode 100644
index 0000000..c38f1af
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/QueryHint.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({}) 
+@Retention(RUNTIME)
+public @interface QueryHint { 
+
+    String name(); 
+
+    String value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/QueryTimeoutException.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/QueryTimeoutException.java
new file mode 100644
index 0000000..bf55706
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/QueryTimeoutException.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+public class QueryTimeoutException extends PersistenceException {
+
+    Query query;
+
+    public QueryTimeoutException() {
+        super();
+    }
+
+    public QueryTimeoutException(String message) {
+        super(message);
+    }
+
+    public QueryTimeoutException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public QueryTimeoutException(Throwable cause) {
+        super(cause);
+    }
+
+    public QueryTimeoutException(Query query) {
+        this.query = query;
+    }
+
+    public QueryTimeoutException(String message, Throwable cause, Query query) {
+        super(message, cause);
+        this.query = query;
+    }
+    
+    public Query getQuery() {
+        return this.query;
+    }
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/RollbackException.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/RollbackException.java
new file mode 100644
index 0000000..464a69e
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/RollbackException.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+public class RollbackException extends PersistenceException {
+    public RollbackException() {
+        super();
+    }
+
+    public RollbackException(String message) {
+        super(message);
+    }
+
+    public RollbackException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public RollbackException(Throwable cause) {
+        super(cause);
+    }
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SecondaryTable.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SecondaryTable.java
new file mode 100644
index 0000000..b625144
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SecondaryTable.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+@Target(TYPE) 
+@Retention(RUNTIME)
+
+public @interface SecondaryTable {
+
+    String name();
+
+    String catalog() default "";
+
+    String schema() default "";
+
+    PrimaryKeyJoinColumn[] pkJoinColumns() default {};
+
+    ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+    UniqueConstraint[] uniqueConstraints() default {};
+
+    Index[] indexes() default {};
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SecondaryTables.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SecondaryTables.java
new file mode 100644
index 0000000..a682492
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SecondaryTables.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target(TYPE) 
+@Retention(RUNTIME)
+
+public @interface SecondaryTables {
+
+    SecondaryTable[] value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SequenceGenerator.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SequenceGenerator.java
new file mode 100644
index 0000000..1113733
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SequenceGenerator.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE, METHOD, FIELD}) 
+@Retention(RUNTIME)
+public @interface SequenceGenerator {
+
+    String name();
+
+    String sequenceName() default "";
+
+    String catalog() default "";
+
+    String schema() default "";
+
+    int initialValue() default 1;
+
+    int allocationSize() default 50;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SharedCacheMode.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SharedCacheMode.java
new file mode 100644
index 0000000..ac295b4
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SharedCacheMode.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public enum SharedCacheMode {
+
+    ALL, 
+
+    NONE, 
+
+    ENABLE_SELECTIVE, 
+
+    DISABLE_SELECTIVE, 
+
+    UNSPECIFIED
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SqlResultSetMapping.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SqlResultSetMapping.java
new file mode 100644
index 0000000..5d90c8a
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SqlResultSetMapping.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+public @interface SqlResultSetMapping { 
+
+    String name(); 
+
+    EntityResult[] entities() default {};
+
+    ConstructorResult[] classes() default {};
+
+    ColumnResult[] columns() default {};
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SqlResultSetMappings.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SqlResultSetMappings.java
new file mode 100644
index 0000000..e16683e
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SqlResultSetMappings.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({TYPE}) 
+@Retention(RUNTIME)
+public @interface SqlResultSetMappings { 
+
+    SqlResultSetMapping[] value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/StoredProcedureParameter.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/StoredProcedureParameter.java
new file mode 100644
index 0000000..0418f92
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/StoredProcedureParameter.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence; 
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({}) 
+@Retention(RUNTIME)
+public @interface StoredProcedureParameter { 
+
+    String name() default "";
+
+    ParameterMode mode() default ParameterMode.IN;
+
+    Class type();
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/StoredProcedureQuery.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/StoredProcedureQuery.java
new file mode 100644
index 0000000..c665aa1
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/StoredProcedureQuery.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+public interface StoredProcedureQuery extends Query {
+
+    StoredProcedureQuery setHint(String hintName, Object value);
+
+    <T> StoredProcedureQuery setParameter(Parameter<T> param, 
+                                          T value);
+
+    StoredProcedureQuery setParameter(Parameter<Calendar> param,
+                                      Calendar value, 
+                                      TemporalType temporalType);
+
+    StoredProcedureQuery setParameter(Parameter<Date> param, 
+                                      Date value, 
+                                      TemporalType temporalType);
+
+    StoredProcedureQuery setParameter(String name, Object value);
+
+    StoredProcedureQuery setParameter(String name, 
+                                      Calendar value, 
+                                      TemporalType temporalType);
+
+    StoredProcedureQuery setParameter(String name, 
+                                      Date value, 
+                                      TemporalType temporalType);
+
+    StoredProcedureQuery setParameter(int position, Object value);
+
+    StoredProcedureQuery setParameter(int position, 
+                                      Calendar value,  
+                                      TemporalType temporalType);
+
+    StoredProcedureQuery setParameter(int position, 
+                                      Date value,  
+                                      TemporalType temporalType);
+
+    StoredProcedureQuery setFlushMode(FlushModeType flushMode);
+
+    StoredProcedureQuery registerStoredProcedureParameter(
+	  int position,
+	  Class type,
+	  ParameterMode mode);
+
+    StoredProcedureQuery registerStoredProcedureParameter(
+	  String parameterName,
+	  Class type,
+	  ParameterMode mode);
+
+    Object getOutputParameterValue(int position);
+
+    Object getOutputParameterValue(String parameterName);
+
+    boolean execute();
+
+    int executeUpdate();
+
+    List getResultList();
+
+    Object getSingleResult();
+
+    boolean hasMoreResults();
+
+    int getUpdateCount();
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Subgraph.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Subgraph.java
new file mode 100644
index 0000000..22e5de6
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Subgraph.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import javax.persistence.metamodel.Attribute;
+import java.util.List;
+
+public interface Subgraph<T> {
+
+    public void addAttributeNodes(String ... attributeName);
+
+    public void addAttributeNodes(Attribute<T, ?> ... attribute);
+
+    public <X> Subgraph<X> addSubgraph(Attribute<T, X> attribute);
+
+    public <X> Subgraph<? extends X> addSubgraph(Attribute<T, X> attribute, Class<? extends X> type);
+
+    public <X> Subgraph<X> addSubgraph(String attributeName);
+
+    public <X> Subgraph<X> addSubgraph(String attributeName, Class<X> type);
+
+    public <X> Subgraph<X> addKeySubgraph(Attribute<T, X> attribute);
+
+    public <X> Subgraph<? extends X> addKeySubgraph(Attribute<T, X> attribute, Class<? extends X> type);
+
+    public <X> Subgraph<X> addKeySubgraph(String attributeName);
+
+    public <X> Subgraph<X> addKeySubgraph(String attributeName, Class<X> type);
+
+    public List<AttributeNode<?>> getAttributeNodes();
+
+    public Class<T> getClassType();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SynchronizationType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SynchronizationType.java
new file mode 100644
index 0000000..449cd66
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/SynchronizationType.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+public enum SynchronizationType {
+
+    SYNCHRONIZED,
+
+    UNSYNCHRONIZED,
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Table.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Table.java
new file mode 100644
index 0000000..e864d86
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Table.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target(TYPE) 
+@Retention(RUNTIME)
+public @interface Table {
+
+    String name() default "";
+
+    String catalog() default "";
+
+    String schema() default "";
+
+    UniqueConstraint[] uniqueConstraints() default {};
+
+    Index[] indexes() default {};
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TableGenerator.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TableGenerator.java
new file mode 100644
index 0000000..ceebd55
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TableGenerator.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({TYPE, METHOD, FIELD}) 
+@Retention(RUNTIME)
+public @interface TableGenerator {
+
+    String name();
+
+    String table() default "";
+
+    String catalog() default "";
+
+    String schema() default "";
+
+    String pkColumnName() default "";
+
+    String valueColumnName() default "";
+
+    String pkColumnValue() default "";
+
+    int initialValue() default 0;
+
+    int allocationSize() default 50;
+
+    UniqueConstraint[] uniqueConstraints() default {};
+
+    Index[] indexes() default {};
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Temporal.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Temporal.java
new file mode 100644
index 0000000..63c2c60
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Temporal.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD, FIELD}) 
+@Retention(RUNTIME)
+public @interface Temporal {
+
+    TemporalType value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TemporalType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TemporalType.java
new file mode 100644
index 0000000..8a3e553
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TemporalType.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public enum TemporalType {
+
+    DATE, 
+
+    TIME, 
+
+    TIMESTAMP
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TransactionRequiredException.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TransactionRequiredException.java
new file mode 100644
index 0000000..fd1f684
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TransactionRequiredException.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public class TransactionRequiredException extends PersistenceException {
+
+    public TransactionRequiredException() {
+        super();
+    }
+
+    public TransactionRequiredException(String message) {
+        super(message);
+    }
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Transient.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Transient.java
new file mode 100644
index 0000000..8199150
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Transient.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface Transient {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Tuple.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Tuple.java
new file mode 100644
index 0000000..4fd098e
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Tuple.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import java.util.List;
+
+
+public interface Tuple {
+
+    <X> X get(TupleElement<X> tupleElement);
+
+    <X> X get(String alias, Class<X> type); 
+
+    Object get(String alias); 
+
+    <X> X get(int i, Class<X> type);
+
+    Object get(int i);
+
+    Object[] toArray();
+
+    List<TupleElement<?>> getElements();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TupleElement.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TupleElement.java
new file mode 100644
index 0000000..ffa028d
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TupleElement.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+
+public interface TupleElement<X> {
+    Class<? extends X> getJavaType();
+
+    String getAlias();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TypedQuery.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TypedQuery.java
new file mode 100644
index 0000000..1001bac
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/TypedQuery.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import java.util.List;
+import java.util.Date;
+import java.util.Calendar;
+
+
+public interface TypedQuery<X> extends Query {
+    List<X> getResultList();
+
+    X getSingleResult();
+
+    TypedQuery<X> setMaxResults(int maxResult);
+
+    TypedQuery<X> setFirstResult(int startPosition);
+
+    TypedQuery<X> setHint(String hintName, Object value);
+
+     <T> TypedQuery<X> setParameter(Parameter<T> param, T value);
+
+    TypedQuery<X> setParameter(Parameter<Calendar> param, 
+                               Calendar value,  
+                               TemporalType temporalType);
+
+    TypedQuery<X> setParameter(Parameter<Date> param, Date value,  
+                               TemporalType temporalType);
+
+    TypedQuery<X> setParameter(String name, Object value);
+
+    TypedQuery<X> setParameter(String name, Calendar value, 
+                               TemporalType temporalType);
+
+    TypedQuery<X> setParameter(String name, Date value, 
+                               TemporalType temporalType);
+
+    TypedQuery<X> setParameter(int position, Object value);
+
+    TypedQuery<X> setParameter(int position, Calendar value,  
+                               TemporalType temporalType);
+
+    TypedQuery<X> setParameter(int position, Date value,  
+                               TemporalType temporalType);
+
+     TypedQuery<X> setFlushMode(FlushModeType flushMode);
+
+     TypedQuery<X> setLockMode(LockModeType lockMode);
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/UniqueConstraint.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/UniqueConstraint.java
new file mode 100644
index 0000000..06387f9
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/UniqueConstraint.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({}) 
+@Retention(RUNTIME)
+public @interface UniqueConstraint {
+
+    String name() default "";
+
+    String[] columnNames();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ValidationMode.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ValidationMode.java
new file mode 100644
index 0000000..ed27f22
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/ValidationMode.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+
+public enum ValidationMode {
+    AUTO,
+
+    CALLBACK,
+
+    NONE
+    }
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Version.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Version.java
new file mode 100644
index 0000000..18a78ea
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/Version.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface Version {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/AbstractQuery.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/AbstractQuery.java
new file mode 100644
index 0000000..620a017
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/AbstractQuery.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.metamodel.EntityType;
+
+
+public interface AbstractQuery<T> extends CommonAbstractCriteria {
+
+    <X> Root<X> from(Class<X> entityClass);
+
+    <X> Root<X> from(EntityType<X> entity);
+    AbstractQuery<T> where(Expression<Boolean> restriction);
+
+    AbstractQuery<T> where(Predicate... restrictions);
+
+    AbstractQuery<T> groupBy(Expression<?>... grouping);
+
+    AbstractQuery<T> groupBy(List<Expression<?>> grouping);
+
+    AbstractQuery<T> having(Expression<Boolean> restriction);
+
+    AbstractQuery<T> having(Predicate... restrictions);
+
+    AbstractQuery<T> distinct(boolean distinct);
+
+    Set<Root<?>> getRoots();
+
+    Selection<T> getSelection();
+
+    List<Expression<?>> getGroupList();
+
+    Predicate getGroupRestriction();
+
+    boolean isDistinct();
+
+    Class<T> getResultType();  	
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CollectionJoin.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CollectionJoin.java
new file mode 100644
index 0000000..c0f447a
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CollectionJoin.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence.criteria;
+
+import java.util.Collection;
+import javax.persistence.metamodel.CollectionAttribute;
+
+public interface CollectionJoin<Z, E> 
+		extends PluralJoin<Z, Collection<E>, E> {
+
+    CollectionJoin<Z, E> on(Expression<Boolean> restriction);
+    
+    CollectionJoin<Z, E> on(Predicate... restrictions);
+
+    CollectionAttribute<? super Z, E> getModel();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CommonAbstractCriteria.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CommonAbstractCriteria.java
new file mode 100644
index 0000000..7b6e1c9
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CommonAbstractCriteria.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+public interface CommonAbstractCriteria {
+
+    Predicate getRestriction();
+    
+    <U> Subquery<U> subquery(Class<U> type);
+
+}
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CompoundSelection.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CompoundSelection.java
new file mode 100644
index 0000000..b188025
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CompoundSelection.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+
+public interface CompoundSelection<X> extends Selection<X> {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaBuilder.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaBuilder.java
new file mode 100644
index 0000000..9481ff7
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaBuilder.java
@@ -0,0 +1,459 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence.criteria;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+import javax.persistence.Tuple;
+
+public interface CriteriaBuilder {
+
+    CriteriaQuery<Object> createQuery();
+
+    <T> CriteriaQuery<T> createQuery(Class<T> resultClass);
+
+    CriteriaQuery<Tuple> createTupleQuery();
+
+    // methods to construct queries for bulk updates and deletes:
+
+    <T> CriteriaUpdate<T> createCriteriaUpdate(Class<T> targetEntity);
+
+    <T> CriteriaDelete<T> createCriteriaDelete(Class<T> targetEntity);
+
+
+    // selection construction methods:
+	
+    <Y> CompoundSelection<Y> construct(Class<Y> resultClass, Selection<?>... selections);
+
+    CompoundSelection<Tuple> tuple(Selection<?>... selections);
+
+    CompoundSelection<Object[]> array(Selection<?>... selections);
+
+
+    //ordering:
+	
+    Order asc(Expression<?> x);
+
+    Order desc(Expression<?> x);
+
+	
+    //aggregate functions:
+	
+    <N extends Number> Expression<Double> avg(Expression<N> x);
+
+    <N extends Number> Expression<N> sum(Expression<N> x);
+
+    Expression<Long> sumAsLong(Expression<Integer> x);
+
+    Expression<Double> sumAsDouble(Expression<Float> x);
+
+    <N extends Number> Expression<N> max(Expression<N> x);
+
+    <N extends Number> Expression<N> min(Expression<N> x);
+
+    <X extends Comparable<? super X>> Expression<X> greatest(Expression<X> x);
+    
+    <X extends Comparable<? super X>> Expression<X> least(Expression<X> x);
+
+    Expression<Long> count(Expression<?> x);
+
+    Expression<Long> countDistinct(Expression<?> x);
+
+
+
+    //subqueries:
+	
+    Predicate exists(Subquery<?> subquery);
+
+    <Y> Expression<Y> all(Subquery<Y> subquery);
+
+    <Y> Expression<Y> some(Subquery<Y> subquery);
+
+    <Y> Expression<Y> any(Subquery<Y> subquery);
+
+
+    //boolean functions:
+	
+    Predicate and(Expression<Boolean> x, Expression<Boolean> y);
+
+    Predicate and(Predicate... restrictions);
+
+    Predicate or(Expression<Boolean> x, Expression<Boolean> y);
+
+    Predicate or(Predicate... restrictions);
+
+    Predicate not(Expression<Boolean> restriction);
+
+    Predicate conjunction();
+
+    Predicate disjunction();
+
+	
+    //turn Expression<Boolean> into a Predicate
+    //useful for use with varargs methods
+
+    Predicate isTrue(Expression<Boolean> x);
+
+    Predicate isFalse(Expression<Boolean> x);
+
+	
+    //null tests:
+
+    Predicate isNull(Expression<?> x);
+
+    Predicate isNotNull(Expression<?> x);
+
+    //equality:
+	
+    Predicate equal(Expression<?> x, Expression<?> y);
+
+    Predicate equal(Expression<?> x, Object y);
+
+    Predicate notEqual(Expression<?> x, Expression<?> y);
+
+    Predicate notEqual(Expression<?> x, Object y);
+
+	
+    //comparisons for generic (non-numeric) operands:
+
+    <Y extends Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> x, Expression<? extends Y> y);
+
+    <Y extends Comparable<? super Y>> Predicate greaterThan(Expression<? extends Y> x, Y y);
+
+    <Y extends Comparable<? super Y>> Predicate greaterThanOrEqualTo(Expression<? extends Y> x, Expression<? extends Y> y);
+
+    <Y extends Comparable<? super Y>> Predicate greaterThanOrEqualTo(Expression<? extends Y> x, Y y);
+
+    <Y extends Comparable<? super Y>> Predicate lessThan(Expression<? extends Y> x, Expression<? extends Y> y);
+
+    <Y extends Comparable<? super Y>> Predicate lessThan(Expression<? extends Y> x, Y y);
+
+    <Y extends Comparable<? super Y>> Predicate lessThanOrEqualTo(Expression<? extends Y> x, Expression<? extends Y> y);
+
+    <Y extends Comparable<? super Y>> Predicate lessThanOrEqualTo(Expression<? extends Y> x, Y y);
+
+    <Y extends Comparable<? super Y>> Predicate between(Expression<? extends Y> v, Expression<? extends Y> x, Expression<? extends Y> y);
+
+    <Y extends Comparable<? super Y>> Predicate between(Expression<? extends Y> v, Y x, Y y);
+
+
+    //comparisons for numeric operands:
+	
+    Predicate gt(Expression<? extends Number> x, Expression<? extends Number> y);
+
+    Predicate gt(Expression<? extends Number> x, Number y);
+
+    Predicate ge(Expression<? extends Number> x, Expression<? extends Number> y);
+
+    Predicate ge(Expression<? extends Number> x, Number y);
+
+    Predicate lt(Expression<? extends Number> x, Expression<? extends Number> y);
+
+    Predicate lt(Expression<? extends Number> x, Number y);
+
+    Predicate le(Expression<? extends Number> x, Expression<? extends Number> y);
+
+    Predicate le(Expression<? extends Number> x, Number y);
+
+
+    //numerical operations:
+	
+    <N extends Number> Expression<N> neg(Expression<N> x);
+
+    <N extends Number> Expression<N> abs(Expression<N> x);
+
+    <N extends Number> Expression<N> sum(Expression<? extends N> x, Expression<? extends N> y);
+
+    <N extends Number> Expression<N> sum(Expression<? extends N> x, N y);
+
+    <N extends Number> Expression<N> sum(N x, Expression<? extends N> y);
+
+    <N extends Number> Expression<N> prod(Expression<? extends N> x, Expression<? extends N> y);
+
+    <N extends Number> Expression<N> prod(Expression<? extends N> x, N y);
+
+    <N extends Number> Expression<N> prod(N x, Expression<? extends N> y);
+
+    <N extends Number> Expression<N> diff(Expression<? extends N> x, Expression<? extends N> y);
+
+    <N extends Number> Expression<N> diff(Expression<? extends N> x, N y);
+
+    <N extends Number> Expression<N> diff(N x, Expression<? extends N> y);
+
+    Expression<Number> quot(Expression<? extends Number> x, Expression<? extends Number> y);
+
+    Expression<Number> quot(Expression<? extends Number> x, Number y);
+
+    Expression<Number> quot(Number x, Expression<? extends Number> y);
+
+    Expression<Integer> mod(Expression<Integer> x, Expression<Integer> y);
+
+    Expression<Integer> mod(Expression<Integer> x, Integer y);
+
+    Expression<Integer> mod(Integer x, Expression<Integer> y);
+
+    Expression<Double> sqrt(Expression<? extends Number> x);
+
+	
+    //typecasts:
+    
+    Expression<Long> toLong(Expression<? extends Number> number);
+
+    Expression<Integer> toInteger(Expression<? extends Number> number);
+
+    Expression<Float> toFloat(Expression<? extends Number> number);
+
+    Expression<Double> toDouble(Expression<? extends Number> number);
+
+    Expression<BigDecimal> toBigDecimal(Expression<? extends Number> number);
+
+    Expression<BigInteger> toBigInteger(Expression<? extends Number> number);
+
+    Expression<String> toString(Expression<Character> character);
+
+	
+    //literals:
+
+    <T> Expression<T> literal(T value);
+
+    <T> Expression<T> nullLiteral(Class<T> resultClass);
+
+    //parameters:
+
+    <T> ParameterExpression<T> parameter(Class<T> paramClass);
+
+    <T> ParameterExpression<T> parameter(Class<T> paramClass, String name);
+
+
+    //collection operations:
+	
+    <C extends Collection<?>> Predicate isEmpty(Expression<C> collection);
+
+    <C extends Collection<?>> Predicate isNotEmpty(Expression<C> collection);
+
+    <C extends java.util.Collection<?>> Expression<Integer> size(Expression<C> collection);
+
+    <C extends Collection<?>> Expression<Integer> size(C collection);
+
+    <E, C extends Collection<E>> Predicate isMember(Expression<E> elem, Expression<C> collection);
+
+    <E, C extends Collection<E>> Predicate isMember(E elem, Expression<C> collection);
+
+    <E, C extends Collection<E>> Predicate isNotMember(Expression<E> elem, Expression<C> collection);
+
+    <E, C extends Collection<E>> Predicate isNotMember(E elem, Expression<C> collection);
+
+
+    //get the values and keys collections of the Map, which may then
+    //be passed to size(), isMember(), isEmpty(), etc
+
+    <V, M extends Map<?, V>> Expression<Collection<V>> values(M map);
+
+    <K, M extends Map<K, ?>> Expression<Set<K>> keys(M map);
+
+	
+    //string functions:
+	
+    Predicate like(Expression<String> x, Expression<String> pattern);
+
+    Predicate like(Expression<String> x, String pattern);
+
+    Predicate like(Expression<String> x, Expression<String> pattern, Expression<Character> escapeChar);
+
+    Predicate like(Expression<String> x, Expression<String> pattern, char escapeChar);
+
+    Predicate like(Expression<String> x, String pattern, Expression<Character> escapeChar);
+
+    Predicate like(Expression<String> x, String pattern, char escapeChar);
+
+    Predicate notLike(Expression<String> x, Expression<String> pattern);
+
+    Predicate notLike(Expression<String> x, String pattern);
+
+    Predicate notLike(Expression<String> x, Expression<String> pattern, Expression<Character> escapeChar);
+
+    Predicate notLike(Expression<String> x, Expression<String> pattern, char escapeChar);
+
+    Predicate notLike(Expression<String> x, String pattern, Expression<Character> escapeChar);
+
+    Predicate notLike(Expression<String> x, String pattern, char escapeChar);
+
+    Expression<String> concat(Expression<String> x, Expression<String> y);
+
+    Expression<String> concat(Expression<String> x, String y);
+
+    Expression<String> concat(String x, Expression<String> y);
+
+    Expression<String> substring(Expression<String> x, Expression<Integer> from);
+
+    Expression<String> substring(Expression<String> x, int from);
+
+    Expression<String> substring(Expression<String> x, Expression<Integer> from, Expression<Integer> len);
+
+    Expression<String> substring(Expression<String> x, int from, int len);
+
+    public static enum Trimspec { 
+
+        LEADING,
+ 
+        TRAILING, 
+
+        BOTH 
+    }
+
+    Expression<String> trim(Expression<String> x);
+
+    Expression<String> trim(Trimspec ts, Expression<String> x);
+
+    Expression<String> trim(Expression<Character> t, Expression<String> x);
+
+    Expression<String> trim(Trimspec ts, Expression<Character> t, Expression<String> x);
+
+    Expression<String> trim(char t, Expression<String> x);
+
+    Expression<String> trim(Trimspec ts, char t, Expression<String> x);
+
+    Expression<String> lower(Expression<String> x);
+
+    Expression<String> upper(Expression<String> x);
+
+    Expression<Integer> length(Expression<String> x);
+
+	
+    Expression<Integer> locate(Expression<String> x, Expression<String> pattern);
+
+    Expression<Integer> locate(Expression<String> x, String pattern);
+
+    Expression<Integer> locate(Expression<String> x, Expression<String> pattern, Expression<Integer> from);
+
+    Expression<Integer> locate(Expression<String> x, String pattern, int from);
+
+
+    // Date/time/timestamp functions:
+
+    Expression<java.sql.Date> currentDate();
+
+    Expression<java.sql.Timestamp> currentTimestamp();
+
+    Expression<java.sql.Time> currentTime();
+
+
+    //in builders:
+	
+    public static interface In<T> extends Predicate {
+
+         Expression<T> getExpression();
+	
+         In<T> value(T value);
+
+         In<T> value(Expression<? extends T> value);
+     }
+
+    <T> In<T> in(Expression<? extends T> expression);
+
+
+    // coalesce, nullif:
+
+    <Y> Expression<Y> coalesce(Expression<? extends Y> x, Expression<? extends Y> y);
+
+    <Y> Expression<Y> coalesce(Expression<? extends Y> x, Y y);
+
+    <Y> Expression<Y> nullif(Expression<Y> x, Expression<?> y);
+
+    <Y> Expression<Y> nullif(Expression<Y> x, Y y);
+
+
+    // coalesce builder:
+
+    public static interface Coalesce<T> extends Expression<T> {
+
+         Coalesce<T> value(T value);
+
+         Coalesce<T> value(Expression<? extends T> value);
+    }
+	
+    <T> Coalesce<T> coalesce();
+
+
+    //case builders:
+
+    public static interface SimpleCase<C,R> extends Expression<R> {
+
+        Expression<C> getExpression();
+
+        SimpleCase<C, R> when(C condition, R result);
+
+        SimpleCase<C, R> when(C condition, Expression<? extends R> result);
+
+        Expression<R> otherwise(R result);
+
+        Expression<R> otherwise(Expression<? extends R> result);
+    }
+
+    <C, R> SimpleCase<C,R> selectCase(Expression<? extends C> expression);
+
+
+    public static interface Case<R> extends Expression<R> {
+
+        Case<R> when(Expression<Boolean> condition, R result);
+
+        Case<R> when(Expression<Boolean> condition, Expression<? extends R> result);
+
+        Expression<R> otherwise(R result);
+
+        Expression<R> otherwise(Expression<? extends R> result);
+    }
+
+    <R> Case<R> selectCase();
+
+   <T> Expression<T> function(String name, Class<T> type,
+Expression<?>... args);
+   
+
+    // methods for downcasting:
+
+   <X, T, V extends T> Join<X, V> treat(Join<X, T> join, Class<V> type);
+   
+   <X, T, E extends T> CollectionJoin<X, E> treat(CollectionJoin<X, T> join, Class<E> type);
+   
+   <X, T, E extends T> SetJoin<X, E> treat(SetJoin<X, T> join, Class<E> type);
+   
+   <X, T, E extends T> ListJoin<X, E> treat(ListJoin<X, T> join, Class<E> type);
+   
+   <X, K, T, V extends T> MapJoin<X, K, V> treat(MapJoin<X, K, T> join, Class<V> type);
+   
+   
+    <X, T extends X> Path<T> treat(Path<X> path, Class<T> type);
+   
+    <X, T extends X> Root<T> treat(Root<X> root, Class<T> type);
+   
+}
+
+
+
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaDelete.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaDelete.java
new file mode 100644
index 0000000..67171ea
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaDelete.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.EntityType;
+
+public interface CriteriaDelete<T> extends CommonAbstractCriteria {
+
+    Root<T> from(Class<T> entityClass);
+
+    Root<T> from(EntityType<T> entity);
+
+    Root<T> getRoot();
+
+    CriteriaDelete<T> where(Expression<Boolean> restriction);
+
+    CriteriaDelete<T> where(Predicate... restrictions);
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaQuery.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaQuery.java
new file mode 100644
index 0000000..4e94a6c
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaQuery.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import java.util.List;
+import java.util.Set;
+
+
+public interface CriteriaQuery<T> extends AbstractQuery<T> {
+
+    CriteriaQuery<T> select(Selection<? extends T> selection);
+
+    CriteriaQuery<T> multiselect(Selection<?>... selections);
+
+    CriteriaQuery<T> multiselect(List<Selection<?>> selectionList);
+
+    CriteriaQuery<T> where(Expression<Boolean> restriction);
+
+    CriteriaQuery<T> where(Predicate... restrictions);
+
+    CriteriaQuery<T> groupBy(Expression<?>... grouping);
+
+    CriteriaQuery<T> groupBy(List<Expression<?>> grouping);
+
+    CriteriaQuery<T> having(Expression<Boolean> restriction);
+
+    CriteriaQuery<T> having(Predicate... restrictions);
+
+    CriteriaQuery<T> orderBy(Order... o);
+
+    CriteriaQuery<T> orderBy(List<Order> o);
+
+    CriteriaQuery<T> distinct(boolean distinct);
+
+    List<Order> getOrderList();
+
+    Set<ParameterExpression<?>> getParameters();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaUpdate.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaUpdate.java
new file mode 100644
index 0000000..43bf653
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/CriteriaUpdate.java
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.SingularAttribute;
+import javax.persistence.metamodel.EntityType;
+
+public interface CriteriaUpdate<T> extends CommonAbstractCriteria {
+
+    Root<T> from(Class<T> entityClass);
+
+    Root<T> from(EntityType<T> entity);
+
+    Root<T> getRoot();
+
+    <Y, X extends Y> CriteriaUpdate<T> set(SingularAttribute<? super T, Y> attribute, X value);
+
+    <Y> CriteriaUpdate<T> set(SingularAttribute<? super T, Y> attribute, Expression<? extends Y> value);
+
+    <Y, X extends Y> CriteriaUpdate<T> set(Path<Y> attribute, X value);
+
+    <Y> CriteriaUpdate<T> set(Path<Y> attribute, Expression<? extends Y> value);
+
+    CriteriaUpdate<T> set(String attributeName, Object value);
+
+    CriteriaUpdate<T> where(Expression<Boolean> restriction);
+
+    CriteriaUpdate<T> where(Predicate... restrictions);
+ }
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Expression.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Expression.java
new file mode 100644
index 0000000..cfb52a2
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Expression.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import java.util.Collection;
+
+
+public interface Expression<T> extends Selection<T> {
+
+    Predicate isNull();
+
+    Predicate isNotNull();
+
+    Predicate in(Object... values);
+
+    Predicate in(Expression<?>... values);
+
+    Predicate in(Collection<?> values);
+
+    Predicate in(Expression<Collection<?>> values);
+
+    <X> Expression<X> as(Class<X> type);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Fetch.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Fetch.java
new file mode 100644
index 0000000..8ce7511
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Fetch.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.Attribute;
+
+
+public interface Fetch<Z, X> extends FetchParent<Z, X> {
+
+    Attribute<? super Z, ?> getAttribute();
+
+    FetchParent<?, Z> getParent();
+
+    JoinType getJoinType();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/FetchParent.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/FetchParent.java
new file mode 100644
index 0000000..4e330ef
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/FetchParent.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.PluralAttribute;
+import javax.persistence.metamodel.SingularAttribute;
+
+
+public interface FetchParent<Z, X> {
+
+    java.util.Set<Fetch<X, ?>> getFetches();
+
+    <Y> Fetch<X, Y> fetch(SingularAttribute<? super X, Y> attribute);
+
+    <Y> Fetch<X, Y> fetch(SingularAttribute<? super X, Y> attribute, JoinType jt);
+
+    <Y> Fetch<X, Y> fetch(PluralAttribute<? super X, ?, Y> attribute);
+
+    <Y> Fetch<X, Y> fetch(PluralAttribute<? super X, ?, Y> attribute, JoinType jt);
+
+    @SuppressWarnings("hiding")
+    <X, Y> Fetch<X, Y> fetch(String attributeName);
+
+    @SuppressWarnings("hiding")
+    <X, Y> Fetch<X, Y> fetch(String attributeName, JoinType jt);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/From.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/From.java
new file mode 100644
index 0000000..a766925
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/From.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.SingularAttribute;
+import javax.persistence.metamodel.CollectionAttribute;
+import javax.persistence.metamodel.ListAttribute;
+import javax.persistence.metamodel.MapAttribute;
+import javax.persistence.metamodel.SetAttribute;
+import java.util.Set;
+
+
+@SuppressWarnings("hiding")
+public interface From<Z, X> extends Path<X>, FetchParent<Z, X> {
+
+    Set<Join<X, ?>> getJoins();
+    boolean isCorrelated();
+
+    From<Z, X> getCorrelationParent();
+
+    <Y> Join<X, Y> join(SingularAttribute<? super X, Y> attribute);
+
+    <Y> Join<X, Y> join(SingularAttribute<? super X, Y> attribute, JoinType jt);
+
+    <Y> CollectionJoin<X, Y> join(CollectionAttribute<? super X, Y> collection);
+
+    <Y> SetJoin<X, Y> join(SetAttribute<? super X, Y> set);
+
+    <Y> ListJoin<X, Y> join(ListAttribute<? super X, Y> list);
+
+    <K, V> MapJoin<X, K, V> join(MapAttribute<? super X, K, V> map);
+
+    <Y> CollectionJoin<X, Y> join(CollectionAttribute<? super X, Y> collection, JoinType jt);
+
+    <Y> SetJoin<X, Y> join(SetAttribute<? super X, Y> set, JoinType jt);
+
+    <Y> ListJoin<X, Y> join(ListAttribute<? super X, Y> list, JoinType jt);
+
+    <K, V> MapJoin<X, K, V> join(MapAttribute<? super X, K, V> map, JoinType jt);
+
+    <X, Y> Join<X, Y> join(String attributeName);	
+
+    <X, Y> CollectionJoin<X, Y> joinCollection(String attributeName);	
+
+    <X, Y> SetJoin<X, Y> joinSet(String attributeName);	
+
+    <X, Y> ListJoin<X, Y> joinList(String attributeName);
+
+    <X, K, V> MapJoin<X, K, V> joinMap(String attributeName);	
+
+    <X, Y> Join<X, Y> join(String attributeName, JoinType jt);
+
+    <X, Y> CollectionJoin<X, Y> joinCollection(String attributeName, JoinType jt);	
+
+    <X, Y> SetJoin<X, Y> joinSet(String attributeName, JoinType jt);	
+
+    <X, Y> ListJoin<X, Y> joinList(String attributeName, JoinType jt);	
+
+    <X, K, V> MapJoin<X, K, V> joinMap(String attributeName, JoinType jt);	
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Join.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Join.java
new file mode 100644
index 0000000..d3f3e24
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Join.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.Attribute;
+
+public interface Join<Z, X> extends From<Z, X> {
+
+    Join<Z, X> on(Expression<Boolean> restriction);
+
+    Join<Z, X> on(Predicate... restrictions);
+
+    Predicate getOn();
+    
+    Attribute<? super Z, ?> getAttribute();
+    
+    From<?, Z> getParent();
+
+    JoinType getJoinType();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/JoinType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/JoinType.java
new file mode 100644
index 0000000..f1f2554
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/JoinType.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+
+public enum JoinType {
+
+    INNER, 
+
+    LEFT, 
+
+    RIGHT
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/ListJoin.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/ListJoin.java
new file mode 100644
index 0000000..3debaee
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/ListJoin.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence.criteria;
+
+import java.util.List;
+import javax.persistence.metamodel.ListAttribute;
+
+public interface ListJoin<Z, E> 
+		extends PluralJoin<Z, List<E>, E> {
+
+    ListJoin<Z, E> on(Expression<Boolean> restriction);
+    
+    ListJoin<Z, E> on(Predicate... restrictions);
+
+    ListAttribute<? super Z, E> getModel();
+
+    Expression<Integer> index();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/MapJoin.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/MapJoin.java
new file mode 100644
index 0000000..6b4dbb6
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/MapJoin.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence.criteria;
+
+import java.util.Map;
+import javax.persistence.metamodel.MapAttribute;
+
+public interface MapJoin<Z, K, V> 
+		extends PluralJoin<Z, Map<K, V>, V> {
+
+    MapJoin<Z, K, V> on(Expression<Boolean> restriction);
+
+    MapJoin<Z, K, V> on(Predicate... restrictions);
+
+    MapAttribute<? super Z, K, V> getModel();
+
+    Path<K> key();
+
+    Path<V> value(); 
+
+    Expression<Map.Entry<K, V>> entry();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Order.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Order.java
new file mode 100644
index 0000000..4cad535
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Order.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+
+public interface Order {
+
+    Order reverse();
+
+    boolean isAscending();
+
+   Expression<?> getExpression();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/ParameterExpression.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/ParameterExpression.java
new file mode 100644
index 0000000..5d6b5ed
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/ParameterExpression.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import javax.persistence.Parameter;
+
+
+
+public interface ParameterExpression<T> extends Parameter<T>, Expression<T> {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Path.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Path.java
new file mode 100644
index 0000000..82d2d2a
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Path.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.PluralAttribute;
+import javax.persistence.metamodel.SingularAttribute;
+import javax.persistence.metamodel.Bindable;
+import javax.persistence.metamodel.MapAttribute;
+
+
+public interface Path<X> extends Expression<X> {
+
+    Bindable<X> getModel();
+
+    Path<?> getParentPath();
+
+    <Y> Path<Y> get(SingularAttribute<? super X, Y> attribute);
+
+    <E, C extends java.util.Collection<E>> Expression<C> get(PluralAttribute<X, C, E> collection);
+
+    <K, V, M extends java.util.Map<K, V>> Expression<M> get(MapAttribute<X, K, V> map);
+
+    Expression<Class<? extends X>> type();
+
+    <Y> Path<Y> get(String attributeName);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/PluralJoin.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/PluralJoin.java
new file mode 100644
index 0000000..fc769ed
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/PluralJoin.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.PluralAttribute;
+
+
+public interface PluralJoin<Z, C, E> extends Join<Z, E> {
+
+    PluralAttribute<? super Z, C, E> getModel();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Predicate.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Predicate.java
new file mode 100644
index 0000000..3bee200
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Predicate.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import java.util.List;
+
+
+public interface Predicate extends Expression<Boolean> {
+
+    public static enum BooleanOperator {
+        AND, OR
+    }
+
+    BooleanOperator getOperator();
+
+    boolean isNegated();
+
+    List<Expression<Boolean>> getExpressions();
+
+    Predicate not();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Root.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Root.java
new file mode 100644
index 0000000..628dd2c
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Root.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import javax.persistence.metamodel.EntityType;
+
+
+public interface Root<X> extends From<X, X> {
+
+    EntityType<X> getModel();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Selection.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Selection.java
new file mode 100644
index 0000000..7330964
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Selection.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
+
+import javax.persistence.TupleElement;
+import java.util.List;
+
+
+public interface Selection<X> extends TupleElement<X> {
+
+    Selection<X> alias(String name);
+
+    boolean isCompoundSelection();
+
+    List<Selection<?>> getCompoundSelectionItems();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/SetJoin.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/SetJoin.java
new file mode 100644
index 0000000..1fee3c7
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/SetJoin.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence.criteria;
+
+import java.util.Set;
+import javax.persistence.metamodel.SetAttribute;
+
+public interface SetJoin<Z, E> extends PluralJoin<Z, Set<E>, E> {
+
+    SetJoin<Z, E> on(Expression<Boolean> restriction);
+    
+    SetJoin<Z, E> on(Predicate... restrictions);
+
+    SetAttribute<? super Z, E> getModel();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Subquery.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Subquery.java
new file mode 100644
index 0000000..5918bfa
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/Subquery.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence.criteria;
+
+import java.util.List;
+import java.util.Set;
+
+public interface Subquery<T> extends AbstractQuery<T>, Expression<T> {
+
+    Subquery<T> select(Expression<T> expression);
+
+    Subquery<T> where(Expression<Boolean> restriction);
+
+    Subquery<T> where(Predicate... restrictions);
+
+    Subquery<T> groupBy(Expression<?>... grouping);
+
+    Subquery<T> groupBy(List<Expression<?>> grouping);
+
+    Subquery<T> having(Expression<Boolean> restriction);
+
+    Subquery<T> having(Predicate... restrictions);
+
+    Subquery<T> distinct(boolean distinct);
+
+    <Y> Root<Y> correlate(Root<Y> parentRoot);
+
+    <X, Y> Join<X, Y> correlate(Join<X, Y> parentJoin);
+
+    <X, Y> CollectionJoin<X, Y> correlate(CollectionJoin<X, Y> parentCollection);
+
+    <X, Y> SetJoin<X, Y> correlate(SetJoin<X, Y> parentSet);
+
+    <X, Y> ListJoin<X, Y> correlate(ListJoin<X, Y> parentList);
+
+    <X, K, V> MapJoin<X, K, V> correlate(MapJoin<X, K, V> parentMap);
+
+    AbstractQuery<?> getParent();
+
+    CommonAbstractCriteria getContainingQuery();
+	
+    Expression<T> getSelection();
+
+    Set<Join<?, ?>> getCorrelatedJoins();
+
+}
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/package-info.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/package-info.java
new file mode 100644
index 0000000..3f87789
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/criteria/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.criteria;
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Attribute.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Attribute.java
new file mode 100644
index 0000000..9a93d23
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Attribute.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+
+public interface Attribute<X, Y> {
+
+    public static enum PersistentAttributeType {
+
+        MANY_TO_ONE,
+
+        ONE_TO_ONE,
+
+        BASIC,
+
+        EMBEDDED,
+
+        MANY_TO_MANY,
+
+        ONE_TO_MANY,
+
+        ELEMENT_COLLECTION
+    }
+
+    String getName();
+
+    PersistentAttributeType getPersistentAttributeType();
+
+    ManagedType<X> getDeclaringType();
+
+    Class<Y> getJavaType();
+
+    java.lang.reflect.Member getJavaMember();
+
+    boolean isAssociation();
+
+    boolean isCollection();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/BasicType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/BasicType.java
new file mode 100644
index 0000000..450ebec
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/BasicType.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+
+public interface BasicType<X> extends Type<X> {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Bindable.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Bindable.java
new file mode 100644
index 0000000..616cf02
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Bindable.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+
+public interface Bindable<T> {
+    public static enum BindableType { 
+
+        SINGULAR_ATTRIBUTE, 
+
+        PLURAL_ATTRIBUTE, 
+
+        ENTITY_TYPE
+    }
+
+    BindableType getBindableType();
+
+    Class<T> getBindableJavaType();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/CollectionAttribute.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/CollectionAttribute.java
new file mode 100644
index 0000000..a46ccc7
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/CollectionAttribute.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+
+public interface CollectionAttribute<X, E> 
+    extends PluralAttribute<X, java.util.Collection<E>, E> {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/EmbeddableType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/EmbeddableType.java
new file mode 100644
index 0000000..34798ac
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/EmbeddableType.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+
+public interface EmbeddableType<X> extends ManagedType<X> {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/EntityType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/EntityType.java
new file mode 100644
index 0000000..73ff928
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/EntityType.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+
+public interface EntityType<X> 
+            extends IdentifiableType<X>, Bindable<X>{
+
+    String getName();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/IdentifiableType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/IdentifiableType.java
new file mode 100644
index 0000000..68a85a3
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/IdentifiableType.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+import java.util.Set;
+
+
+public interface IdentifiableType<X> extends ManagedType<X> {
+    <Y> SingularAttribute<? super X, Y> getId(Class<Y> type);
+
+    <Y> SingularAttribute<X, Y> getDeclaredId(Class<Y> type);
+
+    <Y> SingularAttribute<? super X, Y> getVersion(Class<Y> type);
+
+    <Y> SingularAttribute<X, Y> getDeclaredVersion(Class<Y> type);
+
+    IdentifiableType<? super X> getSupertype();
+
+    boolean hasSingleIdAttribute();
+
+    boolean hasVersionAttribute();
+
+     Set<SingularAttribute<? super X, ?>> getIdClassAttributes();
+
+    Type<?> getIdType();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/ListAttribute.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/ListAttribute.java
new file mode 100644
index 0000000..8ee6752
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/ListAttribute.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+
+public interface ListAttribute<X, E> 
+		extends PluralAttribute<X, java.util.List<E>, E> {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/ManagedType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/ManagedType.java
new file mode 100644
index 0000000..d09d0ff
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/ManagedType.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+import java.util.Set;
+
+
+public interface ManagedType<X> extends Type<X> {
+
+     Set<Attribute<? super X, ?>> getAttributes();
+
+     Set<Attribute<X, ?>> getDeclaredAttributes();
+
+    <Y> SingularAttribute<? super X, Y> getSingularAttribute(String name, Class<Y> type);
+
+    <Y> SingularAttribute<X, Y> getDeclaredSingularAttribute(String name, Class<Y> type);
+
+    Set<SingularAttribute<? super X, ?>> getSingularAttributes();
+
+    Set<SingularAttribute<X, ?>> getDeclaredSingularAttributes();
+
+    <E> CollectionAttribute<? super X, E> getCollection(String name, Class<E> elementType);
+
+    <E> CollectionAttribute<X, E> getDeclaredCollection(String name, Class<E> elementType);
+
+    <E> SetAttribute<? super X, E> getSet(String name, Class<E> elementType);
+
+    <E> SetAttribute<X, E> getDeclaredSet(String name, Class<E> elementType);
+
+    <E> ListAttribute<? super X, E> getList(String name, Class<E> elementType);
+
+    <E> ListAttribute<X, E> getDeclaredList(String name, Class<E> elementType);
+
+    <K, V> MapAttribute<? super X, K, V> getMap(String name, 
+                                                Class<K> keyType, 
+                                                Class<V> valueType);
+
+    <K, V> MapAttribute<X, K, V> getDeclaredMap(String name, 
+                                                Class<K> keyType, 
+                                                Class<V> valueType);
+    Set<PluralAttribute<? super X, ?, ?>> getPluralAttributes();
+
+    Set<PluralAttribute<X, ?, ?>> getDeclaredPluralAttributes();
+
+
+    Attribute<? super X, ?> getAttribute(String name); 
+
+    Attribute<X, ?> getDeclaredAttribute(String name); 
+
+    SingularAttribute<? super X, ?> getSingularAttribute(String name);
+
+    SingularAttribute<X, ?> getDeclaredSingularAttribute(String name);
+
+    CollectionAttribute<? super X, ?> getCollection(String name); 
+
+    CollectionAttribute<X, ?> getDeclaredCollection(String name); 
+
+    SetAttribute<? super X, ?> getSet(String name);
+
+    SetAttribute<X, ?> getDeclaredSet(String name);
+
+    ListAttribute<? super X, ?> getList(String name);
+
+    ListAttribute<X, ?> getDeclaredList(String name);
+
+    MapAttribute<? super X, ?, ?> getMap(String name); 
+
+    MapAttribute<X, ?, ?> getDeclaredMap(String name);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/MapAttribute.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/MapAttribute.java
new file mode 100644
index 0000000..42de878
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/MapAttribute.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+
+public interface MapAttribute<X, K, V> 
+	extends PluralAttribute<X, java.util.Map<K, V>, V> {
+
+    Class<K> getKeyJavaType();
+
+    Type<K> getKeyType();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/MappedSuperclassType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/MappedSuperclassType.java
new file mode 100644
index 0000000..d8673e3
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/MappedSuperclassType.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+
+package javax.persistence.metamodel;
+
+
+public interface MappedSuperclassType<X> extends IdentifiableType<X> {}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Metamodel.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Metamodel.java
new file mode 100644
index 0000000..4e8fd19
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Metamodel.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+import java.util.Set;
+
+
+public interface Metamodel {
+
+    <X> EntityType<X> entity(Class<X> cls);
+
+    <X> ManagedType<X> managedType(Class<X> cls);
+
+    <X> EmbeddableType<X> embeddable(Class<X> cls);
+
+    Set<ManagedType<?>> getManagedTypes();
+
+    Set<EntityType<?>> getEntities();
+
+    Set<EmbeddableType<?>> getEmbeddables();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/PluralAttribute.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/PluralAttribute.java
new file mode 100644
index 0000000..343fb09
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/PluralAttribute.java
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+
+public interface PluralAttribute<X, C, E> 
+		extends Attribute<X, C>, Bindable<E> {
+    public static enum CollectionType {
+
+        COLLECTION, 
+
+        SET, 
+
+        LIST, 
+
+        MAP
+    }
+    CollectionType getCollectionType();
+
+    Type<E> getElementType();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/SetAttribute.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/SetAttribute.java
new file mode 100644
index 0000000..8350f7a
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/SetAttribute.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+
+public interface SetAttribute<X, E> 
+	extends PluralAttribute<X, java.util.Set<E>, E> {} 
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/SingularAttribute.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/SingularAttribute.java
new file mode 100644
index 0000000..0badba9
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/SingularAttribute.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+
+package javax.persistence.metamodel;
+
+
+public interface SingularAttribute<X, T> 
+		extends Attribute<X, T>, Bindable<T> {
+
+    boolean isId();
+
+    boolean isVersion();
+
+    boolean isOptional();
+
+    Type<T> getType();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/StaticMetamodel.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/StaticMetamodel.java
new file mode 100644
index 0000000..9f1ad1b
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/StaticMetamodel.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface StaticMetamodel {
+
+    Class<?> value();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Type.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Type.java
new file mode 100644
index 0000000..d63fb99
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/Type.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
+
+
+public interface Type<X> {
+
+    public static enum PersistenceType {
+
+        ENTITY, 
+
+        EMBEDDABLE, 
+
+        MAPPED_SUPERCLASS, 
+
+        BASIC
+    }
+
+    PersistenceType getPersistenceType();
+
+    Class<X> getJavaType();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/package-info.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/package-info.java
new file mode 100644
index 0000000..95b721c
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/metamodel/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.metamodel;
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/package-info.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/package-info.java
new file mode 100644
index 0000000..0912872
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence;
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/ClassTransformer.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/ClassTransformer.java
new file mode 100644
index 0000000..77ac09b
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/ClassTransformer.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.spi;
+
+import java.security.ProtectionDomain;
+import java.lang.instrument.IllegalClassFormatException;
+
+
+public interface ClassTransformer {
+
+    byte[] transform(ClassLoader loader,
+                     String className,
+                     Class<?> classBeingRedefined,
+                     ProtectionDomain protectionDomain, 
+                     byte[] classfileBuffer) 
+        throws IllegalClassFormatException;
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/LoadState.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/LoadState.java
new file mode 100644
index 0000000..0a28d32
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/LoadState.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.spi;
+
+
+public enum LoadState {
+    LOADED,
+    NOT_LOADED,
+    UNKNOWN
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceProvider.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceProvider.java
new file mode 100644
index 0000000..2b54a5c
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceProvider.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+package javax.persistence.spi;
+
+import javax.persistence.EntityManagerFactory;
+import java.util.Map;
+
+public interface PersistenceProvider {
+
+    public EntityManagerFactory createEntityManagerFactory(String emName, Map map);
+
+    public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map map);
+
+    
+    public void generateSchema(PersistenceUnitInfo info, Map map);
+    
+    public boolean generateSchema(String persistenceUnitName, Map map); 
+
+    public ProviderUtil getProviderUtil();
+}
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceProviderResolver.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceProviderResolver.java
new file mode 100644
index 0000000..573af71
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceProviderResolver.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+
+package javax.persistence.spi;
+
+import java.util.List;
+
+
+public interface PersistenceProviderResolver {
+
+    List<PersistenceProvider> getPersistenceProviders();
+
+    void clearCachedProviders();
+} 
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceProviderResolverHolder.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceProviderResolverHolder.java
new file mode 100644
index 0000000..c91efa4
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceProviderResolverHolder.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.spi;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.WeakHashMap;
+
+import javax.persistence.PersistenceException;
+
+import org.apache.geronimo.osgi.locator.ProviderLocator;
+
+/**
+ * Contains Geronimo implemented code as required by the JPA spec.
+ *
+ * Finds/Creates the global {@link javax.persistence.spi.PersistenceProviderResolver}
+ *
+ * Implementations must be thread-safe.
+ *
+ * @since Java Persistence 2.0
+ */
+public class PersistenceProviderResolverHolder {
+
+    private static PersistenceProviderResolver persistenceResolver =
+        new DefaultPersistenceProviderResolver();
+
+    public static PersistenceProviderResolver getPersistenceProviderResolver() {
+        return persistenceResolver;
+    }
+
+    public static void setPersistenceProviderResolver(PersistenceProviderResolver resolver) {
+        if (persistenceResolver != null) {
+            persistenceResolver.clearCachedProviders();
+            persistenceResolver = null;
+        }
+        if (resolver != null) {
+            persistenceResolver = resolver;
+        } else {
+            // handle removing a resolver for OSGi environments
+            persistenceResolver = new DefaultPersistenceProviderResolver();
+        }
+    }
+
+    /*
+     * (non-Javadoc) Default implementation of a PersistenceProviderResolver
+     * to use when none are provided.
+     *
+     * Geronimo implementation specific code.
+     */
+    private static class DefaultPersistenceProviderResolver implements PersistenceProviderResolver {
+
+        private static final String SERVICES_FILENAME = "META-INF/services/" +
+            PersistenceProvider.class.getName();
+
+        // cache of providers per class loader
+        private volatile WeakHashMap<ClassLoader, List<PersistenceProvider>> providerCache =
+            new WeakHashMap<ClassLoader, List<PersistenceProvider>>();
+
+        /*
+         * (non-Javadoc)
+         *
+         * @see javax.persistence.spi.PersistenceProviderResolver#getPersistenceProviders()
+         */
+        public List<PersistenceProvider> getPersistenceProviders() {
+            // get our class loader
+            ClassLoader cl = PrivClassLoader.get(null);
+            if (cl == null)
+                cl = PrivClassLoader.get(DefaultPersistenceProviderResolver.class);
+
+            // use any previously cached providers
+            List<PersistenceProvider> providers = providerCache.get(cl);
+            if (providers == null) {
+                // need to discover and load them for this class loader
+                providers = new ArrayList<PersistenceProvider>();
+                try {
+                    // add each one to our list
+                    List<Object> serviceProviders = ProviderLocator.getServices(PersistenceProvider.class.getName(), this.getClass(), cl);
+                    for (Object o : serviceProviders) {
+                        providers.add((PersistenceProvider)o);
+                    }
+                    // cache the discovered providers
+                    providerCache.put(cl, providers);
+                } catch (ClassNotFoundException e) {
+                    throw new PersistenceException("Failed to load provider from META-INF/services", e);
+                } catch (InstantiationException e) {
+                    throw new PersistenceException("Failed to load provider from META-INF/services", e);
+                } catch (IllegalAccessException e) {
+                    throw new PersistenceException("Failed to load provider from META-INF/services", e);
+                } catch (Exception e) {
+                    throw new PersistenceException("Failed to load provider from META-INF/services", e);
+                }
+            }
+            // caller must handle the case of no providers found
+            return providers;
+        }
+
+        /*
+         * (non-Javadoc)
+         *
+         * @see javax.persistence.spi.PersistenceProviderResolver#clearCachedProviders()
+         */
+        public void clearCachedProviders() {
+            providerCache.clear();
+        }
+
+        private static class PrivClassLoader implements PrivilegedAction<ClassLoader> {
+            private final Class<?> c;
+
+            public static ClassLoader get(Class<?> c) {
+                final PrivClassLoader action = new PrivClassLoader(c);
+                if (System.getSecurityManager() != null)
+                    return AccessController.doPrivileged(action);
+                else
+                    return action.run();
+            }
+
+            private PrivClassLoader(Class<?> c) {
+                this.c = c;
+            }
+
+            public ClassLoader run() {
+                if (c != null)
+                    return c.getClassLoader();
+                else
+                    return Thread.currentThread().getContextClassLoader();
+            }
+        }
+    }
+}
+
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceUnitInfo.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceUnitInfo.java
new file mode 100644
index 0000000..447f4c0
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceUnitInfo.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.spi;
+
+import javax.sql.DataSource;
+import java.util.List;
+import java.util.Properties;
+import java.net.URL;
+import javax.persistence.SharedCacheMode;
+import javax.persistence.ValidationMode;
+
+
+public interface PersistenceUnitInfo {
+    public String getPersistenceUnitName();
+
+    public String getPersistenceProviderClassName();
+
+    public PersistenceUnitTransactionType getTransactionType();
+
+    public DataSource getJtaDataSource();
+
+    public DataSource getNonJtaDataSource();
+
+    public List<String> getMappingFileNames();
+
+    public List<URL> getJarFileUrls();
+
+    public URL getPersistenceUnitRootUrl();
+
+    public List<String> getManagedClassNames();
+
+    public boolean excludeUnlistedClasses();
+
+    public SharedCacheMode getSharedCacheMode();
+
+    public ValidationMode getValidationMode();
+
+    public Properties getProperties();
+
+    public String getPersistenceXMLSchemaVersion();
+
+    public ClassLoader getClassLoader();
+
+    public void addTransformer(ClassTransformer transformer);
+
+    public ClassLoader getNewTempClassLoader();
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceUnitTransactionType.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceUnitTransactionType.java
new file mode 100644
index 0000000..c527479
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/PersistenceUnitTransactionType.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.spi;
+
+
+public enum PersistenceUnitTransactionType {
+
+    JTA,
+
+    RESOURCE_LOCAL
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/ProviderUtil.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/ProviderUtil.java
new file mode 100644
index 0000000..c3c213c
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/ProviderUtil.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.spi;
+
+
+public interface ProviderUtil { 
+
+    public LoadState isLoadedWithoutReference(Object entity, String attributeName);
+
+    public LoadState isLoadedWithReference(Object entity, String attributeName);
+
+    public LoadState isLoaded(Object entity);
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/package-info.java b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/package-info.java
new file mode 100644
index 0000000..b20eb5f
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/javax/persistence/spi/package-info.java
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//
+// This source code implements specifications defined by the Java
+// Community Process. In order to remain compliant with the specification
+// DO NOT add / change / or delete method signatures!
+//
+
+package javax.persistence.spi;
diff --git a/geronimo-jpa_2.2_spec/src/main/java/org/apache/geronimo/specs/jpa/PersistenceActivator.java b/geronimo-jpa_2.2_spec/src/main/java/org/apache/geronimo/specs/jpa/PersistenceActivator.java
new file mode 100644
index 0000000..1c4e123
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/org/apache/geronimo/specs/jpa/PersistenceActivator.java
@@ -0,0 +1,112 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.specs.jpa;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import javax.persistence.spi.PersistenceProvider;
+import javax.persistence.spi.PersistenceProviderResolver;
+import javax.persistence.spi.PersistenceProviderResolverHolder;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+import org.apache.geronimo.osgi.locator.Activator;
+
+/**
+ * Used to discover/resolve JPA providers in an OSGi environment.
+ *
+ * @version $Rev$ $Date$
+ */
+public class PersistenceActivator extends Activator implements BundleActivator, PersistenceProviderResolver {
+
+    public static final String PERSISTENCE_PROVIDER = PersistenceProvider.class.getName();
+
+    private Map<String, PersistenceProvider> providers = new WeakHashMap<String, PersistenceProvider>();
+    private BundleContext ctx = null;
+    private ServiceTracker tracker = null;
+
+    /* (non-Javadoc)
+     * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+     */
+    public void start(BundleContext arg0) throws Exception {
+        super.start(arg0);
+        // bundle context for later ServiceReference lookups
+        ctx = arg0;
+
+        // track providers as they register themselves
+        ServiceTrackerCustomizer customizer = new PersistenceTracker(this);
+        tracker = new ServiceTracker(ctx, PERSISTENCE_PROVIDER, customizer);
+        tracker.open();
+
+        // configure JPA provider resolver for OSGi
+        PersistenceProviderResolverHolder.setPersistenceProviderResolver(this);
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+     */
+    public void stop(BundleContext arg0) throws Exception {
+        // cleanup provider tracker
+        tracker.close();
+        tracker = null;
+
+        // cleanup providers and remove ourselves as a JPA provider resolver
+        PersistenceProviderResolverHolder.setPersistenceProviderResolver(null);
+        providers.clear();
+
+        // cleanup context
+        ctx = null;
+
+        super.stop(arg0);
+    }
+
+
+    /* (non-Javadoc)
+     * @see javax.persistence.spi.PersistenceProviderResolver#clearCachedProviders()
+     */
+    public void clearCachedProviders() {
+        // no-op - handled by stop() in OSGi environment
+    }
+
+    /* (non-Javadoc)
+     * @see javax.persistence.spi.PersistenceProviderResolver#getPersistenceProviders()
+     */
+    public List<PersistenceProvider> getPersistenceProviders() {
+        return new ArrayList<PersistenceProvider>(providers.values());
+    }
+
+    protected PersistenceProvider addProvider(ServiceReference ref) {
+        PersistenceProvider provider = (PersistenceProvider) ctx.getService(ref);
+        String name = (String) ref.getProperty(PERSISTENCE_PROVIDER);
+        providers.put(name, provider);
+        return provider;
+    }
+
+    protected void removeProvider(ServiceReference ref) {
+        String name = (String) ref.getProperty(PERSISTENCE_PROVIDER);
+        providers.remove(name);
+    }
+
+}
diff --git a/geronimo-jpa_2.2_spec/src/main/java/org/apache/geronimo/specs/jpa/PersistenceTracker.java b/geronimo-jpa_2.2_spec/src/main/java/org/apache/geronimo/specs/jpa/PersistenceTracker.java
new file mode 100644
index 0000000..b71692c
--- /dev/null
+++ b/geronimo-jpa_2.2_spec/src/main/java/org/apache/geronimo/specs/jpa/PersistenceTracker.java
@@ -0,0 +1,57 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.specs.jpa;
+
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+
+/**
+ * Used to track JPA service providers in an OSGi environment.
+ *
+ * @version $Rev$ $Date$
+ */
+public class PersistenceTracker implements ServiceTrackerCustomizer {
+
+    private PersistenceActivator activator;
+    
+    public PersistenceTracker(PersistenceActivator activator) {
+        this.activator = activator;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.osgi.util.tracker.ServiceTrackerCustomizer#addingService(org.osgi.framework.ServiceReference)
+     */
+    public Object addingService(ServiceReference arg0) {
+        return activator.addProvider(arg0);
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.util.tracker.ServiceTrackerCustomizer#modifiedService(org.osgi.framework.ServiceReference, java.lang.Object)
+     */
+    public void modifiedService(ServiceReference arg0, Object arg1) {
+        // handle as a remove - modify is unsupported
+        removedService(arg0, arg1);
+    }
+
+    /* (non-Javadoc)
+     * @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(org.osgi.framework.ServiceReference, java.lang.Object)
+     */
+    public void removedService(ServiceReference arg0, Object arg1) {
+        activator.removeProvider(arg0);
+    }
+
+}