# Hibernate 5 throws duplicate generator name XXX

**URL:** <https://discourse.hibernate.org/t/hibernate-5-throws-duplicate-generator-name-xxx/534>\
**Category:** Hibernate ORM\
**Created:** [April 11, 2018, 1:38pm UTC](https://discourse.hibernate.org/t/hibernate-5-throws-duplicate-generator-name-xxx/534 "2018-04-11T13:38:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxt47](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/zxt47/32/173_2.png) [@zxt47](https://discourse.hibernate.org/u/zxt47)\
**Post date:** [April 11, 2018, 1:38pm UTC](https://discourse.hibernate.org/t/hibernate-5-throws-duplicate-generator-name-xxx/534/1 "2018-04-11T13:38:12Z")

</div>

Dear Developer of Hibernate ORM，I have using Hibernate 5.0 to instead of Hibernate 4.13 in my spring Boot application,but i found something going to wrong，such as this problem，I have never seen this problem and the code have been run very well for 3 years。When I debug the program i found InFlightMetaadataCollectorImpl(the class which been implements InFlightMetadataCollector in org.hibernate.boot.internal) 445 columns(function:void addIdentifierGenerator(generator)) occured the problem，I want to know the generator in Hibernate 5 and then version must be unique?  
Thanks a lot to give me some help！

---

<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:** [April 11, 2018, 1:46pm UTC](https://discourse.hibernate.org/t/hibernate-5-throws-duplicate-generator-name-xxx/534/2 "2018-04-11T13:46:37Z")

</div>

That’s how JPA says generators should work. Previously, Hibernate allowed generators to use an entity scope. However, JPA says the scope should be global.

For more details, check out the [HHH-12454](https://hibernate.atlassian.net/browse/HHH-12454) Jira issue. We are going to add a configuration property to support the legacy mode.

---

<div class="post-metadata">

**Author:** ![zxt47](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/zxt47/32/173_2.png) [@zxt47](https://discourse.hibernate.org/u/zxt47)\
**Post date:** [April 11, 2018, 2:03pm UTC](https://discourse.hibernate.org/t/hibernate-5-throws-duplicate-generator-name-xxx/534/3 "2018-04-11T14:03:57Z")

</div>

okay，I know，I will notice the change in the future develop.Thanks!😃

---

<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:** [April 11, 2018, 2:04pm UTC](https://discourse.hibernate.org/t/hibernate-5-throws-duplicate-generator-name-xxx/534/4 "2018-04-11T14:04:54Z")

</div>

There is a Pull Request, so we will review it and hopefully it will be included in the next release.
