# DefaultDiscriminatorConverter with hashcode to ROLE (DTYPE)

**URL:** <https://discourse.hibernate.org/t/defaultdiscriminatorconverter-with-hashcode-to-role-dtype/9366>\
**Category:** Hibernate ORM\
**Created:** [April 16, 2024, 7:31am UTC](https://discourse.hibernate.org/t/defaultdiscriminatorconverter-with-hashcode-to-role-dtype/9366 "2024-04-16T07:31:32Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![boutss](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/boutss/32/1543_2.png) [@boutss](https://discourse.hibernate.org/u/boutss)\
**Post date:** [April 17, 2024, 7:08am UTC](https://discourse.hibernate.org/t/defaultdiscriminatorconverter-with-hashcode-to-role-dtype/9366/11 "2024-04-17T07:08:56Z")

</div>

So there are two differences :

- the first is that I don’t know the exhaustive list of referenced types
- the second is that some types are only known at runtime (defined in another JAR).

I had implemented this solution → [Lots of @AnyDiscriminatorValue - Hibernate ORM - Hibernate](https://discourse.hibernate.org/t/lots-of-anydiscriminatorvalue/7306) to solve these two problems.

Which I was able to eliminate with the implementation of DefaultDiscriminatorConverter → [HHH-16339 - Consolidate DiscriminatorType, DiscriminatorMetadata, MetadataTpe by sebersole · Pull Request #6286 · hibernate/hibernate-orm (github.com)](https://github.com/hibernate/hibernate-orm/pull/6286)

However, the hashCode of the roles still needed to be resolved.

---

_[View the full topic](https://discourse.hibernate.org/t/defaultdiscriminatorconverter-with-hashcode-to-role-dtype/9366)._
