Skip to content

Commit a04b75e

Browse files
committed
Add persistence.xml 3.1 schema support
Signed-off-by: Will Dazey <[email protected]>
1 parent f772522 commit a04b75e

File tree

4 files changed

+371
-8
lines changed

4 files changed

+371
-8
lines changed

jpa/eclipselink.jpa.test/src/it/resources/eclipselink-beanvalidation-model/persistence.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
<persistence xmlns="https://jakarta.ee/xml/ns/persistence"
1616
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17-
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"
18-
version="3.0">
17+
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"
18+
version="3.1">
1919
<persistence-unit name="beanvalidation" transaction-type="RESOURCE_LOCAL">
2020
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
2121
<class>org.eclipse.persistence.testing.models.jpa.beanvalidation.Employee</class>

jpa/eclipselink.jpa.test/src/it/resources/eclipselink-beanvalidation-model/server/persistence.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
<persistence xmlns="https://jakarta.ee/xml/ns/persistence"
1616
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17-
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd"
18-
version="3.0">
17+
xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"
18+
version="3.1">
1919
<persistence-unit name="@default@" transaction-type="@transaction-type@">
2020
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
2121
<@datasource-type@>@data-source-name@</@datasource-type@>

jpa/org.eclipse.persistence.jpa.modelgen/src/test/java/org/eclipse/persistence/jpa/test/modelgen/TestProcessor.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,37 +65,41 @@ public static void prepare() throws IOException {
6565
@Test
6666
public void testProc() throws Exception {
6767
testProc("testProc3030", PXML30, OXML30);
68-
testProc("testProc3031", PXML30, OXML31);
68+
testProc("testProc3131", PXML31, OXML31);
6969
}
7070

7171
@Test
7272
public void testGenerateComment() throws Exception {
7373
testGenerateComment("testGenerateComment3030", PXML30, OXML30);
74-
testGenerateComment("testGenerateComment3031", PXML30, OXML31);
74+
testGenerateComment("testGenerateComment3131", PXML31, OXML31);
7575
}
7676

7777
@Test
7878
public void testGenerate() throws Exception {
7979
testGenerate("testGenerate3030", PXML30, OXML30);
80-
testGenerate("testGenerate3031", PXML30, OXML31);
80+
testGenerate("testGenerate3131", PXML31, OXML31);
8181
}
8282

8383
@Test
8484
public void testTypeUse() throws Exception {
8585
testTypeUse("testTypeUse3030", PXML30, OXML30);
86-
testTypeUse("testTypeUse3031", PXML30, OXML31);
86+
testTypeUse("testTypeUse3131", PXML31, OXML31);
8787
}
8888

8989
@Test
9090
public void testProcessorLoggingOffFromCmdLine() throws Exception {
9191
verifyLogging("testProcessorLoggingOffFromCmdLine", PXML30, false,
9292
"-Aeclipselink.logging.level.processor=OFF");
93+
verifyLogging("testProcessorLoggingOffFromCmdLine", PXML31, false,
94+
"-Aeclipselink.logging.level.processor=OFF");
9395
}
9496

9597
@Test
9698
public void testGlobalLoggingOffFromCmdLine() throws Exception {
9799
verifyLogging("testGlobalLoggingOffFromCmdLine", PXML30, false,
98100
"-Aeclipselink.logging.level=OFF");
101+
verifyLogging("testGlobalLoggingOffFromCmdLine", PXML31, false,
102+
"-Aeclipselink.logging.level=OFF");
99103
}
100104

101105
@Test
@@ -118,12 +122,16 @@ public void testGlobalLoggingOffFromPU() throws Exception {
118122
public void testProcessorLoggingFinestFromCmdLine() throws Exception {
119123
verifyLogging("testProcessorLoggingFinestFromCmdLine", PXML30, true,
120124
"-Aeclipselink.logging.level.processor=FINEST");
125+
verifyLogging("testProcessorLoggingFinestFromCmdLine", PXML31, true,
126+
"-Aeclipselink.logging.level.processor=FINEST");
121127
}
122128

123129
@Test
124130
public void testGlobalLoggingFinestFromCmdLine() throws Exception {
125131
verifyLogging("testGlobalLoggingFinestFromCmdLine", PXML30, true,
126132
"-Aeclipselink.logging.level=FINEST");
133+
verifyLogging("testGlobalLoggingFinestFromCmdLine", PXML31, true,
134+
"-Aeclipselink.logging.level=FINEST");
127135
}
128136

129137
@Test
@@ -355,6 +363,19 @@ private static class Result {
355363
" </persistence-unit>\n" +
356364
"</persistence>";
357365

366+
private static final String PXML31 = "<persistence xmlns=\"https://jakarta.ee/xml/ns/persistence\"\n" +
367+
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
368+
" xsi:schemaLocation=\"https://jakarta.ee/xml/ns/persistence\n" +
369+
" https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd\"\n" +
370+
" version=\"3.1\">\n" +
371+
" <persistence-unit name=\"sample-pu\" transaction-type=\"RESOURCE_LOCAL\">\n" +
372+
" <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>\n" +
373+
" <exclude-unlisted-classes>false</exclude-unlisted-classes>\n" +
374+
" <properties>\n" +
375+
" </properties>\n" +
376+
" </persistence-unit>\n" +
377+
"</persistence>";
378+
358379
private static final String OXML30 = "<entity-mappings xmlns=\"https://jakarta.ee/xml/ns/persistence/orm\"\n" +
359380
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
360381
" xsi:schemaLocation=\"https://jakarta.ee/xml/ns/persistence/orm https://jakarta.ee/xml/ns/persistence/orm/orm_3_0.xsd\"\n" +

0 commit comments

Comments
 (0)