Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException for parameter type mismatches #795

Closed
giulianocosta opened this issue Jun 9, 2014 · 6 comments
Closed

java.lang.IllegalArgumentException for parameter type mismatches #795

giulianocosta opened this issue Jun 9, 2014 · 6 comments
Labels
bug
Milestone

Comments

@giulianocosta
Copy link

@giulianocosta giulianocosta commented Jun 9, 2014

Hi,

Query raises java.lang.IllegalArgumentException when execute subquery with sum comparison like bellow.

QInventoryEntry ie = new QInventoryEntry("ie");
JPQLSubQuery queryChild = new JPASubQuery().from(ie);
criteria.add(queryChild.where(ie.product.eq($)).unique(ie.quantity.sum()).gt(1l))

A Exception raised by com.mysema.query.jpa.impl.JPAUtil class on setConstants method.

java.lang.IllegalArgumentException: Parameter value [1] did not match expected type [java.lang.Long (n/a)]

Version 3.3.3

@Shredder121
Copy link
Member

@Shredder121 Shredder121 commented Jun 10, 2014

Parameter value 1 is the product that must equal '$'?
Is that your intention? or are we missing more of the query?

@giulianocosta
Copy link
Author

@giulianocosta giulianocosta commented Jun 10, 2014

$ is the QProduct outside query.

I want find all products if have quantity in invetory...

QProduct $ = new QProduct("p");
JpqQuery qry = from($);
QInventoryEntry ie = new QInventoryEntry("ie");
JPQLSubQuery queryChild = new JPASubQuery().from(ie);
qry.where(queryChild.where(ie.product.eq($)).unique(ie.quantity.sum()).gt(1l))
.list($);

@timowest timowest added the bug label Jun 11, 2014
timowest added a commit that referenced this issue Jun 12, 2014
@timowest timowest mentioned this issue Jun 12, 2014
@timowest timowest added the fixed label Jun 12, 2014
@timowest
Copy link
Member

@timowest timowest commented Jun 12, 2014

The issue seems to be caused only when the JPA API is used. I added a test and fix.

@giulianocosta
Copy link
Author

@giulianocosta giulianocosta commented Jun 12, 2014

Ok Timo,

Are you know when release the fix? More less...

Thank you

timowest added a commit that referenced this issue Jun 13, 2014
Fix for #795
@timowest timowest added this to the 3.4.1 milestone Jun 13, 2014
@timowest
Copy link
Member

@timowest timowest commented Jun 13, 2014

End of june.

@timowest timowest modified the milestone: 3.4.1 Jun 25, 2014
@timowest timowest changed the title java.lang.IllegalArgumentException java.lang.IllegalArgumentException for parameter type mismatches Jun 29, 2014
@timowest
Copy link
Member

@timowest timowest commented Jun 29, 2014

Released in 3.4.1

@timowest timowest closed this Jun 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.