The issue started appearing after migrating to Hibernate 7.2 from 6.6.28.Final. I have tried 7.2.4.Final and 7.1.16.Final, both releases have the same issue.
I have this entity:
@Entity
public class EntityType implements Serializable {
// class body
}
the above entity is used in another entity like this:
@Entity
public class FormType implements Serializable {
private EntityType entityType;
}
The problem is with the generated static metamodel of FormType. Instead of declaring the field entityType in FormType_ of type my EntityType, it is of type jakarta.persistence.metamodel.EntityType<X>.
import jakarta.persistence.metamodel.EntityType
@StaticMetamodel(FormType.class)
@Generated("org.hibernate.proccessor.HibernateProcessor")
public abstract class FormType_ {
public static volatile SingularAtribute<FormType, EntityType> entityType
}
My question is, why did this issue started appearing in after upgrading to Hibernate 7, while it worked fine in 6?
Can I fix it without having to rename my entity EntityType?