You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by st...@apache.org on 2021/05/08 20:40:08 UTC

[openjpa] branch master updated (e3fd21f -> f72f3ca)

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

struberg pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git.


    from e3fd21f  OPENJPA-2871 update to xbean-4.20
     new 271e3e5  upgrade documentation for the next release
     new 361da25  update docs for OpenJPA-3.2.0
     new f72f3ca  OPENJPA-2873 add persistence_2_2.xsd handling

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/openjpa/lib/meta/XMLVersionParser.java  |   1 +
 .../persistence/PersistenceProductDerivation.java  |  15 +-
 ...tence_2_1.xsd.rsrc => persistence_2_2.xsd.rsrc} |  94 ++++-----
 openjpa-project/CHANGES.txt                        | 221 ++++++---------------
 openjpa-project/LICENSE                            |   2 +
 .../src/doc/manual/jpa_overview_intro.xml          |   4 +-
 openjpa-project/src/doc/manual/manual.xml          |   2 +-
 openjpa-project/src/doc/manual/openjpa_intro.xml   |   4 +-
 8 files changed, 130 insertions(+), 213 deletions(-)
 copy openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/{persistence_2_1.xsd.rsrc => persistence_2_2.xsd.rsrc} (89%)

[openjpa] 01/03: upgrade documentation for the next release

Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit 271e3e50cff8e4799eb9ae60acd249ab4fdbf9af
Author: Mark Struberg <st...@apache.org>
AuthorDate: Sat May 8 17:18:33 2021 +0200

    upgrade documentation for the next release
---
 openjpa-project/CHANGES.txt | 221 +++++++++++++-------------------------------
 1 file changed, 65 insertions(+), 156 deletions(-)

diff --git a/openjpa-project/CHANGES.txt b/openjpa-project/CHANGES.txt
index 4d9558b..c7e6f67 100644
--- a/openjpa-project/CHANGES.txt
+++ b/openjpa-project/CHANGES.txt
@@ -1,4 +1,4 @@
-Apache OpenJPA 2.2.0
+Apache OpenJPA 3.2.0
 Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
 --------------------------------------------------------------------------------
 
@@ -21,10 +21,10 @@ Content
 Overview
 --------
    The Apache OpenJPA community is proud to release a SNAPSHOT distribution of
-   OpenJPA 2.2.0. This distribution is based on the final JSR 317 Java
-   Persistence API, Version 2.0 specification and passes the JPA 2.0 TCK,
-   while remaining backwards compatible with prior releases based on the
-   Java Persistence API (JPA 1.0) part of Java Community Process JSR-220
+   OpenJPA 3.2.0. This distribution is based on the final JSR 317 Java
+   Persistence API, Version 2.02 specification, while remaining backwards
+   compatible with prior releases based on the Java Persistence API
+   (JPA 1.0, 2.0, 2.1) part of Java Community Process JSR-220
    (Enterprise JavaBeans 3.0).
 
    Additional information on the OpenJPA project may be found at the project
@@ -54,7 +54,7 @@ License
 
 Notices
 -------
-   Copyright 2006,2012 The Apache Software Foundation.
+   Copyright 2006,2021 The Apache Software Foundation.
    Apache, the Apache feather logo and OpenJPA are trademarks of
    The Apache Software Foundation.
 
@@ -75,7 +75,7 @@ Notices
 
 Prerequisites
 -------------
-   OpenJPA requires Java SE 6 or higher and a relational
+   OpenJPA requires Java SE 8 or higher and a relational
    database of some sort.
 
 
@@ -110,169 +110,78 @@ Getting Involved
           freenode.net.
         * Bugs and other issues can be posted on the issue tracker at
           https://issues.apache.org/jira/browse/OPENJPA
+        * Our homepage https://openjpa.apache.org contains more information
 
 
-Included Changes in OpenJPA 2.2.0
+Included Changes in OpenJPA 3.2.0
 ---------------------------------
 
 Sub-task
 
-    [OPENJPA-1593] - Create an OSGiManagedRuntime
-    [OPENJPA-2081] - Provide subset of XML support for OpenJPA annotations
+    [OPENJPA-1594] - Tests not handling new QueryTimeOut and LockTimeOut exceptions correctly
 
 Bug
 
