We're updating the issue view to help you get more done. 

Fix unintended binary compatibility breaks between 5.1 and 5.3

Description

Re-add the following (really "pull up" from CommonQueryContract):

1 2 3 4 5 6 7 org.hibernate.BasicQueryContract.setCacheable ( boolean p1 ) [abstract] : BasicQueryContract org.hibernate.BasicQueryContract.setCacheMode ( CacheMode p1 ) [abstract] : BasicQueryContract org.hibernate.BasicQueryContract.setCacheRegion ( String p1 ) [abstract] : BasicQueryContract org.hibernate.BasicQueryContract.setFetchSize ( int p1 ) [abstract] : BasicQueryContract org.hibernate.BasicQueryContract.setFlushMode ( FlushMode p1 ) [abstract] : BasicQueryContract org.hibernate.BasicQueryContract.setReadOnly ( boolean p1 ) [abstract] : BasicQueryContract org.hibernate.BasicQueryContract.setTimeout ( int p1 ) [abstract] : BasicQueryContract

Re-add:

1 org.hibernate.cfg.Settings.isStrictJPAQLCompliance ( )

Can simply be default delegating to settings.getJpaCompliance().isJpaQueryComplianceEnabled()


The following were changed to implement AutoCloseable rather than Closeable. The inheritance here is a bit unexpected (imo) - Closeable extends AutoCloseable, rather than the other way around. Although it generally should not matter (generally this is intended for use in try-with-resources), its not difficult to add back the binary compat by having these extend Closeable. In addition to AutoCloseable, or instead of? Extending AutoCloseable is unnecessary, but imo bettter documenting of the intention.

1 2 3 4 org.hibernate.ScrollableResults org.hibernate.Session org.hibernate.StatelessSession org.hibernate.engine.HibernateIterator

1 org.hibernate.jpa.HibernateEntityManagerFactory.getEntityManagerFactoryName ( ) [abstract] : String

Was removed without being properly deprecated. Unfortunately its meaning and implementation are no longer relevant/meaningful. Best course of action is to:

  1. Re-introduce the method in 5.3

  2. Deprecate this re-added method

  3. Define this method as a default delegating to grab the name out of the EMF properties


Re-add:

1 2 3 4 5 6 7 org.hibernate.metadata.ClassMetadata.getIdentifier ( Object p1, SessionImplementor p2 ) [abstract] : Serializable org.hibernate.metadata.ClassMetadata.getPropertyValuesToInsert ( Object p1, Map p2, SessionImplementor p3 ) [abstract] : Object[ ] org.hibernate.metadata.ClassMetadata.instantiate ( Serializable p1, SessionImplementor p2 ) [abstract] : Object org.hibernate.metadata.ClassMetadata.setIdentifier ( Object p1, Serializable p2, SessionImplementor p3 ) [abstract] : void org.hibernate.procedure: ProcedureCallMemento.makeProcedureCall ( Session p1 ) [abstract] : ProcedureCall org.hibernate.procedure: ProcedureCallMemento.makeProcedureCall ( SessionImplementor p1 ) [abstract] : ProcedureCall

All can be defaulted to delegate to the forms accepting SharedSessionContractImplementor.


1 org.hibernate.Session.createFilter ( Object p1, String p2 ) [abstract] : org.hibernate.Query

In either 5.2 or 5.3 this changed to return org.hibernate.query.Query - Change this back to org.hibernate.Query.


1 2 3 4 5 6 7 8 9 10 11 12 org.hibernate.SQLQuery.addEntity ( Class p1 ) [abstract] : SQLQuery org.hibernate.SQLQuery.addEntity ( String p1 ) [abstract] : SQLQuery org.hibernate.SQLQuery.addEntity ( String p1, Class p2 ) [abstract] : SQLQuery org.hibernate.SQLQuery.addEntity ( String p1, Class p2, LockMode p3 ) [abstract] : SQLQuery org.hibernate.SQLQuery.addEntity ( String p1, String p2 ) [abstract] : SQLQuery org.hibernate.SQLQuery.addEntity ( String p1, String p2, LockMode p3 ) [abstract] : SQLQuery org.hibernate.SQLQuery.addJoin ( String p1, String p2 ) [abstract] : SQLQuery org.hibernate.SQLQuery.addJoin ( String p1, String p2, LockMode p3 ) [abstract] : SQLQuery org.hibernate.SQLQuery.addJoin ( String p1, String p2, String p3 ) [abstract] : SQLQuery org.hibernate.SQLQuery.addScalar ( String p1 ) [abstract] : SQLQuery org.hibernate.SQLQuery.addScalar ( String p1, Type p2 ) [abstract] : SQLQuery org.hibernate.SQLQuery.setResultSetMapping ( String p1 ) [abstract] : SQLQuery

All changed in either 5.2 or 5.3 to return org.hibernate.query.NativeQuery (the replacement for the deprecated org.hibernate.SQLQuery) rather than org.hibernate.SQLQuery. This should be reverted to return org.hibernate.SQLQuery instead, though returning T (as in org.hibernate.SQLQuery<T extends org.hibernate.SQLQuery>)


1 SharedSessionContract.createSQLQuery(String p1) [abstract] : org.hibernate.SQLQuery

In 5.1 this method returns org.hibernate.SQLQuery. In 5.3 it returns org.hibernate.query.NativeQuery via QueryProducer covariant. This should be reverted


1 SharedSessionContract.createQuery(String p1) [abstract] : org.hibernate.Query

In 5.1 returns org.hibernate.Query. In 5.3 it returns org.hibernate.query.Query via QueryProducer covariant. This should be reverted.


org.hibernate.jpa.AvailableSettings#JPA_METAMODEL_POPULATION accidentally got removed (more correctly, moved - org.hibernate.cfg.AvailableSettings instead)

Environment

None

Status

Assignee

Steve Ebersole

Reporter

Steve Ebersole

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major