Queryprojection error with springframework proxies

Bug #799254 reported by AlexRiva
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Querydsl
Fix Released
Undecided
Unassigned

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)

Revision history for this message
AlexRiva (alexriva) wrote :
Revision history for this message
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")){

to

if (query instanceof HibernateQuery) {

??

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

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.

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

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
Revision history for this message
AlexRiva (alexriva) wrote :

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

Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

I will make the next release next week.

Changed in querydsl:
status: In Progress → Fix Committed
Revision history for this message
Timo Westkämper (timo-westkamper) wrote :

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  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.