-    [OPENJPA-478] - Contradictory text in manual section 10.2.6. JPQL GROUP BY, HAVING
-    [OPENJPA-867] - Unexpected Behaviour of DBDictionary.indexOf() method
-    [OPENJPA-1343] - Incorrect example of openjpa.Sequence property
-    [OPENJPA-1376] - @SequenceGenerator allocationSize incorrect implementation
-    [OPENJPA-1650] - Adding a slice dynamically should be done via persistence unit only
-    [OPENJPA-1651] - Unique colums automatically defined as non-nullable (part 2)
-    [OPENJPA-1657] - Postgres connection throws NPE with null properties
-    [OPENJPA-1686] - Persistence of Dynamic and Generic Type
-    [OPENJPA-1725] - Schemaname wrongly included in DBDictionary.checkNameLength after Tablename correctly truncated
-    [OPENJPA-1746] - NullPointerException when a null value is set in the properties map passed to Entity.createEntityManagerFactory
-    [OPENJPA-1768] - StackOverflowError when finding an Entity with an Eager ManyToMany relationship.
-    [OPENJPA-1787] - Bean validation fails merging a new entity
-    [OPENJPA-1845] - the prepared query cache doesn't currently work correclty with 'SELECT IN' statements
-    [OPENJPA-1856] - Executing bulk updates should evict stale data from the DataCache
-    [OPENJPA-1873] - EntityManager#merge sometimes passes wrong entity values to @PostLoad EntityListeners
-    [OPENJPA-1876] - Slow JDBC tests
-    [OPENJPA-1896] - OpenJPA cannot store POJOs if a corresponding record already exists
-    [OPENJPA-1898] - TestQueryMultiThreaded fails with OOME "unable to create new native thread"
-    [OPENJPA-1900] - ClassCastException when serializing an entity if DetachedStateField=true
-    [OPENJPA-1901] - QueryCacheStoreQuery$CachedObjectId that is not Serializable
-    [OPENJPA-1902] - SQLServer reserved words may not be used as identifiers
-    [OPENJPA-1903] - Some queries only work the first time they are executed
-    [OPENJPA-1904] - OptimisticLockException during refresh(*,PESSIMISTIC_*) with eagar fetch on relationship fields
-    [OPENJPA-1905] - jar-file validation should be deferred until after OpenJPA is confirmed to be the application's chosen provider
-    [OPENJPA-1906] - Issue info / warning message when connection retain mode is always
-    [OPENJPA-1909] - enhance unit tests with the correct persistence.xml
-    [OPENJPA-1910] - openjpa uses application ClassLoader for resolving BrokerFactory (revisited)
-    [OPENJPA-1911] - InvalidStateException is thrown when merge an entity with derived identiy
-    [OPENJPA-1912] - enhancer generates invalid code if fetch-groups is activated
-    [OPENJPA-1915] - missing license header
-    [OPENJPA-1918] - MetaDataRepository.preload() ignores class loader returned by PersistenceUnitInfo.getClassLoader()
-    [OPENJPA-1923] - Allow flexible (non-standard) syntax for collection-valued parameters in IN() expresseion of JPQL query
-    [OPENJPA-1928] - Resolving factory method does not allow method overriding
-    [OPENJPA-1932] - Documentation corrections
-    [OPENJPA-1935] - Informix lock exceptions are not mapped properly by OpenJPA
-    [OPENJPA-1938] - Typo of time data type in SQLServerdictionary for MSSQL 2008
-    [OPENJPA-1939] - index identifier max length for DB2 v9 is 128.
-    [OPENJPA-1940] - ReverseMapping tool does not find primary keys with Oracle
-    [OPENJPA-1941] - Criteria query returns wrong result when query cache is enabled
-    [OPENJPA-1943] - Query timeout hint not honored consistently when pessimistic lock is issued to database requires multi-statements locking scheme
-    [OPENJPA-1944] - Extra select statements executed when version column is null.
-    [OPENJPA-1951] - missing key "cant-set-value" in localizer properties org.apache.openjpa.jdbc.meta.strats
-    [OPENJPA-1953] - Copying data from inputStream to OuputStream needs appropriate buffer size
-    [OPENJPA-1954] - ArrayIndexOutOfBoundsException when querying on a version field that is in a MappedSuperclass
-    [OPENJPA-1957] - XML overriding column names for ArrayList attributes causes exception.
-    [OPENJPA-1958] - IndexOutOfBoundsException in BatchingPreparedStatementManagerImpl
-    [OPENJPA-1959] - RuntimeExceptionTranslator should be transient in DelegatingQuery
-    [OPENJPA-1960] - openjpa.InitializeEagerly breaks bean-validation integration
-    [OPENJPA-1965] - ClassCastException when using JAXB and MetaModel annotation processor
-    [OPENJPA-1968] - SQLServerDictionery not using DATETIME2 for jdbc driver other than MS JDBC driver
-    [OPENJPA-1969] - SQLServer / DataDirect SQLCode=HYT00 not handled
-    [OPENJPA-1974] - StackOverflowError when performing multiple subquery in collection field with eager fetch
-    [OPENJPA-1975] - Only obtain default schema name when needed (DB2)
-    [OPENJPA-1981] - Improper cleanup in SchemaGenerator
-    [OPENJPA-1983] - Merge of lazily fetched fields, and merge of managed entities deviates from spec
-    [OPENJPA-1984] - Incorrect ViolationContraint getRootBean when removing bean with embedded entity validation
-    [OPENJPA-1985] - ClassCastException in max(Timestamp) function on PostgreSQL
-    [OPENJPA-1986] - Extra queries being generated when cascading a persist
-    [OPENJPA-1987] - Postgres / Ingres does not support null table for getImportedKeys
-    [OPENJPA-1989] - *ToOne relationships specified as LAZY in xml aren't honored
-    [OPENJPA-1992] - java.lang.ArrayIndexOutOfBoundsException if positional parameter are not started from 1
-    [OPENJPA-1994] - Index is a reserved word for MySQL
-    [OPENJPA-1996] - OpenJPA Samples fail on MacOS X
-    [OPENJPA-1998] - NPE getTableNameForMetadata when running SchemaTool reflect against Postgres DB
-    [OPENJPA-2000] - Wrong PostgreSQL data type for REAL - "float8", must be "float4"
-    [OPENJPA-2005] - PostgresDictionary.isOwnedSequence needs a null check
-    [OPENJPA-2006] - Sequence generated ids may fail to get assigned when flushing a graph with bi-directional relationships
-    [OPENJPA-2007] - Setting query hint "openjpa.FetchPlan.Isolation" results in misleading warning
-    [OPENJPA-2008] - OpenJPA does not work with native queries in a distributed (Slice) environment
-    [OPENJPA-2010] - Duplicate meta data warning logged due to parsing the same location twice
-    [OPENJPA-2011] - Prevent reparsing annotation metadata for queries
-    [OPENJPA-2013] - columnDefinition for TEXT types ends up in wrong sql statement
-    [OPENJPA-2025] - Byte[] and Char[] should be treated as SingularAttributes, not lists by the metamodel generator
-    [OPENJPA-2027] - Metamodel genereated at runtime expects ListAttribute for all arrays - not just PersistentCollections.
-    [OPENJPA-2034] - Update H2 Database sql error codes as per the changes in v1.3.154
-    [OPENJPA-2036] - DynamicEnhancer should look for tools.jar in java.home/lib for all JDKs, not just the IBM SDK.
-    [OPENJPA-2039] - FKs for EAGER fields that are not in the current fetchplan aren't selected
-    [OPENJPA-2044] - Invalid header in MetaModel classes generated by AnnotationProcessor
-    [OPENJPA-2045] - NAME is a valid column name for H2 databases.
-    [OPENJPA-2051] - Entities in a relationship are not properly cascaded after a EntityManager.flush is executed.
-    [OPENJPA-2056] - Postgres V9.1 issue with LIKE clause and Escape Strings
-    [OPENJPA-2059] - Missing localizer.properties for org.apache.openjpa.persistence.util.SourceCode
-    [OPENJPA-2060] - AnnotationProcess failed to generate metadata for List<String>[] attribute in entity
-    [OPENJPA-2065] - JPA 2.0 Spec. Violation? EntityManager#createNamedQuery(String, Class) bombs with non-entity Class parameter
-    [OPENJPA-2066] - Edge case in openJPA-1227. openJPA fails to create a join and thus returns wrong data when a collection is selected from superclass and another field is selected from subclass twoor more levels down the hierarchy.
-    [OPENJPA-2069] - Natvie sequence problems uncovered after OPENJPA-1376
-    [OPENJPA-2070] - Error processing while populating Metamodel classes needs improvement
-    [OPENJPA-2071] - NPE during ResultPacker interface processing
-    [OPENJPA-2073] - MappingTools requires live connection to DB2 server to retrieve default schema name
-    [OPENJPA-2076] - Minor fix-ups to messages
-    [OPENJPA-2077] - Pom references to org.codehaus.mojo openjpa-maven-plugin cause problems
-    [OPENJPA-2083] - Unmapped fields silently treated as transient
-    [OPENJPA-2100] - openjpa-maven-plugin fails to create SQL for entities which contain enums
-    [OPENJPA-2101] - PersistenceProductDerivation overwrites the RemoteCommitProvider configuration
-    [OPENJPA-2104] - BindParameter is not a valid query parameter as processed in DBDictionary's setUnknown()
-    [OPENJPA-2105] - Document changes no longer being uploaded
-    [OPENJPA-2107] - ManagedCache conflict due adding an entity 2 times in the same query.
-    [OPENJPA-2117] - XML overriding column names for 1xM attributes causes exception.
-    [OPENJPA-2119] - Update org.apache.openjpa.persistence.util.SourceCode
-    [OPENJPA-2122] - VerifyError with Java 7 when using javaagent or dynamic container enhancement
-    [OPENJPA-2124] - Use of XMLValueHandler results in a NullPointerException when classloader does not provide package support
+    [OPENJPA-1303] - Reserved words are not mapped correctly in table definition
+    [OPENJPA-2182] - DB dictionaries do not properly process reserved words for column names
+    [OPENJPA-2648] - hsqldb @Id long create table as interger instead of bigint
+    [OPENJPA-2731] - Problems with Boolean Representation with Postgres
+    [OPENJPA-2788] - Anonymous parameters are not being picked when adding via CriteriaBuilder
+    [OPENJPA-2789] - JDBC connection not closed when running named query in explicitly opened connection
+    [OPENJPA-2795] - generate foreign key indexes for Oracle
+    [OPENJPA-2814] - Memory Leak in ForeignKey class
+    [OPENJPA-2821] - Subclassing enhancer must use AsmAdapter
+    [OPENJPA-2828] - org.apache.openjpa.kernel.conf.Specification.equals() : returns true even if different
+    [OPENJPA-2829] - javax script execution does not ignore empty lines
+    [OPENJPA-2830] - javax.persistence.sql-load-script-source does not support ";" in strings
+    [OPENJPA-2832] - DROP COLUMN does not use delimiters and always add double quotes
+    [OPENJPA-2834] - Performance issue while deploying in Wildfly EAP with OpenJPA-3.1.1
+    [OPENJPA-2842] - openjpa.Log=log4j vs log4j2 - reintroduce log4j support and add explicit log4j2 support
+    [OPENJPA-2843] - try to get rid of com.ibm dependency
+    [OPENJPA-2846] - Enhancement does not work with JDK 16
+    [OPENJPA-2849] - select(max) etc of LocalDate, LocalDateTime etc leads to ClassCastException
+    [OPENJPA-2850] - [MSSQL] BLOB column type is not supported
+    [OPENJPA-2851] - argument CURRENT_DATE cannot handle java.time.LocalDateTime entity fields
+    [OPENJPA-2854] - fix OffsetTime handling for PostgreSQL
+    [OPENJPA-2855] - primary keys do no respect naming rules
+    [OPENJPA-2856] - [MariaDB] improve TIME handling
+    [OPENJPA-2857] - [MariaDB] locking in some cases gets handled via sqlState 70100
+    [OPENJPA-2858] - update dbcp2 to 2.8.0
+    [OPENJPA-2859] - [HSQLDB] HSQLDictionary wrongly maps double to NUMERIC without precision
+    [OPENJPA-2860] - [Postgres] use setQueryTimeout for PostgreSQL >= 10
+    [OPENJPA-2861] - select sum(CASE x WHEN x THEN 1 ELSE 0 ) returns String instead of Long.
+    [OPENJPA-2862] - select SUM doesn't return spec defined types
+    [OPENJPA-2863] - java.time.LocalDateTime in Oracle gets rounded to just 3 digits
+    [OPENJPA-2864] - respect the Columns precision when persisting a java.sql.Timestamp value
+    [OPENJPA-2865] - [Oracle] use native java.time JDBC features
+    [OPENJPA-2866] - [Oracle] add GenerationType#IDENTITY support for Oracle
+    [OPENJPA-2871] - upgrade to xbean-4.20 to remove transitive ASM dependency
 
