This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 2a483a52460 Jakarta Migration: Fixed JPA tests (#9089)
2a483a52460 is described below

commit 2a483a52460179ea4b54dbc0763cc17736a12c02
Author: Federico Mariani <[email protected]>
AuthorDate: Fri Jan 13 13:23:23 2023 +0100

    Jakarta Migration: Fixed JPA tests (#9089)
---
 components/camel-jpa/pom.xml                       |  39 +--
 .../camel-jpa/src/main/docs/jpa-component.adoc     |   2 +-
 .../src/test/resources/META-INF/persistence.xml    |   9 +-
 .../test/resources/META-INF/persistence_2_1.xsd    | 354 ---------------------
 .../test/resources/META-INF/persistence_3_1.xsd    | 342 ++++++++++++++++++++
 .../profiles/hibernate/META-INF/persistence.xml    |  22 +-
 6 files changed, 384 insertions(+), 384 deletions(-)

diff --git a/components/camel-jpa/pom.xml b/components/camel-jpa/pom.xml
index a7d695ee677..e5d3196989a 100644
--- a/components/camel-jpa/pom.xml
+++ b/components/camel-jpa/pom.xml
@@ -103,17 +103,10 @@
             <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
-
         <dependency>
-            <groupId>org.apache.openjpa</groupId>
-            <artifactId>openjpa-persistence-jdbc</artifactId>
+            <groupId>jakarta.transaction</groupId>
+            <artifactId>jakarta.transaction-api</artifactId>
             <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.apache.geronimo.specs</groupId>
-                    <artifactId>geronimo-jpa_2.0_spec</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
     </dependencies>
 
@@ -135,6 +128,7 @@
                                     <groupId>org.apache.openjpa</groupId>
                                     <artifactId>openjpa</artifactId>
                                     <version>${openjpa-version}</version>
+                                    <classifier>jakarta</classifier>
                                     
<outputDirectory>${project.build.directory}</outputDirectory>
                                 </artifactItem>
                             </artifactItems>
@@ -147,7 +141,7 @@
             <plugin>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    
<argLine>-javaagent:${project.basedir}/target/openjpa-${openjpa-version}.jar
+                    
<argLine>-javaagent:${project.basedir}/target/openjpa-${openjpa-version}-jakarta.jar
                         ${camel.surefire.fork.vmargs}
                     </argLine>
                 </configuration>
@@ -218,6 +212,17 @@
                                 <groupId>org.apache.openjpa</groupId>
                                 <artifactId>openjpa</artifactId>
                                 <version>${openjpa-version}</version>
+                                <classifier>jakarta</classifier>
+                            </dependency>
+                            <dependency>
+                                <groupId>jakarta.transaction</groupId>
+                                
<artifactId>jakarta.transaction-api</artifactId>
+                                
<version>${jakarta-transaction-api-version}</version>
+                            </dependency>
+                            <dependency>
+                                <groupId>jakarta.persistence</groupId>
+                                
<artifactId>jakarta.persistence-api</artifactId>
+                                
<version>${jakarta-persistence-api-version}</version>
                             </dependency>
                         </dependencies>
                     </plugin>
@@ -226,14 +231,9 @@
             <dependencies>
                 <dependency>
                     <groupId>org.apache.openjpa</groupId>
-                    <artifactId>openjpa-persistence-jdbc</artifactId>
-                    <scope>test</scope>
-                    <exclusions>
-                        <exclusion>
-                            <groupId>org.apache.geronimo.specs</groupId>
-                            <artifactId>geronimo-jpa_2.0_spec</artifactId>
-                        </exclusion>
-                    </exclusions>
+                    <artifactId>openjpa</artifactId>
+                    <version>${openjpa-version}</version>
+                    <classifier>jakarta</classifier>
                 </dependency>
             </dependencies>
         </profile>
@@ -268,7 +268,8 @@
             <dependencies>
                 <dependency>
                     <groupId>org.hibernate</groupId>
-                    <artifactId>hibernate-entitymanager</artifactId>
+                    <artifactId>hibernate-core-jakarta</artifactId>
+                    <version>${hibernate-version}</version>
                     <scope>test</scope>
                 </dependency>
             </dependencies>
diff --git a/components/camel-jpa/src/main/docs/jpa-component.adoc 
b/components/camel-jpa/src/main/docs/jpa-component.adoc
index dc6cec9dd92..e08efbf7a25 100644
--- a/components/camel-jpa/src/main/docs/jpa-component.adoc
+++ b/components/camel-jpa/src/main/docs/jpa-component.adoc
@@ -36,7 +36,7 @@ for this component:
 You can store a Java entity bean in a database by sending it to a JPA
 producer endpoint. The body of the _In_ message is assumed to be an
 entity bean (that is, a POJO with an
-http://java.sun.com/javaee/5/docs/api/javax/persistence/Entity.html[@Entity]
+https://jakarta.ee/specifications/persistence/2.2/apidocs/javax/persistence/entity[@Entity]
 annotation on it) or a collection or array of entity beans.
 
 If the body is a List of entities, make sure to use
diff --git a/components/camel-jpa/src/test/resources/META-INF/persistence.xml 
b/components/camel-jpa/src/test/resources/META-INF/persistence.xml
index 76f6cd393a1..3d06b663e9e 100644
--- a/components/camel-jpa/src/test/resources/META-INF/persistence.xml
+++ b/components/camel-jpa/src/test/resources/META-INF/persistence.xml
@@ -17,11 +17,10 @@
     limitations under the License.
 
 -->
-<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence";
-             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-             version="2.1"
-             xsi:schemaLocation="
-             http://xmlns.jcp.org/xml/ns/persistence persistence_2_1.xsd">
+<persistence xmlns="https://jakarta.ee/xml/ns/persistence";
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+          xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence 
persistence_3_1.xsd"
+          version="3.0">
 
   <persistence-unit name="camel" transaction-type="RESOURCE_LOCAL">
     <!--
diff --git 
a/components/camel-jpa/src/test/resources/META-INF/persistence_2_1.xsd 
b/components/camel-jpa/src/test/resources/META-INF/persistence_2_1.xsd
deleted file mode 100644
index 01d5149029e..00000000000
--- a/components/camel-jpa/src/test/resources/META-INF/persistence_2_1.xsd
+++ /dev/null
@@ -1,354 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- persistence.xml schema -->
-<xsd:schema targetNamespace="http://xmlns.jcp.org/xml/ns/persistence"; 
-  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
-  xmlns:persistence="http://xmlns.jcp.org/xml/ns/persistence";
-  elementFormDefault="qualified" 
-  attributeFormDefault="unqualified" 
-  version="2.1">
-
-  <xsd:annotation>
-    <xsd:documentation>
-      @(#)persistence_2_1.xsd  2.1  February 4, 2013
-    </xsd:documentation>
-  </xsd:annotation>
-
-  <xsd:annotation>
-    <xsd:documentation>
-
-  Copyright (c) 2008  - 2013 Oracle Corporation. All rights reserved. 
-  
-  This program and the accompanying materials are made available under the 
-  terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 
1.0 
-  which accompanies this distribution. 
-  The Eclipse Public License is available at 
http://www.eclipse.org/legal/epl-v10.html
-  and the Eclipse Distribution License is available at 
-  http://www.eclipse.org/org/documents/edl-v10.php.
-  
-  Contributors:
-      Linda DeMichiel - Java Persistence 2.1, Version 2.1 (February 4, 2013)
-      Specification available from http://jcp.org/en/jsr/detail?id=338
- 
-    </xsd:documentation>
-  </xsd:annotation>
-
-   <xsd:annotation>
-     <xsd:documentation><![CDATA[
-
-     This is the XML Schema for the persistence configuration file.
-     The file must be named "META-INF/persistence.xml" in the 
-     persistence archive.
-
-     Persistence configuration files must indicate
-     the persistence schema by using the persistence namespace:
-
-     http://xmlns.jcp.org/xml/ns/persistence
-
-     and indicate the version of the schema by
-     using the version element as shown below:
-
-      <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence";
-        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-        xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence
-          http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd";
-        version="2.1">
-          ...
-      </persistence>
-
-    ]]></xsd:documentation>
-  </xsd:annotation>
-
-  <xsd:simpleType name="versionType">
-    <xsd:restriction base="xsd:token">
-      <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
-    </xsd:restriction>
-  </xsd:simpleType>
-
-  <!-- **************************************************** -->
-
-  <xsd:element name="persistence">
-    <xsd:complexType>
-      <xsd:sequence>
-
-        <!-- **************************************************** -->
-
-        <xsd:element name="persistence-unit" 
-                     minOccurs="1" maxOccurs="unbounded">
-          <xsd:complexType>
-            <xsd:annotation>
-              <xsd:documentation>
-
-                Configuration of a persistence unit.
-
-              </xsd:documentation>
-            </xsd:annotation>
-            <xsd:sequence>
-
-            <!-- **************************************************** -->
-
-              <xsd:element name="description" type="xsd:string" 
-                           minOccurs="0">
-                <xsd:annotation>
-                  <xsd:documentation>
-
-                    Description of this persistence unit.
-
-                  </xsd:documentation>
-                </xsd:annotation>
-              </xsd:element>
-
-              <!-- **************************************************** -->
-
-              <xsd:element name="provider" type="xsd:string" 
-                           minOccurs="0">
-                <xsd:annotation>
-                  <xsd:documentation>
-
-                    Provider class that supplies EntityManagers for this 
-                    persistence unit.
-
-                  </xsd:documentation>
-                </xsd:annotation>
-              </xsd:element>
-
-              <!-- **************************************************** -->
-
-              <xsd:element name="jta-data-source" type="xsd:string" 
-                           minOccurs="0">
-                <xsd:annotation>
-                  <xsd:documentation>
-
-                    The container-specific name of the JTA datasource to use.
-
-                  </xsd:documentation>
-                </xsd:annotation>
-              </xsd:element>
-
-              <!-- **************************************************** -->
-
-              <xsd:element name="non-jta-data-source" type="xsd:string" 
-                           minOccurs="0">
-                <xsd:annotation>
-                  <xsd:documentation>
-
-                    The container-specific name of a non-JTA datasource to use.
-
-                  </xsd:documentation>
-                </xsd:annotation>
-              </xsd:element>
-
-              <!-- **************************************************** -->
-
-              <xsd:element name="mapping-file" type="xsd:string" 
-                           minOccurs="0" maxOccurs="unbounded">
-                <xsd:annotation>
-                  <xsd:documentation>
-
-                    File containing mapping information. Loaded as a resource 
-                    by the persistence provider.
-
-                  </xsd:documentation>
-                </xsd:annotation>
-              </xsd:element>
-
-              <!-- **************************************************** -->
-
-              <xsd:element name="jar-file" type="xsd:string" 
-                           minOccurs="0" maxOccurs="unbounded">
-                <xsd:annotation>
-                  <xsd:documentation>
-
-                    Jar file that is to be scanned for managed classes. 
-
-                  </xsd:documentation>
-                </xsd:annotation>
-              </xsd:element>
-
-              <!-- **************************************************** -->
-
-              <xsd:element name="class" type="xsd:string" 
-                           minOccurs="0" maxOccurs="unbounded">
-                <xsd:annotation>
-                  <xsd:documentation>
-
-                    Managed class to be included in the persistence unit and
-                    to scan for annotations.  It should be annotated 
-                    with either @Entity, @Embeddable or @MappedSuperclass.
-
-                  </xsd:documentation>
-                </xsd:annotation>
-              </xsd:element>
-
-              <!-- **************************************************** -->
-
-              <xsd:element name="exclude-unlisted-classes" type="xsd:boolean" 
-                           default="true" minOccurs="0">
-                <xsd:annotation>
-                  <xsd:documentation>
-
-                    When set to true then only listed classes and jars will 
-                    be scanned for persistent classes, otherwise the 
-                    enclosing jar or directory will also be scanned. 
-                    Not applicable to Java SE persistence units.
-
-                  </xsd:documentation>
-                </xsd:annotation>
-              </xsd:element>
-
-              <!-- **************************************************** -->
-
-              <xsd:element name="shared-cache-mode" 
-                           type="persistence:persistence-unit-caching-type" 
-                           minOccurs="0">
-                <xsd:annotation>
-                  <xsd:documentation>
-
-                    Defines whether caching is enabled for the 
-                    persistence unit if caching is supported by the
-                    persistence provider. When set to ALL, all entities 
-                    will be cached. When set to NONE, no entities will
-                    be cached. When set to ENABLE_SELECTIVE, only entities
-                    specified as cacheable will be cached. When set to
-                    DISABLE_SELECTIVE, entities specified as not cacheable
-                    will not be cached. When not specified or when set to
-                    UNSPECIFIED, provider defaults may apply.
-
-                  </xsd:documentation>
-                </xsd:annotation>
-              </xsd:element>
-
-              <!-- **************************************************** -->
-
-              <xsd:element name="validation-mode" 
-                           
type="persistence:persistence-unit-validation-mode-type" 
-                           minOccurs="0">
-                <xsd:annotation>
-                  <xsd:documentation>
-
-                    The validation mode to be used for the persistence unit.
-
-                  </xsd:documentation>
-                </xsd:annotation>
-              </xsd:element>
-
-
-              <!-- **************************************************** -->
-
-              <xsd:element name="properties" minOccurs="0">
-                <xsd:annotation>
-                  <xsd:documentation>
-
-                    A list of standard and vendor-specific properties 
-                    and hints.
-
-                  </xsd:documentation>
-                </xsd:annotation>
-                <xsd:complexType>
-                  <xsd:sequence>
-                    <xsd:element name="property" 
-                                 minOccurs="0" maxOccurs="unbounded">
-                      <xsd:annotation>
-                        <xsd:documentation>
-                          A name-value pair.
-                        </xsd:documentation>
-                      </xsd:annotation>
-                      <xsd:complexType>
-                        <xsd:attribute name="name" type="xsd:string" 
-                                       use="required"/>
-                        <xsd:attribute name="value" type="xsd:string" 
-                                       use="required"/>
-                      </xsd:complexType>
-                    </xsd:element>
-                  </xsd:sequence>
-                </xsd:complexType>
-              </xsd:element>
-
-            </xsd:sequence>
-
-            <!-- **************************************************** -->
-
-            <xsd:attribute name="name" type="xsd:string" use="required">
-              <xsd:annotation>
-                <xsd:documentation>
-
-                  Name used in code to reference this persistence unit.
-
-                </xsd:documentation>
-              </xsd:annotation>
-            </xsd:attribute>
-
-            <!-- **************************************************** -->
-
-            <xsd:attribute name="transaction-type" 
-                           
type="persistence:persistence-unit-transaction-type">
-              <xsd:annotation>
-                <xsd:documentation>
-
-                  Type of transactions used by EntityManagers from this 
-                  persistence unit.
-
-                </xsd:documentation>
-              </xsd:annotation>
-            </xsd:attribute>
-
-          </xsd:complexType>
-        </xsd:element>
-      </xsd:sequence>
-      <xsd:attribute name="version" type="persistence:versionType" 
-                     fixed="2.1" use="required"/>
-    </xsd:complexType>
-  </xsd:element>
-
-  <!-- **************************************************** -->
-
-  <xsd:simpleType name="persistence-unit-transaction-type">
-    <xsd:annotation>
-      <xsd:documentation>
-
-        public enum PersistenceUnitTransactionType {JTA, RESOURCE_LOCAL};
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:restriction base="xsd:token">
-      <xsd:enumeration value="JTA"/>
-      <xsd:enumeration value="RESOURCE_LOCAL"/>
-    </xsd:restriction>
-  </xsd:simpleType>
-
-<!-- **************************************************** -->
-
-  <xsd:simpleType name="persistence-unit-caching-type">
-    <xsd:annotation>
-      <xsd:documentation>
-
-        public enum SharedCacheMode { ALL, NONE, ENABLE_SELECTIVE, 
DISABLE_SELECTIVE, UNSPECIFIED};
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:restriction base="xsd:token">
-      <xsd:enumeration value="ALL"/>
-      <xsd:enumeration value="NONE"/>
-      <xsd:enumeration value="ENABLE_SELECTIVE"/>
-      <xsd:enumeration value="DISABLE_SELECTIVE"/>
-      <xsd:enumeration value="UNSPECIFIED"/>
-    </xsd:restriction>
-  </xsd:simpleType>
-
-<!-- **************************************************** -->
-
-  <xsd:simpleType name="persistence-unit-validation-mode-type">
-    <xsd:annotation>
-      <xsd:documentation>
-
-        public enum ValidationMode { AUTO, CALLBACK, NONE};
-
-      </xsd:documentation>
-    </xsd:annotation>
-    <xsd:restriction base="xsd:token">
-      <xsd:enumeration value="AUTO"/>
-      <xsd:enumeration value="CALLBACK"/>
-      <xsd:enumeration value="NONE"/>
-    </xsd:restriction>
-  </xsd:simpleType>
-
-</xsd:schema>
diff --git 
a/components/camel-jpa/src/test/resources/META-INF/persistence_3_1.xsd 
b/components/camel-jpa/src/test/resources/META-INF/persistence_3_1.xsd
new file mode 100644
index 00000000000..7927549702f
--- /dev/null
+++ b/components/camel-jpa/src/test/resources/META-INF/persistence_3_1.xsd
@@ -0,0 +1,342 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright (c) 2008, 2020 Oracle and/or its affiliates. All rights reserved.
+
+    This program and the accompanying materials are made available under the
+    terms of the Eclipse Public License v. 2.0 which is available at
+    http://www.eclipse.org/legal/epl-2.0,
+    or the Eclipse Distribution License v. 1.0 which is available at
+    http://www.eclipse.org/org/documents/edl-v10.php.
+
+    SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
+
+-->
+
+<!-- persistence.xml schema -->
+<xsd:schema targetNamespace="https://jakarta.ee/xml/ns/persistence";
+               xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+               xmlns:persistence="https://jakarta.ee/xml/ns/persistence";
+               elementFormDefault="qualified"
+               attributeFormDefault="unqualified"
+               version="3.0">
+
+       <xsd:annotation>
+               <xsd:documentation><![CDATA[
+
+     This is the XML Schema for the persistence configuration file.
+     The file must be named "META-INF/persistence.xml" in the
+     persistence archive.
+
+     Persistence configuration files must indicate
+     the persistence schema by using the persistence namespace:
+
+     https://jakarta.ee/xml/ns/persistence
+
+     and indicate the version of the schema by
+     using the version element as shown below:
+
+      <persistence xmlns="https://jakarta.ee/xml/ns/persistence";
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+        xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence
+          https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd";
+        version="3.0">
+          ...
+      </persistence>
+
+    ]]></xsd:documentation>
+       </xsd:annotation>
+
+       <xsd:simpleType name="versionType">
+               <xsd:restriction base="xsd:token">
+                       <xsd:pattern value="[0-9]+(\.[0-9]+)*"/>
+               </xsd:restriction>
+       </xsd:simpleType>
+
+       <!-- **************************************************** -->
+
+       <xsd:element name="persistence">
+               <xsd:complexType>
+                       <xsd:sequence>
+
+                               <!-- 
**************************************************** -->
+
+                               <xsd:element name="persistence-unit"
+                                               minOccurs="1" 
maxOccurs="unbounded">
+                                       <xsd:complexType>
+                                               <xsd:annotation>
+                                                       <xsd:documentation>
+
+                                                               Configuration 
of a persistence unit.
+
+                                                       </xsd:documentation>
+                                               </xsd:annotation>
+                                               <xsd:sequence>
+
+                                                       <!-- 
**************************************************** -->
+
+                                                       <xsd:element 
name="description" type="xsd:string"
+                                                                       
minOccurs="0">
+                                                               <xsd:annotation>
+                                                                       
<xsd:documentation>
+
+                                                                               
Description of this persistence unit.
+
+                                                                       
</xsd:documentation>
+                                                               
</xsd:annotation>
+                                                       </xsd:element>
+
+                                                       <!-- 
**************************************************** -->
+
+                                                       <xsd:element 
name="provider" type="xsd:string"
+                                                                       
minOccurs="0">
+                                                               <xsd:annotation>
+                                                                       
<xsd:documentation>
+
+                                                                               
Provider class that supplies EntityManagers for this
+                                                                               
persistence unit.
+
+                                                                       
</xsd:documentation>
+                                                               
</xsd:annotation>
+                                                       </xsd:element>
+
+                                                       <!-- 
**************************************************** -->
+
+                                                       <xsd:element 
name="jta-data-source" type="xsd:string"
+                                                                       
minOccurs="0">
+                                                               <xsd:annotation>
+                                                                       
<xsd:documentation>
+
+                                                                               
The container-specific name of the JTA datasource to use.
+
+                                                                       
</xsd:documentation>
+                                                               
</xsd:annotation>
+                                                       </xsd:element>
+
+                                                       <!-- 
**************************************************** -->
+
+                                                       <xsd:element 
name="non-jta-data-source" type="xsd:string"
+                                                                       
minOccurs="0">
+                                                               <xsd:annotation>
+                                                                       
<xsd:documentation>
+
+                                                                               
The container-specific name of a non-JTA datasource to use.
+
+                                                                       
</xsd:documentation>
+                                                               
</xsd:annotation>
+                                                       </xsd:element>
+
+                                                       <!-- 
**************************************************** -->
+
+                                                       <xsd:element 
name="mapping-file" type="xsd:string"
+                                                                       
minOccurs="0" maxOccurs="unbounded">
+                                                               <xsd:annotation>
+                                                                       
<xsd:documentation>
+
+                                                                               
File containing mapping information. Loaded as a resource
+                                                                               
by the persistence provider.
+
+                                                                       
</xsd:documentation>
+                                                               
</xsd:annotation>
+                                                       </xsd:element>
+
+                                                       <!-- 
**************************************************** -->
+
+                                                       <xsd:element 
name="jar-file" type="xsd:string"
+                                                                       
minOccurs="0" maxOccurs="unbounded">
+                                                               <xsd:annotation>
+                                                                       
<xsd:documentation>
+
+                                                                               
Jar file that is to be scanned for managed classes.
+
+                                                                       
</xsd:documentation>
+                                                               
</xsd:annotation>
+                                                       </xsd:element>
+
+                                                       <!-- 
**************************************************** -->
+
+                                                       <xsd:element 
name="class" type="xsd:string"
+                                                                       
minOccurs="0" maxOccurs="unbounded">
+                                                               <xsd:annotation>
+                                                                       
<xsd:documentation>
+
+                                                                               
Managed class to be included in the persistence unit and
+                                                                               
to scan for annotations.  It should be annotated
+                                                                               
with either @Entity, @Embeddable or @MappedSuperclass.
+
+                                                                       
</xsd:documentation>
+                                                               
</xsd:annotation>
+                                                       </xsd:element>
+
+                                                       <!-- 
**************************************************** -->
+
+                                                       <xsd:element 
name="exclude-unlisted-classes" type="xsd:boolean"
+                                                                       
default="true" minOccurs="0">
+                                                               <xsd:annotation>
+                                                                       
<xsd:documentation>
+
+                                                                               
When set to true then only listed classes and jars will
+                                                                               
be scanned for persistent classes, otherwise the
+                                                                               
enclosing jar or directory will also be scanned.
+                                                                               
Not applicable to Java SE persistence units.
+
+                                                                       
</xsd:documentation>
+                                                               
</xsd:annotation>
+                                                       </xsd:element>
+
+                                                       <!-- 
**************************************************** -->
+
+                                                       <xsd:element 
name="shared-cache-mode"
+                                                                       
type="persistence:persistence-unit-caching-type"
+                                                                       
minOccurs="0">
+                                                               <xsd:annotation>
+                                                                       
<xsd:documentation>
+
+                                                                               
Defines whether caching is enabled for the
+                                                                               
persistence unit if caching is supported by the
+                                                                               
persistence provider. When set to ALL, all entities
+                                                                               
will be cached. When set to NONE, no entities will
+                                                                               
be cached. When set to ENABLE_SELECTIVE, only entities
+                                                                               
specified as cacheable will be cached. When set to
+                                                                               
DISABLE_SELECTIVE, entities specified as not cacheable
+                                                                               
will not be cached. When not specified or when set to
+                                                                               
UNSPECIFIED, provider defaults may apply.
+
+                                                                       
</xsd:documentation>
+                                                               
</xsd:annotation>
+                                                       </xsd:element>
+
+                                                       <!-- 
**************************************************** -->
+
+                                                       <xsd:element 
name="validation-mode"
+                                                                       
type="persistence:persistence-unit-validation-mode-type"
+                                                                       
minOccurs="0">
+                                                               <xsd:annotation>
+                                                                       
<xsd:documentation>
+
+                                                                               
The validation mode to be used for the persistence unit.
+
+                                                                       
</xsd:documentation>
+                                                               
</xsd:annotation>
+                                                       </xsd:element>
+
+
+                                                       <!-- 
**************************************************** -->
+
+                                                       <xsd:element 
name="properties" minOccurs="0">
+                                                               <xsd:annotation>
+                                                                       
<xsd:documentation>
+
+                                                                               
A list of standard and vendor-specific properties
+                                                                               
and hints.
+
+                                                                       
</xsd:documentation>
+                                                               
</xsd:annotation>
+                                                               
<xsd:complexType>
+                                                                       
<xsd:sequence>
+                                                                               
<xsd:element name="property"
+                                                                               
                minOccurs="0" maxOccurs="unbounded">
+                                                                               
        <xsd:annotation>
+                                                                               
                <xsd:documentation>
+                                                                               
                        A name-value pair.
+                                                                               
                </xsd:documentation>
+                                                                               
        </xsd:annotation>
+                                                                               
        <xsd:complexType>
+                                                                               
                <xsd:attribute name="name" type="xsd:string"
+                                                                               
                                use="required"/>
+                                                                               
                <xsd:attribute name="value" type="xsd:string"
+                                                                               
                                use="required"/>
+                                                                               
        </xsd:complexType>
+                                                                               
</xsd:element>
+                                                                       
</xsd:sequence>
+                                                               
</xsd:complexType>
+                                                       </xsd:element>
+
+                                               </xsd:sequence>
+
+                                               <!-- 
**************************************************** -->
+
+                                               <xsd:attribute name="name" 
type="xsd:string" use="required">
+                                                       <xsd:annotation>
+                                                               
<xsd:documentation>
+
+                                                                       Name 
used in code to reference this persistence unit.
+
+                                                               
</xsd:documentation>
+                                                       </xsd:annotation>
+                                               </xsd:attribute>
+
+                                               <!-- 
**************************************************** -->
+
+                                               <xsd:attribute 
name="transaction-type"
+                                                               
type="persistence:persistence-unit-transaction-type">
+                                                       <xsd:annotation>
+                                                               
<xsd:documentation>
+
+                                                                       Type of 
transactions used by EntityManagers from this
+                                                                       
persistence unit.
+
+                                                               
</xsd:documentation>
+                                                       </xsd:annotation>
+                                               </xsd:attribute>
+
+                                       </xsd:complexType>
+                               </xsd:element>
+                       </xsd:sequence>
+                       <xsd:attribute name="version" 
type="persistence:versionType"
+                                       fixed="3.0" use="required"/>
+               </xsd:complexType>
+       </xsd:element>
+
+       <!-- **************************************************** -->
+
+       <xsd:simpleType name="persistence-unit-transaction-type">
+               <xsd:annotation>
+                       <xsd:documentation>
+
+                               public enum PersistenceUnitTransactionType 
{JTA, RESOURCE_LOCAL};
+
+                       </xsd:documentation>
+               </xsd:annotation>
+               <xsd:restriction base="xsd:token">
+                       <xsd:enumeration value="JTA"/>
+                       <xsd:enumeration value="RESOURCE_LOCAL"/>
+               </xsd:restriction>
+       </xsd:simpleType>
+
+       <!-- **************************************************** -->
+
+       <xsd:simpleType name="persistence-unit-caching-type">
+               <xsd:annotation>
+                       <xsd:documentation>
+
+                               public enum SharedCacheMode { ALL, NONE, 
ENABLE_SELECTIVE, DISABLE_SELECTIVE, UNSPECIFIED};
+
+                       </xsd:documentation>
+               </xsd:annotation>
+               <xsd:restriction base="xsd:token">
+                       <xsd:enumeration value="ALL"/>
+                       <xsd:enumeration value="NONE"/>
+                       <xsd:enumeration value="ENABLE_SELECTIVE"/>
+                       <xsd:enumeration value="DISABLE_SELECTIVE"/>
+                       <xsd:enumeration value="UNSPECIFIED"/>
+               </xsd:restriction>
+       </xsd:simpleType>
+
+       <!-- **************************************************** -->
+
+       <xsd:simpleType name="persistence-unit-validation-mode-type">
+               <xsd:annotation>
+                       <xsd:documentation>
+
+                               public enum ValidationMode { AUTO, CALLBACK, 
NONE};
+
+                       </xsd:documentation>
+               </xsd:annotation>
+               <xsd:restriction base="xsd:token">
+                       <xsd:enumeration value="AUTO"/>
+                       <xsd:enumeration value="CALLBACK"/>
+                       <xsd:enumeration value="NONE"/>
+               </xsd:restriction>
+       </xsd:simpleType>
+
+</xsd:schema>
diff --git 
a/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml
 
b/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml
index 433cf7447ea..5ab653c315f 100644
--- 
a/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml
+++ 
b/components/camel-jpa/src/test/resources/profiles/hibernate/META-INF/persistence.xml
@@ -17,11 +17,10 @@
     limitations under the License.
 
 -->
-<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence";
-             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-             version="2.1"
-             xsi:schemaLocation="
-             http://xmlns.jcp.org/xml/ns/persistence 
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd";>
+<persistence xmlns="https://jakarta.ee/xml/ns/persistence";
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+          xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence 
../../../META-INF/persistence_3_1.xsd"
+          version="3.0">
 
   <persistence-unit name="camel" transaction-type="RESOURCE_LOCAL">
     <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
@@ -54,6 +53,19 @@
     </properties>
   </persistence-unit>
 
+  <persistence-unit name="pooling" transaction-type="RESOURCE_LOCAL">
+    <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
+
+    <class>org.apache.camel.examples.SendEmail</class>
+
+    <properties>
+      <property name="hibernate.dialect" 
value="org.hibernate.dialect.DerbyTenSevenDialect"/>
+      <property name="hibernate.connection.driver_class" 
value="org.apache.derby.jdbc.EmbeddedDriver"/>
+      <property name="hibernate.connection.url" 
value="jdbc:derby:target/custom;create=true"/>
+      <property name="hibernate.hbm2ddl.auto" value="create"/>
+    </properties>
+  </persistence-unit>
+
   <persistence-unit name="idempotentDb" transaction-type="RESOURCE_LOCAL">
     <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
 

Reply via email to