Uploaded image for project: 'Hibernate ORM'
  1. HHH-12424

Fix unintended binary compatibility breaks between 5.1 and 5.3

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.3.0.CR2
    • Component/s: None
    • Labels:
      None
    • Last commented by a user?:
      true

      Description

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

      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:

      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.

      org.hibernate.ScrollableResults
      org.hibernate.Session
      org.hibernate.StatelessSession
      org.hibernate.engine.HibernateIterator
      

      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:

      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.


      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.


      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>)


      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


      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)

        Attachments

          Issue links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: