Release Notes for Apache OpenJPA 4.2.0
Overview
This is the release of Apache OpenJPA 4.2.0. This distribution implements
the Jakarta Persistence 3.2 specification. The Jakarta Persistence 3.2 TCK
is run weekly in CI on Java 21 against PostgreSQL, MySQL, MariaDB,
Microsoft SQL Server, Oracle and Apache Derby (on MySQL without the SEQUENCE tests, as MySQL has no sequences).
Additional information on the OpenJPA project may be found at the project
web site: https://openjpa.apache.org
Upgrade Notes
Some changes of this release alter the mapping or the behaviour of
existing applications. They are described in the Migration Considerations
of the reference
guide, together with the openjpa.Compatibility options that
restore the behaviour of OpenJPA 4.1.x where one exists.
- An
AttributeConverter that declares its attribute or
database type through a generic superclass or through an interface that
extends AttributeConverter now maps its attribute to a column
of the converter's database type. In 4.1.x the column followed the
attribute type, so such a serializable attribute was mapped as a serialized
object (a BLOB, BYTEA on PostgreSQL), and autoApply
was ignored. Such converters, and those of a parameterized attribute type,
are now applied when they are declared autoApply, so attributes
of their type get the converter and its column type. Applications with such
converters need to migrate the affected columns and their data, or set
openjpa.Compatibility=ResolveConverterTypeHierarchy=false to
restore the 4.1.x mapping for attributes whose converter declares its types
through a generic superclass or interface; the general converter changes
described in the Migration Considerations are not affected by this option
(OPENJPA-2944).
- MySQL and MariaDB: the dictionaries now know the words that MySQL
8.4 and 9.7 and MariaDB 10.11 and 12.3 reserve, such as
RANK,
WINDOW, LIMIT, DUAL or, on MariaDB,
OFFSET, and both delimit a table or column whose name is a
reserved word with back ticks instead of renaming it, so that its table can
be created. On MySQL a column that got a 0 appended, such as
LIMIT0, is now the delimited limit; on MariaDB,
which did not delimit before, this holds for every reserved word, e.g. a
column ORDER0 becomes order and a table
USER0 becomes User, and so do the names built
from such a name, such as default join tables and join columns, e.g.
ORDER0_ITEMS becomes Order_items. A delimited default table
name keeps the case of the entity name, e.g. Window instead of
WINDOW, which matters where table names are case sensitive. A
schema that still has the earlier names no longer matches; set
openjpa.Compatibility=UpdatedReservedWords=false
to restore the names generated before this change: on MariaDB the naming
of 4.1.x, apart from the other 4.2 changes to reserved words, and on MySQL
the names of the words added by this change (OPENJPA-3074).
- An attribute whose type (a class, record or interface) is not
java.io.Serializable and
that has no mapping annotation is now mapped as a basic attribute when a
@Converter(autoApply = true) is registered for its type, as
Jakarta Persistence 3.2 section 3.9 requires. In 4.1.x such an attribute
was left out of the mapping with only a warning and its value was not
stored. Applications with such attributes get a new column of the
converter's database type for each of them; set
openjpa.Compatibility=MapAutoApplyConvertedFields=false to
restore the 4.1.x mapping (OPENJPA-3073). Set the option in
persistence.xml, so that the enhancer sees it too, and enhance
build-time enhanced classes again after changing it.
- The JUnit extension
@OpenJPASupport moved from the
artifact openjpa-junit5 to openjpa-junit-jupiter
and from the package org.apache.openjpa.junit5 to
org.apache.openjpa.junit.jupiter. It works with JUnit 5 and 6,
and its JUnit dependencies are now provided.
Prerequisites
OpenJPA requires Java 17 or higher and a relational
database of some sort.
Documentation
The manual for this and older releases of OpenJPA is at
https://openjpa.apache.org/documentation.html
If you can't find what you are looking for in the manual or would like more
clarification, please post to the OpenJPA development mailing list.
Information on all of the OpenJPA mailing lists may be found here:
https://openjpa.apache.org/mailing-lists.html
Getting Involved
Contributions are welcome, for example:
- Source code and fixes contributions
- Documentation assistance
- Product and feature suggestions
- Detailed and constructive feedback
- Articles and whitepapers
How to contribute:
- To discuss Apache OpenJPA topics check out the mailing lists.
- Bugs and other issues can be posted on
the issue tracker.
License
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:
https://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.
The license may also be found in LICENSE.txt which is included
in each release of OpenJPA.
Notice
Copyright 2006,2026 The Apache Software Foundation
This product includes software developed at The Apache Software Foundation (http://www.apache.org/).
Apache OpenJPA includes the persistence and orm schemas from the JPA and Jakarta Persistence specifications:
- JPA 1.0 and 2.0 schemas: Copyright 2005-2009 Sun Microsystems, Inc. All rights reserved.
Apache OpenJPA elects to include these schemas under the CDDL license.
- JPA 2.1 and 2.2 schemas: Copyright (c) 2008-2017 Oracle Corporation. All rights reserved.
Licensed under the Eclipse Public License v1.0 and Eclipse Distribution License v1.0.
- Jakarta Persistence 3.0, 3.1 and 3.2 schemas: Copyright (c) Oracle and/or its affiliates. All rights reserved.
Licensed under the Eclipse Public License v2.0 or the Eclipse Distribution License v1.0
(SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause).
The complete list of notices can be found in NOTICE.txt included in each assembly.
Release Notes - OpenJPA - Version 4.2.0
Sub-task
- [OPENJPA-89] - Bulk delete fails to delete owned many-to-many relationship (entry remains in join table)
- [OPENJPA-254] - Bulk update did not work on an entity that is mapped to multiple tables
- [OPENJPA-2946] - Java Compiler Compiler Warnings need to be addressed
- [OPENJPA-2950] - Broadened auto-flush before every query hurts perf
- [OPENJPA-2951] - Full context flush after in-memory bulk update/delete
- [OPENJPA-2952] - Transient object wrongly assumed detached in flush check
- [OPENJPA-2953] - Embedded converter override leaks to shared embeddable meta
- [OPENJPA-2954] - Unsafe publication of cached AttributeConverter instance
- [OPENJPA-2955] - extractSchemaGenObjects mutates caller's properties map
- [OPENJPA-2956] - In-memory ID(), set ops and nullPrecedence unimplemented
- [OPENJPA-2957] - hasEmbeddableAnnotation relies on annotation simple name
- [OPENJPA-2958] - Direct access to ImplHelper._unenhancedInstanceMap
- [OPENJPA-2959] - dropExcludedTypeTables drops user tables with raw SQL
- [OPENJPA-2960] - NULLS FIRST/LAST string rewrite breaks on commas, triplicated
- [OPENJPA-2961] - TREAT discriminator filter excludes subclasses of target
- [OPENJPA-2962] - Schema-gen methods leak a Broker just to get classloader
- [OPENJPA-2963] - Static _droppedTables shared across concurrent EMFs
- [OPENJPA-2964] - Range ignored in executeSetOperatorQuery
- [OPENJPA-2965] - Bulk delete no longer cleans dependent/collection rows
- [OPENJPA-2966] - Long cast uses decimalTypeName instead of bigint
- [OPENJPA-2967] - VersionVal NPEs on surrogate or missing version
- [OPENJPA-2968] - IdClass paths swallow exceptions and rely on field order
- [OPENJPA-2969] - Instant.now() precision loss on DB round-trip
- [OPENJPA-2970] - Null named parameter falls through to positional lookup
- [OPENJPA-2971] - storeCharsAsNumbers default flip breaks existing schemas
- [OPENJPA-2973] - Converter instantiated reflectively, skips CDI and nulls
- [OPENJPA-2974] - String cache mode properties no longer converted to enum
- [OPENJPA-2975] - treat() join overloads silently cast without narrowing
- [OPENJPA-2976] - version 3.1 persistence.xml validated against 3.0 XSD
- [OPENJPA-2977] - convert() mutates caller config, ignores mappingFiles
- [OPENJPA-2978] - Typos, stray semicolon, and validate() masking unsupported
- [OPENJPA-2979] - getReference(entity) fails on composite ids
- [OPENJPA-2980] - addNamedQuery relabels criteria query as JPQL
- [OPENJPA-2981] - Dead access-type annotation helper methods
- [OPENJPA-2983] - Locale-sensitive toUpperCase on temporal field name
- [OPENJPA-2984] - Dropped non-Serializable IdClass warning
- [OPENJPA-2985] - Mandatory JPA 3.2 methods throw UnsupportedOperationException
- [OPENJPA-2986] - setTimeout(null) cannot clear a previously set query timeout
- [OPENJPA-2987] - Externalized-parameter tests reduced to no-op assertions
- [OPENJPA-2988] - LOCAL TIME test query is a tautology matching all rows
- [OPENJPA-2989] - Results always materialized, lazy ResultList behavior lost
- [OPENJPA-2990] - Bulk delete no longer cleans join-table rows
- [OPENJPA-2991] - Deeply nested multiselect extension now rejected
- [OPENJPA-2992] - Non-entity classes in persistence.xml silently skipped
- [OPENJPA-2993] - Renamed getaXxx accessors drop JavaBeans naming coverage
- [OPENJPA-2994] - Map-key column default KEY0 to entityCs_KEY breaks upgrades
- [OPENJPA-2995] - assertSQL now ignores identifier delimiters suite-wide
- [OPENJPA-2996] - testNotLoadedLazy duplicates eager check, lazy path untested
- [OPENJPA-2998] - MariaDB branch accepts either message without naming versions
- [OPENJPA-2999] - Leftover [2024] bracket and stale CDDL sentence vs EFSL 1.1
- [OPENJPA-3005] - Use jakarta.persistence.PersistenceUnitTransactionType internally instead of the deprecated SPI enum
- [OPENJPA-3029] - Derby: EXTRACT is not supported
- [OPENJPA-3030] - Derby: LEFT and RIGHT are not supported
- [OPENJPA-3031] - Derby: CAST(? AS VARCHAR) without a length
- [OPENJPA-3032] - StoredProcedureQuery tests fail on Derby and SQL Server
- [OPENJPA-3033] - Derby: basic type, generator and numeric result type tests fail
- [OPENJPA-3034] - Tests failing on several databases: sequence generator, timestamp, scalar expressions, mixed access
- [OPENJPA-3035] - MySQL: numeric operations return Long where Integer is expected
- [OPENJPA-3036] - MySQL: bulk UPDATE with a subquery on the same table
- [OPENJPA-3037] - MySQL: EXTRACT(WEEK) returns a different week
- [OPENJPA-3038] - MySQL: mapping, order column and map key tests fail
- [OPENJPA-3039] - Derby: JPQL comparison of two parameters fails
- [OPENJPA-3040] - Criteria parameter used only in the select list is not registered
- [OPENJPA-3041] - H2: EXTRACT(SECOND) drops fractional seconds
- [OPENJPA-3042] - In-memory EXTRACT(WEEK) returns the day of the week
- [OPENJPA-3044] - JPQL does not accept a sign in front of a path, e.g. SELECT -n.intA
- [OPENJPA-3046] - Criteria parameter used only in a join ON condition is not registered
- [OPENJPA-3047] - Bulk UPDATE of a column in a joined superclass or a secondary table fails on Derby and H2
- [OPENJPA-3048] - JDBC escape date literal is not converted when a query is evaluated in memory
- [OPENJPA-3049] - JPQL arithmetic ranks BigDecimal above Double, unlike the numeric promotion of the specification
- [OPENJPA-3066] - setParameter(Parameter, Calendar, TemporalType) ignores the TemporalType
- [OPENJPA-3067] - EXTRACT(WEEK) is not supported on Derby
Bug
- [OPENJPA-18] - bulk update to Entity with secondary table mapping produces BAD SQL
- [OPENJPA-26] - JPQL parser failed to handle unary operations in arithmetic comparisons, eg. where -(e.salary+10) > -10
- [OPENJPA-221] - DerbyDictionary doesn't describe a working mapping for char fields.
- [OPENJPA-223] - columnNames field of @Index annotation is ignored
- [OPENJPA-603] - Schema Tool discards the size of decimal column
- [OPENJPA-1145] - Reserved keywords in the DBDictionary isn't being used for table names
- [OPENJPA-1698] - SchemaAction=deleteTableContents throws error if table doesn't exist
- [OPENJPA-2185] - Exception when @SequenceGenerator is used with DerbyDB
- [OPENJPA-2186] - Sequences are not removed in DerbyDB
- [OPENJPA-2364] - Slices: Bulk JPQL Deletes/Updates ignoring Target plugins and query hints.
- [OPENJPA-2496] - Sequence Objects not working in MS SQL 2012
- [OPENJPA-2590] - PersistenceUnitUtil#getIdentifier should return id's value
- [OPENJPA-2837] - HerdDBDictionary does not work with 'native' SchemaFactory (LazySchemaFactory) - set useSchemaName=false by default
- [OPENJPA-2844] - Unable to call getProperties on EnitityManagerFactory before createEntityManager is called.
- [OPENJPA-2847] - CriteriaUpdate/CriteriaDelete are not implemented
- [OPENJPA-2879] - Regression in Column.isCompatible
- [OPENJPA-2880] - NPE in StoredProcedureQueryImpl
- [OPENJPA-2888] - commons-dbcp2 bundle version defined in karaf features repository is not aligned with the actual version used by openjpa
- [OPENJPA-2929] - Filling inverse FK columns is broken for compound keys
- [OPENJPA-2931] - Comparing objects with composite keys through criteria API doesn't work in joins
- [OPENJPA-2935] - Timestamp + coalesce + orderBy + Postgres makes Postgres syntax errors
- [OPENJPA-2937] - UUID Generator
- [OPENJPA-2938] - Certain combination of ConnectionProperties can lead to NPE
- [OPENJPA-2939] - Fix metamodel generation and XML/Json conversion when entity has an UUID property
- [OPENJPA-2942] - Java8TimeTypesTest is broken at CI (H2)
- [OPENJPA-2943] - MySQLDictionary.decorate() is out of date with MySQL Driver Changes
- [OPENJPA-2944] - Inconsistent column type conversion when using AttributeConverter
- [OPENJPA-3001] - MySQL TCK: char field insert truncated on CHAR column
- [OPENJPA-3002] - Column names specified at @Index annotation silently ignored
- [OPENJPA-3006] - EntityManagerFactory.getProperties() is not usable as configuration input
- [OPENJPA-3008] - H2 test profile loses committed data when H2 closes the database between EntityManagerFactories
- [OPENJPA-3009] - JPQL LIKE with an escaped wildcard matches only on Derby
- [OPENJPA-3010] - Bulk delete and map key tests assert Derby-shaped SQL and fail on MySQL
- [OPENJPA-3012] - memory leak in Serialization
- [OPENJPA-3014] - A named @SequenceGenerator fails where the database has no sequences
- [OPENJPA-3016] - Criteria tests fail on MariaDB and exhaust the connection pool; TestPessimisticLocks fails on PostgreSQL
- [OPENJPA-3017] - @Convert on a collection attribute is ignored and the attribute is silently not persisted
- [OPENJPA-3018] - Size appended to a JSON or JSONB column definition on PostgreSQL, MySQL and MariaDB
- [OPENJPA-3019] - In-place change to an element of a collection converted as a whole is not written
- [OPENJPA-3020] - @Lob with an AttributeConverter uses the attribute type instead of the converter database type
- [OPENJPA-3021] - A converted attribute value is replaced by a bean proxy that loses state without a setter
- [OPENJPA-3022] - Loading a field of an instance with unflushed changes stores those changes in the data cache
- [OPENJPA-3023] - The data cache shares the value of a converted attribute between persistence contexts
- [OPENJPA-3024] - An element removed from a collection with orphanRemoval and cascade remove is not deleted
- [OPENJPA-3025] - orphan-removal in an XML mapping is lost when the relation also cascades remove
- [OPENJPA-3026] - Build fails under Windows
- [OPENJPA-3043] - A parameter used twice with another parameter in between is bound at the wrong position from the query cache
- [OPENJPA-3050] - In-memory arithmetic treats NULL as 0
- [OPENJPA-3051] - H2: a BigDecimal column is created with scale 0
- [OPENJPA-3052] - Documentation need to be improved
- [OPENJPA-3054] - OSGi/Karaf packaging is broken after the switch to the Jakarta namespace
- [OPENJPA-3055] - EXTRACT(SECOND) lost the fraction (all MySQL and MariaDB jobs)
- [OPENJPA-3056] - Bulk DELETE with a subquery on the target table fails on MariaDB before 11.1 (error 1093)
- [OPENJPA-3057] - Slice target hint and QueryTargetPolicy are ignored by bulk UPDATE and native bulk statements
- [OPENJPA-3058] - H2: a BigInteger column is created as BIGINT
- [OPENJPA-3059] - It is impossible to specify bind address for TCPRemoteCommitProvider
- [OPENJPA-3060] - MariaDB: StoreCharsAsNumbers still defaults to true
- [OPENJPA-3061] - MariaDB: writing a Reader into a CLOB fails with ArrayIndexOutOfBoundsException
- [OPENJPA-3062] - MySQL and MariaDB: a decimal column without a precision rounds values to integers
- [OPENJPA-3063] - HSQLDB: LOB type of converted attributes, decimal scale, CASE padding and EXTRACT of a parameter fail
- [OPENJPA-3064] - SQL Server: decimal scale, EXTRACT(SECOND/WEEK), current local time and shared test tables fail
- [OPENJPA-3065] - Enhancer runs into ConcurrentModificationException if run in Maven with -C
- [OPENJPA-3070] - String values written as SQL literals do not always reach the database unchanged
- [OPENJPA-3073] - Attribute of a non-Serializable type converted only by an autoApply converter is silently left out of the mapping
- [OPENJPA-3075] - Derby: default table and sequence names Derby rejects, such as those of entities or sequence generators named Window, Order or User, are used unquoted, and WINDOW, CURSORS and other words Derby reserves are not known to the dictionary
- [OPENJPA-3076] - With persistence units for MySQL or MariaDB and for another database in one JVM, the dictionary configured last decides which reserved words are delimited for all of them
- [OPENJPA-3077] - 'test-dynamic-enhancer' profile is broken; the dynamic enhancement agent did not attach itself on JDK 9 and later
- [OPENJPA-3079] - Default index name contains the delimiters of a delimited column name
- [OPENJPA-3081] - EntityManagerFactory.getMetamodel() fails for unenhanced entities until the first EntityManager is created
Improvement
- [OPENJPA-897] - OpenJPA Documentaion should provide better navigation
- [OPENJPA-1346] - ClassNotFoundException in org.apache.openjpa.datacache.Caches.addTypesByName
- [OPENJPA-1817] - JPQL doens't support ORDER BY UPPER(fieldname)
- [OPENJPA-2219] - warn if a "class" listed in persistence unit is an enum and ignore it in mappings
- [OPENJPA-2940] - Implement Jakarta Persistence 3.2
- [OPENJPA-2941] - H2 should be upgraded to v2
- [OPENJPA-3007] - Junit6 should be used for tests
- [OPENJPA-3011] - Run the MySQL, MariaDB and PostgreSQL profiles on a schedule in CI
- [OPENJPA-3013] - Collect the deserialization candidate loaders without a MultiClassLoader
- [OPENJPA-3015] - Mail the dev list when a GitHub Actions run fails
- [OPENJPA-3053] - Set rule to automatically drop merged branches
- [OPENJPA-3071] - Resolve type names of remote commit events through the metadata repository
- [OPENJPA-3072] - TCPRemoteCommitProvider: only accept connections from the configured peers and limit receiving connections
- [OPENJPA-3074] - Share the common code of MySQLDictionary and MariaDBDictionary in a superclass and add the MySQL 8 reserved words
Task
- [OPENJPA-3003] - Dependencies should be up-to-date
- [OPENJPA-3027] - Test the scheduled Databases job against supported database versions
- [OPENJPA-3068] - Update RELEASE-NOTES.html for 4.2.0
- [OPENJPA-3069] - Fix license headers, NOTICE and RAT exclusions for the ATR release checks
- [OPENJPA-3082] - Document the release process, including Apache Trusted Releases (ATR)
- [OPENJPA-3083] - Build the aggregated javadoc for the binary distribution and the website
- [OPENJPA-3084] - Update CHANGES.txt and the release notes for 4.2.0
Test
- [OPENJPA-3045] - TestPessimisticLocks fails on PostgreSQL because a query with OFFSET has no ORDER BY
Epic
- [OPENJPA-2945] - Multiple issues found due to Jakarta Persistence 3.2 implementation need to be addressed
- [OPENJPA-3028] - Jakarta Persistence 3.2 TCK failures on Derby, MySQL and SQL Server
Previous Releases
Release notes for earlier releases of OpenJPA:
Copyright (C) 2006,2026 Apache Software Foundation. Licensed under Apache License 2.0.
Apache, the Apache feather logo and OpenJPA are trademarks of Apache Software Foundation.