-Improvement
+New Feature
 
-    [OPENJPA-302] - PCEnhancer needs target classes on classpath
-    [OPENJPA-487] - Generated SUBSTRING SQL is ugly and inefficient
-    [OPENJPA-758] - OpenJPA doesn't find ValueHandlers with an applicable class loader
-    [OPENJPA-1555] - SQLBuffer code cleanup
-    [OPENJPA-1777] - Allow setting of diagonstic context for each slice in a more flexible manner
-    [OPENJPA-1778] - Improved error information for unenhanced classes.
-    [OPENJPA-1798] - Improve messages in localize.properties
-    [OPENJPA-1803] - Unwrap EntityManager to Connection
-    [OPENJPA-1847] - Use a single connection when generating schema
-    [OPENJPA-1863] - update HSQL dictionary for HSQLDB 2.0
-    [OPENJPA-1917] - Cache column alias in SelectImpl
-    [OPENJPA-1937] - Document OpenJPAEntityManager.evict methods
-    [OPENJPA-1945] - Improve aspects of the OpenBooks sample
-    [OPENJPA-1972] - DB2 V9.7 changed the default behavior concerning blocking behavior with isolation levels greater then read uncommitted
-    [OPENJPA-1990] - Skip getting extend exception text when running on DB2
-    [OPENJPA-1999] - Optional support for non-sequential positional parameters
-    [OPENJPA-2014] - Allow proxies to stay in place when Detaching
-    [OPENJPA-2020] - Make some members of StateManagerImpl protected to allow for greater extensability
-    [OPENJPA-2031] - Unable to import maven projects with m2e version 1.0
-    [OPENJPA-2042] - Diagnostics for Application Managed EntityManagerFactory leaks.
-    [OPENJPA-2043] - OpenJPAId hashCode() value needs to be consistent after serialization process
-    [OPENJPA-2047] - Document the impact of Persistence Aware classes
-    [OPENJPA-2068] - Improve performance of java.util.Calendar fields
-    [OPENJPA-2075] - Abstract out parameter handling / validation from org.apache.openjpa.persistence.QueryImpl to allow for greater extensibility
-    [OPENJPA-2084] - Upgrade Derby dependency to 10.8.x
-    [OPENJPA-2085] - Improve enhancement process to support JAVA 7 compliant class file generation
-    [OPENJPA-2087] - Remove or limit the use of the ConcreteClassGenerator
-    [OPENJPA-2116] - Scrape the barrel for performance juice
-    [OPENJPA-2120] - Add new option to eliminate reflection calls from enhancer generated IdClass PC copy operations
-    [OPENJPA-2128] - Add a boolean to FieldMetaData to denote whether or not a field has a @EmbeddedId annotation.
-    [OPENJPA-2130] - Enable Java 7 testing by allowing test cases to compile targeting to 1.7
+    [OPENJPA-2816] - Add HerdDB DBDictionary
 
