Remove EE7 (JPA) mode: default to (EE8) JPA 2.2 spec jar, Hibernate ORM 5.3.x

In  jpa

Overview

Enable the JPA 2.2 spec jar by default.

Default to Hibernate ORM 5.3.x and matching dependencies.

Remove the ee8.preview.mode flag checks in JPA related code.

Default to Hibernate Search upgrade (5.10.8), which in turn implies newer Apache Lucene (5.5.*) .

Compatibility analysis of Hibernate ORM (from 5.1 to 5.3) (from WFLY-6464_JPA_22_HibernateUpgrade.adoc):

Compatibility analysis of Hibernate Search (from WFLY-6464_JPA_22_HibernateUpgrade.adoc):

Compatibility analysis of the new Lucene version (from WFLY-6464_JPA_22_HibernateUpgrade.adoc):

Compatibility Transformer requirements:

A compatibility transformer needs to be added to address Hibernate ORM 5.3 API methods that are no longer (api) compatible with 5.1.
  • Change calls to org.hibernate.BasicQueryContract.getFlushMode() to instead call BasicQueryContract.getHibernateFlushMode().

  • Change calls to org.hibernate.Session.getFlushMode, to instead call Session.getHibernateFlushMode()

  • App References to Enum org.hibernate.FlushMode.NEVER (0) should be transformed to reference FlushMode.MANUAL (0) instead.

  • For calls to org.hibernate.Query.getMaxResults() returning Integer, instead call org.hibernate.Query.getHibernateMaxResults() (returning Integer).

  • For calls to org.hibernate.Query.setMaxResults(int), instead call org.hibernate.Query.setHibernateMaxResults(int).

  • For calls to org.hibernate.Query.getFirstResult(int) returning Integer, instead call org.hibernate.Query.getHibernateFirstResult() (returning Integer).

  • For calls to org.hibernate.Query.setFirstResult(int), instead call org.hibernate.Query.setHibernateFirstResult(int).

Issue Metadata

Issue

Dev Contacts

QE Contacts

mailto:{Martin Simka}[{msimka@redhat.com}]

Affected Projects or Components

Hibernate ORM team needs to complete preparing ORM 5.3.x, which includes completing documentation.

WildFly transformer for ORM 5.1 compatibility, needs to be completed and documented.

WildFly JPA documentation needs to be updated.

QE needs to complete testing of ORM 5.3.

Other Interested Projects

Infinispan project provides the 2nd Level Cache components.

Requirements

  • Include JPA 2.2, Hibernate ORM 5.3+, Hibernate Search 5.10+ and have them automatically enabled by default.

  • Binary API backward compatibility with Hibernate 5.1

  • Include access to a Hibernate ORM 5.1 bytecode transformer

    • Transformer provides ORM 5.1 API compatibility, where possible, by transforming the Hibernate native 5.1 API calls, into the correct ORM 5.3 calls.

    • Does not guarantee to solve behaviour changes between ORM 5.1 and 5.3.

    • The transformer can be enabled via system property Hibernate51CompatibilityTransformer (set to true).

      • Only should be enabled for application servers that have no Hibernate ORM 5.3 native applications deployed, as all calls to org.hibernate.Query.setFirstResult (or #setMaxResults), will be transformed, as if the application is ORM 5.1 based.

        • This particular transformation can be disabled by setting Hibernate51CompatibilityTransformer.disableAmbiguousChanges (to true).

        • JPA applications are not transformed.

Hard Requirements

Remove EE 7 JPA related artifacts (JPA 2.1 spec jar, Hibernate ORM 5.1.x, Hibernate Search 5.5.*.

Test Plan

WildFly testsuite will run with Hibernate ORM 5.3.