After upgrading to spring framework 6, hibernate 6.x. we are seeing an issue and not getting a proper solution for it.
Brief about the issue:
We have 3 persistent entity,
-
DocumentBaseLite (using below annotation)
@DiscriminatorColumn(name = "ENT_TYPE", discriminatorType = DiscriminatorType.INTEGER, columnDefinition = "int")
-
Document (using the below annotation)
@DiscriminatorValue(value="1")
-
Project (using the below annotation)
@DiscriminatorValue(value="2")
We are fetching from DocumentBaseLite and I want to filter the result using the discriminatorValue.
my old code -
Predicate predicate = cb.equal(root.type(),
persistentEntityClass); jpaCriteriaBuilder.addPredicate(predicate);
I am passing the persistentEntityClass as Document.class
Error faced : HHH000099: an assertion failure occurred (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session): org.hibernate.AssertionFailure: Unrecognized entity name: com.pkg.service.s1.persistence.entity.Document
Requirement - Please let us know, how to fix this?
Any workaround?