-
Sub-task
-
Resolution: Done
-
Major
-
None
-
None
-
None
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 Target set to
<targetTechnology id="eap" versionRange="[7,8)" />
5.2 migration notes: "In Hibernate 4.3, dialect implementations that did not support a limit offset would fetch all rows for a query and
perform pagination in-memory. This solution, while functional, could have severe performance penalties. In 5.x, we preferred to favor performance optimizations which meant dialect implementations would throw an exception if a
limit offset was specified but the dialect didn't support such syntax.
As of 5.2.5.Final, we have introduced a new setting, `hibernate.legacy_limit_handler`, that is designed to allow users to enable the legacy 4.3 limit handler behavior. By default, this setting is false."
Windup rule:
When: if the dialect class is assignable to Cache71Dialect, DB2390Dialect, InformixDialect, IngresDialect, RDMSOS2200Dialect, SQLServerDialect, TimesTenDialect, and the dialect class does not override the method, Dialect.getLimitHandler() to support a limit offset, then hibernate will thrown UnsupportedOperationException if a limit offset is used (e.g., org.hibernate.Query.setFirstResult(int), org.hibernate.Criteria.setFirstResult(int), javax.persistence.Query.setFirstResult(int)
Perform: set hibernate.legacy_limit_handler=true