"HHH90000014: Found use of deprecated [org.hibernate.id.SequenceHiLoGenerator] sequence-based id generator" in Hibernate 5

Solution Verified - Updated -

Issue

  • Migrating from EAP 6 / Hibernate 4 to EAP 7 / Hibernate 5
  • A sequence is defined as follows

    SEQUENCE_NAME = employee_seq
    MIN_VALUE = 1
    MAX_VALUE = 999999999999999999999999999
    INCREMENT_BY = 1
    CYCLE_FLAG = 1
    ORDER_FLAG= 1
    CACHE_SIZE = 20
    
  • In Hibernate (legacy/non-JPA) mapping files, an ID generator is defined as follows:

    <id name="id" type="long" column="emp_id" access="field">
        <generator class="seqhilo">
            <param name="sequence">employee_seq</param>
            <param name="max_lo">100</param>
        </generator>
    </id>
    
  • Logs contain entries like the following

    HHH90000014: Found use of deprecated [org.hibernate.id.SequenceHiLoGenerator] sequence-based id generator; use org.hibernate.id.enhanced.SequenceStyleGenerator instead. See Hibernate Domain Model Mapping Guide for details.
    

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7
  • Hibernate 5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In