-New Feature
+Improvement
 
-    [OPENJPA-184] - use DB2 Diagnostic interface to report extended error diagnostics on SQL Exception
-    [OPENJPA-1859] - Create a sample to demonstrate usage of JEST
-    [OPENJPA-1934] - contribute an openjpa-maven-plugin
-    [OPENJPA-2108] - Allow an option to terminate MappingTool-generated SQL with a character other than semicolon
+    [OPENJPA-84] - Escape sql reserved words in column names
+    [OPENJPA-2665] - refactore code to use more Java7 features.
+    [OPENJPA-2765] - Fix documentation of JPA spec compliance
+    [OPENJPA-2820] - Track when a DBIdentifier is already delimited in order to save memory allocations and cpu
+    [OPENJPA-2822] - enhancer can rely on at least java8
+    [OPENJPA-2823] - treat jakarta.* as spec class in enhancer
+    [OPENJPA-2852] - Maven Plugin should be marked thread safe
+    [OPENJPA-2853] - [MSSQL Server] support sendTimeAsDatetime handling
+    [OPENJPA-2867] - generate list of reserved Words via unit test
+    [OPENJPA-2868] - update reserved column names list for various of our DBDictionaries
+    [OPENJPA-2870] - update specification-version to 2.2
 
 Task
 
-    [OPENJPA-1786] - Upgrade to latest JPA 2.0 TCK
-    [OPENJPA-1834] - Upgrade trunk to use Deby 10.6.2.1 for junits
-    [OPENJPA-1875] - Add generics to the Graph code
-    [OPENJPA-2089] - upgrade bval to latest 0.3-incubating
-    [OPENJPA-2091] - update docbook maven plugin
-
-Test
+    [OPENJPA-2819] - Add simple GitHub Actions validation for Pull Requests
+    [OPENJPA-2824] - When @OpenJPASupport (junit5 extension) is used, ensure to not do auto enhancement more than once
+    [OPENJPA-2831] - Import commons-collections4 classes instead of the dependency in openjpa-lib
+    [OPENJPA-2833] - Upgrade to ASM 9
+    [OPENJPA-2835] - update to xbean-asm9 for Java16 support
+    [OPENJPA-2838] - Add a JUL LogFactory
+    [OPENJPA-2840] - Enable a light SPI for asm support in kernel module
 
-    [OPENJPA-2029] - Add PreparedQuery tests for non-sequential positional parameters support

[openjpa] 02/03: update docs for OpenJPA-3.2.0

Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit 361da251a9a42e97c3752b7c4bf8064d574eceb9
Author: Mark Struberg <st...@apache.org>
AuthorDate: Sat May 8 21:53:12 2021 +0200

    update docs for OpenJPA-3.2.0
---
 openjpa-project/src/doc/manual/jpa_overview_intro.xml | 4 ++--
 openjpa-project/src/doc/manual/manual.xml             | 2 +-
 openjpa-project/src/doc/manual/openjpa_intro.xml      | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/openjpa-project/src/doc/manual/jpa_overview_intro.xml b/openjpa-project/src/doc/manual/jpa_overview_intro.xml
index f5d9c9f..dfc77c2 100644
--- a/openjpa-project/src/doc/manual/jpa_overview_intro.xml
+++ b/openjpa-project/src/doc/manual/jpa_overview_intro.xml
@@ -35,9 +35,9 @@
             JPA
         </primary>
     </indexterm>
-The Java Persistence 2.0 API (JPA 2.0) is a specification
+The Java Persistence API (JPA) is a specification
 for the persistence of Java objects to any relational
-datastore. This document provides an overview of JPA 2.0. Unless
+datastore. This document provides an overview of JPA 2.2. Unless
 otherwise noted, the information presented applies to all JPA implementations.
     </para>
     <note>
diff --git a/openjpa-project/src/doc/manual/manual.xml b/openjpa-project/src/doc/manual/manual.xml
index 1feb96c..e462634 100644
--- a/openjpa-project/src/doc/manual/manual.xml
+++ b/openjpa-project/src/doc/manual/manual.xml
@@ -62,7 +62,7 @@
 ]>
 <book id="manual">
     <bookinfo>
-        <title>Apache OpenJPA 3.0 User's Guide</title>
+        <title>Apache OpenJPA 3.2 User's Guide</title>
         <copyright>
             <year>2006-2021</year>
             <holder>The Apache Software Foundation</holder>
diff --git a/openjpa-project/src/doc/manual/openjpa_intro.xml b/openjpa-project/src/doc/manual/openjpa_intro.xml
index 743a50a..d563ad1 100644
--- a/openjpa-project/src/doc/manual/openjpa_intro.xml
+++ b/openjpa-project/src/doc/manual/openjpa_intro.xml
@@ -27,8 +27,8 @@
         </primary>
     </indexterm>
     <para>
-OpenJPA is Apache's implementation of Java Persistence 2.0 API
-(JSR-317 JPA 2.0) specification for the transparent persistence of Java objects.
+OpenJPA is Apache's implementation of Java Persistence 2.2 API
+(JSR-338 JPA 2.2) specification for the transparent persistence of Java objects.
 This document provides an overview of the JPA standard and technical
 details on the use of OpenJPA.
     </para>

[openjpa] 03/03: OPENJPA-2873 add persistence_2_2.xsd handling

Posted by st...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

struberg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openjpa.git

commit f72f3ca7e07b539c2de3c31e3381e8f9c9216807
Author: Mark Struberg <st...@apache.org>
AuthorDate: Sat May 8 22:38:56 2021 +0200

    OPENJPA-2873 add persistence_2_2.xsd handling
---
 .../apache/openjpa/lib/meta/XMLVersionParser.java  |   1 +
 .../persistence/PersistenceProductDerivation.java  |  15 +-
 .../openjpa/persistence/persistence_2_2.xsd.rsrc   | 354 +++++++++++++++++++++
 openjpa-project/LICENSE                            |   2 +
 4 files changed, 367 insertions(+), 5 deletions(-)

