# Strategy generationType.identity overriding

**URL:** <https://discourse.hibernate.org/t/strategy-generationtype-identity-overriding/1122>\
**Category:** Hibernate ORM\
**Created:** [July 26, 2018, 3:25pm UTC](https://discourse.hibernate.org/t/strategy-generationtype-identity-overriding/1122 "2018-07-26T15:25:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lew3r](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@Lew3r](https://discourse.hibernate.org/u/Lew3r)\
**Post date:** [July 26, 2018, 3:25pm UTC](https://discourse.hibernate.org/t/strategy-generationtype-identity-overriding/1122/1 "2018-07-26T15:25:05Z")

</div>

Is It possible to change the original overriding the generationType.identity with custom one?

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [July 26, 2018, 3:37pm UTC](https://discourse.hibernate.org/t/strategy-generationtype-identity-overriding/1122/2 "2018-07-26T15:37:49Z")

</div>

It’s not clear what you are asking. Try to elaborate the question with some examples.

---

<div class="post-metadata">

**Author:** ![Lew3r](https://avatars.discourse-cdn.com/v4/letter/l/c57346/32.png) [@Lew3r](https://discourse.hibernate.org/u/Lew3r)\
**Post date:** [July 26, 2018, 7:51pm UTC](https://discourse.hibernate.org/t/strategy-generationtype-identity-overriding/1122/3 "2018-07-26T19:51:25Z")

</div>

I want to create an Identity column that stores values as string instead of Number. The column must have incremental progressive numbers but in string format. I want modifier identity strategy

@GeneratedValue(strategy = “myStrategy”)

myStrategy is is the change of strategy = GenerationType.IDENTITY

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [July 26, 2018, 8:16pm UTC](https://discourse.hibernate.org/t/strategy-generationtype-identity-overriding/1122/4 "2018-07-26T20:16:07Z")

</div>

You can extend the Hibernate IdentityGenerator and return a String instead of a Number.

Check out [this article](https://vladmihalcea.com/how-to-combine-the-hibernate-assigned-generator-with-a-sequence-or-an-identity-column/) for am example of a custom IDENTITY generator.
