Uploaded image for project: 'WINDUPRULE - Red Hat Application Migration Toolkit rules'
  1. WINDUPRULE - Red Hat Application Migration Toolkit rules
  2. WINDUPRULE-368 EAP 7.2 Migration: Hibernate ORM 5.1 to Hibernate ORM 5.3 App Migration
  3. WINDUPRULE-376

EAP 7.2 Migration: Hibernate ORM 5.1 to Hibernate ORM 5.3 App Migration - Method changes that can be dealt with by the Compatibility Transformer

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • Sprint 63, Sprint 64

      Documentation (preview) about the[ issue:|https://doc-stage.usersys.redhat.com/documentation/en-us/jboss_enterprise_application_platform_continuous_delivery/14/html-single/migration_guide/#migrating_from_hibernate_5_1_to_5_3
      ]

      An abstract (yet working) Hibernate 5.3 PoC rule may be found at https://github.com/emmartins/windup-rulesets/blob/WINDUPRULE-372/rules-reviewed/eap7/eap71/hibernate51-53.windup.xml , which should be broken into multiple rules targeting each concrete Hibernate 5.3 migration issue at https://github.com/hibernate/hibernate-orm/blob/5.3/migration-guide.adoc

      Note the example rule reference above should have the EAP Traget set to
      <targetTechnology id="eap" versionRange="[7,8)" />

      New rules specification, provided by Gail Badner

      There were some API changes that can be dealt with using the compatibility transformer (documented in 5.7.5.2. Compatibility Transformer). The tool will automatically change 5.1 methods to be compatible with 5.3. In addition, the log from the run will indicate the changes that the compatibility tool made, so that an application built with Hibernate ORM 5.0/5.1 in EAP 7.0/7.1 is made compatible with 5.3 in EAP 7.2. Information from the log can be used to manually make the same changes.

      See the table in 5.7.5.2. for affected methods.

      There is some information missing from that table. User types that are implemented by an application will need to be updated either by the compatibility transformer or manually.

      Implementations and references to the following methods need to have org.hibernate.engine.spi.SessionImplementor parameter changed to org.hibernate.engine.spi.SharedSessionContractImplementor:

      org.hibernate.usertype.UserType.nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner)
      org.hibernate.usertype.UserType.nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session)
      org.hibernate.usertype.CompositeUserType.nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner)
      org.hibernate.usertype.CompositeUserType.nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session)
      org.hibernate.usertype.CompositeUserType.assemble(Serializable cached, SessionImplementor session, Object owner)
      org.hibernate.usertype.CompositeUserType.disassemble(Object value, SessionImplementor session)
      org.hibernate.usertype.CompositeUserType.replace(Object original, Object target, SessionImplementor session, Object owner)
      org.hibernate.usertype.UserCollectionType.instantiate(SessionImplementor session, CollectionPersister persister)
      org.hibernate.usertype.UserCollectionType.replaceElements(Object original, Object target, CollectionPersister persister, Object owner, Map copyCache, SessionImplementor session)
      org.hibernate.usertype.UserCollectionType.wrap(SessionImplementor session, Object collection)
      org.hibernate.usertype.UserVersionType.seed(SessionImplementor session)
      org.hibernate.usertype.UserVersionType.next(Object current, SessionImplementor session)
      org.hibernate.type.Type.assemble(Serializable cached, SessionImplementor session, Object owner)
      org.hibernate.type.Type.disassemble(Object value, SessionImplementor session, Object owner)
      org.hibernate.type.Type.beforeAssemble(Serializable cached, SessionImplementor session)
      org.hibernate.type.Type.hydrate(ResultSet rs, String[] names, SessionImplementor session, Object owner)
      org.hibernate.type.Type.isDirty(Object old, Object current, SessionImplementor session)
      org.hibernate.type.Type.isDirty(Object oldState, Object currentState, boolean[] checkable, SessionImplementor session)
      org.hibernate.type.Type.isModified(Object dbState, Object currentState, boolean[] checkable, SessionImplementor session)
      org.hibernate.type.Type.nullSafeGet(ResultSet rs, String[] names, SessionImplementor session, Object owner)
      org.hibernate.type.Type.nullSafeGet(ResultSet rs, String name, SessionImplementor session, Object owner)
      org.hibernate.type.Type.nullSafeSet(PreparedStatement st, Object value, int index, boolean[] settable, SessionImplementor session)
      org.hibernate.type.Type.nullSafeSet(PreparedStatement st, Object value, int index, SessionImplementor session)
      org.hibernate.type.Type.replace(Object original, Object target, SessionImplementor session, Object owner, Map copyCache)
      org.hibernate.type.Type.replace(Object original, Object target, SessionImplementor session, Object owner, Map copyCache, ForeignKeyDirection foreignKeyDirection)
      org.hibernate.type.Type.resolve(Object value, SessionImplementor session, Object owner)
      org.hibernate.type.Type.semiResolve(Object value, SessionImplementor session, Object owner)
      org.hibernate.type.SingleColumnType.nullSafeGet(ResultSet rs, String name, SessionImplementor session)
      org.hibernate.type.SingleColumnType.get(ResultSet rs, String name, SessionImplementor session)
      org.hibernate.type.SingleColumnType.set(PreparedStatement st, T value, int index, SessionImplementor session)
      org.hibernate.type.AbstractStandardBasicType.get(ResultSet rs, String name, SessionImplementor session)
      org.hibernate.type.AbstractStandardBasicType.set(PreparedStatement st, T value, int index, SessionImplementor session)
      org.hibernate.type.AbstractStandardBasicType.nullSafeGet( ???? ) TODO: which method???
      org.hibernate.type.ProcedureParameterExtractionAware.extract(CallableStatement statement, int startIndex, SessionImplementor session)
      org.hibernate.type.ProcedureParameterExtractionAware.extract(CallableStatement statement, String[] paramNames, SessionImplementor session)
      org.hibernate.type.ProcedureParameterNamedBinder.nullSafeSet(CallableStatement statement, Object value, String name, SessionImplementor session)
      org.hibernate.type.VersionType.seed(SessionImplementor session)
      org.hibernate.type.VersionType.next(T current, SessionImplementor session)
      org.hibernate.collection.spi.PersistentCollection.unsetSession(SessionImplementor currentSession)
      org.hibernate.collection.spi.PersistentCollection.setCurrentSession(SessionImplementor session)

      ------------------------------

            mrizzi@redhat.com Marco Rizzi
            pcattana Philip Cattanach
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: