java.lang.IllegalArgumentException for parameter type mismatches #795

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

Comments

Projects
None yet
3 participants
@giulianocosta

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

This comment has been minimized.

Show comment
Hide comment
@Shredder121

Shredder121 Jun 10, 2014

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@giulianocosta

giulianocosta 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($);

$ 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 referenced this issue Jun 12, 2014

Merged

Fix for #795 #802

@timowest timowest added the fixed label Jun 12, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jun 12, 2014

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@giulianocosta

giulianocosta Jun 12, 2014

Ok Timo,

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

Thank you

Ok Timo,

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

Thank you

timowest added a commit that referenced this issue Jun 13, 2014

@timowest timowest added this to the 3.4.1 milestone Jun 13, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jun 13, 2014

Member

End of june.

Member

timowest commented Jun 13, 2014

End of june.

@timowest timowest modified the milestone: 3.4.1 Jun 25, 2014

@timowest timowest changed the title from java.lang.IllegalArgumentException to java.lang.IllegalArgumentException for parameter type mismatches Jun 29, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jun 29, 2014

Member

Released in 3.4.1

Member

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