diff --git a/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLVersionParser.java b/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLVersionParser.java
index 3d7584c..67e6f95 100644
--- a/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLVersionParser.java
+++ b/openjpa-lib/src/main/java/org/apache/openjpa/lib/meta/XMLVersionParser.java
@@ -32,6 +32,7 @@ public class XMLVersionParser extends XMLMetaDataParser {
     public static final String VERSION_1_0 = "1.0";
     public static final String VERSION_2_0 = "2.0";
     public static final String VERSION_2_1 = "2.1";
+    public static final String VERSION_2_2 = "2.2";
 
     static private final String VERSION_ATTR = "version";
     static private final String XSI_NS =
diff --git a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
index bca362c..b328593 100644
--- a/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
+++ b/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceProductDerivation.java
@@ -777,6 +777,7 @@ public class PersistenceProductDerivation
 
         private static final String PERSISTENCE_XSD_2_0 = "persistence_2_0.xsd";
         private static final String PERSISTENCE_XSD_2_1 = "persistence_2_1.xsd";
+        private static final String PERSISTENCE_XSD_2_2 = "persistence_2_2.xsd";
 
         private static final Localizer _loc = Localizer.forPackage
             (ConfigurationParser.class);
@@ -845,14 +846,18 @@ public class PersistenceProductDerivation
             // if the version and/or schema location is for 1.0, use the 1.0
             // schema
             if (XMLVersionParser.VERSION_2_0.equals(_persistenceVersion)
-                    || (_schemaLocation != null && _schemaLocation.indexOf(PERSISTENCE_XSD_2_0) != -1))
-            {
+                    || (_schemaLocation != null && _schemaLocation.indexOf(PERSISTENCE_XSD_2_0) != -1)) {
                 persistencexsd = "persistence_2_0-xsd.rsrc";
-            } else if (XMLVersionParser.VERSION_2_1.equals(_persistenceVersion)
-                    || (_schemaLocation != null && _schemaLocation.indexOf(PERSISTENCE_XSD_2_1) != -1))
-            {
+            }
+            else if (XMLVersionParser.VERSION_2_1.equals(_persistenceVersion)
+                    || (_schemaLocation != null && _schemaLocation.indexOf(PERSISTENCE_XSD_2_1) != -1)) {
                 persistencexsd = "persistence_2_1-xsd.rsrc";
             }
+            else if (XMLVersionParser.VERSION_2_2.equals(_persistenceVersion)
+                    || (_schemaLocation != null && _schemaLocation.indexOf(PERSISTENCE_XSD_2_2) != -1)) {
+                persistencexsd = "persistence_2_2-xsd.rsrc";
+            }
+
             return getClass().getResourceAsStream(persistencexsd);
         }
 
diff --git a/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/persistence_2_2.xsd.rsrc b/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/persistence_2_2.xsd.rsrc
new file mode 100644
index 0000000..0fab1c4
--- /dev/null
+++ b/openjpa-persistence/src/main/resources/org/apache/openjpa/persistence/persistence_2_2.xsd.rsrc
@@ -0,0 +1,354 @@
+<?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.2">
+
+  <xsd:annotation>
+    <xsd:documentation>
+      @(#)persistence_2_2.xsd 2.2  July 17, 2017
+    </xsd:documentation>
+  </xsd:annotation>
+
+  <xsd:annotation>
+    <xsd:documentation>
+
+  Copyright (c) 2008  - 2017 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.2, Version 2.2 (July 7, 2017)
+      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_2.xsd"
+        version="2.2">
+          ...
+      </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.2" 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/openjpa-project/LICENSE b/openjpa-project/LICENSE
index 0ee792d..260351e 100644
--- a/openjpa-project/LICENSE
+++ b/openjpa-project/LICENSE
@@ -427,6 +427,8 @@ The exceptions are as follows:
     http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd)
   persistence_2_1-xsd.rsrc - Eclipse Public License v1.0 - included in the openjpa jar, taken from:
     http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd).
+  persistence_2_2-xsd.rsrc - Eclipse Public License v1.0 - included in the openjpa jar, taken from:
+    http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/persistence/persistence_2_2.xsd).
   websphere-uow-api.jar - this jar file contains WebSphere proprietary
     API code which is licensed for use when compiling OpenJPA. The
     jar is not distributed with OpenJPA and is only included with the