# Hibernate 6.2 strategy deprecated (strategy = "enhanced-sequence")

**URL:** <https://discourse.hibernate.org/t/hibernate-6-2-strategy-deprecated-strategy-enhanced-sequence/9178>\
**Category:** Hibernate ORM\
**Created:** [March 12, 2024, 10:58am UTC](https://discourse.hibernate.org/t/hibernate-6-2-strategy-deprecated-strategy-enhanced-sequence/9178 "2024-03-12T10:58:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yusuf\_bestas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/yusuf_bestas/32/3083_2.png) [@yusuf\_bestas](https://discourse.hibernate.org/u/yusuf_bestas)\
**Post date:** [March 12, 2024, 10:58am UTC](https://discourse.hibernate.org/t/hibernate-6-2-strategy-deprecated-strategy-enhanced-sequence/9178/1 "2024-03-12T10:58:58Z")

</div>

The hibernate 6.2 depreciated “strategy”. In our current code base we are using

```auto

@GenericGenerator(
        name = "sequenceGenerator",
        strategy = "enhanced-sequence",
        parameters = {
            @org.hibernate.annotations.Parameter(
                name = "optimizer",
                value = "pooled-lo"
            ),
            @org.hibernate.annotations.Parameter(
                name = "initial_value",
                value = "1"
            ),
            @org.hibernate.annotations.Parameter(
                name = "increment_size",
                value = "5"
            )
        }
    )

```

But I am not user how shall I replace it with new approach. And seems no clear documentation related it( at least I couldn’t find)

---

<div class="post-metadata">

**Author:** ![mbladel](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/mbladel/32/2128_2.png) [@mbladel](https://discourse.hibernate.org/u/mbladel)\
**Post date:** [March 13, 2024, 8:09am UTC](https://discourse.hibernate.org/t/hibernate-6-2-strategy-deprecated-strategy-enhanced-sequence/9178/2 "2024-03-13T08:09:50Z")

</div>

As specified in the deprecation javadoc, you should use the new annotation’s `type()` member for typesafety. In your case `type = SequenceStyleGenerator.class` will result in the same configuration you’re currently using.

---

<div class="post-metadata">

**Author:** ![yusuf\_bestas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/yusuf_bestas/32/3083_2.png) [@yusuf\_bestas](https://discourse.hibernate.org/u/yusuf_bestas)\
**Post date:** [May 10, 2024, 1:19pm UTC](https://discourse.hibernate.org/t/hibernate-6-2-strategy-deprecated-strategy-enhanced-sequence/9178/3 "2024-05-10T13:19:20Z")

</div>

Thank you mblabel.it is helped.
