I created the project using org.springframework.boot version 3.0.2 and the following library versions: hibernate ORM core version 6.1.6.Final, hypersistence-utils-hibernate-60:3.1.2, with mariadb-java-client:3.1.2. I use in my project an entity:
with two inheritors:
Content:
I can get an inheritor with a serialized JSON object (FirstInheritor) from DB, but I have a HibernateException when I try to get an inheritor with a String field (SecondInheritor).
If I rename the entity FirstInheritor to TenthInheritor I can get inheritor with a String field, but I get PropertyAccessException when I try to get an inheritor with the object field.
As you can see, exception depends on lexicographical order of inheritor names. I could get both entities correctly in hiberante 5 and com.vladmihalcea:hibernate-types-52:2.21.1. I expect the correct behavior in this version too. You can see this bug in my test project I opened Hypersistence Utils issue https://github.com/vladmihalcea/hypersistence-utils/issues/583 and got the answer https://github.com/vladmihalcea/hypersistence-utils/issues/583#issuecomment-1436824643 |