4.0.0-M2 Release #1019
gavinking
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Jakarta Persistence 4.0 Milestone 2
Specification draft: jakarta-persistence-spec-4.0-M2.pdf
Maven central: https://central.sonatype.com/artifact/jakarta.persistence/jakarta.persistence-api/4.0.0-M2
Announcement: https://in.relation.to/2026/04/23/JPA-4-M2/
Changelog
Changes to API
Expanded the criteria and metamodel type systems with specialized expression types
ComparableExpression,NumericExpression,TextExpression,TemporalExpression, andBooleanExpression, plus matching metamodel attribute types such asComparableAttribute,NumericAttribute,TextAttribute,TemporalAttribute, andBooleanAttribute.Added criteria builder operations accepting JPQL query strings and returning corresponding criteria objects.
Added
FetchOption,AttributeNode.addOption(), andBatchSizeto improve expressivity of entity graphs.Extended flush control with
QueryFlushMode,Query.setQueryFlushMode(),flushmembers on@NamedQueryand@NamedNativeQuery, andFlushModeType.EXPLICIT.Completed the query or statement split by introducing
StatementOrTypedQueryas the bridge type returned from string-based query factory methods.Added
@EntityListener,Allow an entity listener to declared multiple callback methods of the same type.
Formalized metadata discovery by adding
@Discoverable, and allowed named queries and named statements to bedeclared in package and module descriptors.
Consolidated static query metadata by replacing
@ReadQueryOptionsand@WriteQueryOptionswith@StaticQueryOptions.Allow
@EntityResult,@ColumnResult, and@ConstructorResultto be placed on a@StaticNativeQuerymethod.Improved
@Indexso generated DDL can be customized more precisely.Reworked the named entity graph helper annotations into nested forms:
@NamedEntityGraph.AttributeNodeand@NamedEntityGraph.Subgraph.Allow use of
@MapsIdwith@IdClassChanges to the specification
Substantially clarified derived identity and and
@MapsId.Specified that a null collection-valued persistent attribute is interpreted as an empty collection, and that a provider may replace a null collection with an empty collection instance.
Specified that changes to owned collections and owned associations trigger entity lifecycle callbacks, while changes affecting only unowned associations do not.
Clarified behavior when duplicate persistent field names occur in an inheritance hierarchy.
Clarified that
@OrderColumnand@MapKeyColumnare for owned collections, and should not be used on the unowned side identified bymappedBy.Tightened the documentation around
mappedBy, including dot-notation cases involving embedded attributes.Clarified that criteria comparison operations such as
lt()andgt()accept heterogeneous but comparable arguments.Beta Was this translation helpful? Give feedback.
All reactions