Queryprojection error with springframework proxies

Bug #799254 reported by AlexRiva on 2011-06-18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

Queryprojection not working Using springframework with hibernate JPA and querydsl.
In AbstractJPAQuery at line 135 there is a check about query class name, this doesn't work if spring autoproxy is in use.
It should modified with a checking for class name starting with $ and then using the code for spring proxies (http://forum.springsource.org/showthread.php?17039-Getting-the-real-class-name-from-proxies)

AlexRiva (alexriva) wrote :
AlexRiva (alexriva) wrote :

querydsl-jpa has already a dependency on hibernate-entitymanager, so why not simply change the check from:

if (query.getClass().getName().startsWith("org.hibernate")){


if (query instanceof HibernateQuery) {


The Hibernate dependencies are provided, so the class should also work without this dependency. Your fix doesn't work when the class isn't available.

I just commited an improved instance check to SVN trunk, could you verify that it works for you?

Changed in querydsl:
status: New → In Progress
AlexRiva (alexriva) wrote :

I have checkout 2.1.2 and copied AbstractJPAQuery.java file from trunk and it works!
Any 2.1.3 release planned ?

I will make the next release next week.

Changed in querydsl:
status: In Progress → Fix Committed

Released in 2.2.0.beta5

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

Bug attachments