A NullPointerException is thrown, while trying to retrieve an attribute of a static metamodel class, generated for an Embeddable within an entity. The Embeddable class should be a generic type, extend from a generic type parent class and the attribute should belong to the parent class for this exception to occur.
{noformat}java.lang.NullPointerException: Cannot invoke "org.hibernate.metamodel.model.domain.PersistentAttribute.getName()" because "attribute" is null at org.hibernate.query.sqm.tree.domain.AbstractSqmPath.resolvePath(AbstractSqmPath.java:185) at org.hibernate.query.sqm.tree.domain.AbstractSqmPath.get(AbstractSqmPath.java:218) at org.hibernate.query.sqm.tree.domain.AbstractSqmPath.get(AbstractSqmPath.java:37) at org.hibernate.RunHibernateTest.handleQueryResult(RunHibernateTest.java:65) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) {noformat} |
|