Issue #853: StaticMetamodel throws NPE with Spring-Data in PathImpl.get()

Type: Feature requestVersion: 2.4.1Priority: NormalStatus: ActiveReplies: 5

From my Entities a StaticMetamodel is generated through Hibernate JPA 2 Metamodel Generator. When i now try to build a query with the Specification-Interface

[new Specification<Benutzer>() {
    public Predicate toPredicate(final Root<Benutzer> benutzerRoot, final CriteriaQuery<?> query, final CriteriaBuilder cb) {
        final Path<String> benutzerName = benutzerRoot.get(Benutzer_.benutzerName); // HERE THE NPE HAPPENS
        return cb.equal(benutzerName, benutzername);

from Spring-Data i got a NullPointerException in com.objectdb.jpa.criteria.PathImpl.get() where the parameter is a SingularAttribute field from the generated class annotated by @StaticMetamodel. When i replace the SingularAttribute with a simple String everything works like expected.


Please post the full stack trace.

If you can also attach a small test that demonstrates the exception it may help.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

attached a sample project with a working and a failing test case


Currently ObjectDB doesn't support the static metamodel classes, so criteria queries can only be used with field names (as demonstrated by your sample project).

Support of the static metamodel classes should be added to ObjectDB soon.


ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Hi support,

I can't find any reference in documentation and change logs.
Are static metamodel classes supported now?

Best Regards,


Not supported yet due to low request by users.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login