JPA : Support for packageless entity classes

Bug #634103 reported by Mathias Bogaert on 2010-09-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Medium
Unassigned

Bug Description

Simple query:

HQLQuery query = new JPAQuery(JPA.em());
        QDocumentSet documentSet = QDocumentSet.documentSet; // query type

        documentSets = query.from(documentSet).list(documentSet);

Results in:

Execution exception (In /app/controllers/DocumentSets.java around line 27)
NullPointerException occured : null

play.exceptions.JavaExecutionException
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:285)
        at Invocation.HTTP Request(Play!)
Caused by: java.lang.NullPointerException
        at com.mysema.query.hql.HQLSerializer.handleJoinTarget(HQLSerializer.java:97)
        at com.mysema.query.hql.HQLSerializer.serializeSources(HQLSerializer.java:229)
        at com.mysema.query.hql.HQLSerializer.serialize(HQLSerializer.java:167)
        at com.mysema.query.hql.HQLQueryBase.buildQueryString(HQLQueryBase.java:53)
        at com.mysema.query.hql.HQLQueryBase.toString(HQLQueryBase.java:192)
        at com.mysema.query.hql.jpa.AbstractJPAQuery.createQuery(AbstractJPAQuery.java:67)
        at com.mysema.query.hql.jpa.AbstractJPAQuery.list(AbstractJPAQuery.java:143)
        at controllers.DocumentSets.groupBy(DocumentSets.java:27)
        at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:408)
        at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:403)
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:176)
        ... 1 more

Thanks for the bug report.

The bug resulted from assuming that the handled entity class has a package which it didn't in this case. The HQLSerializer handles now also package-less entity types, although usage of packageless classes is strongly discouraged.

Changed in querydsl:
status: New → Fix Committed
importance: Undecided → Medium
summary: - NullPointer in HQLSerializer
+ JPA : Support for packageless entity classes

Released in 1.9.6

Changed in querydsl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers