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

union of single ListSubQuery fails #444

Closed
timowest opened this issue Jun 18, 2013 · 2 comments
Closed

union of single ListSubQuery fails #444

timowest opened this issue Jun 18, 2013 · 2 comments
Milestone

Comments

@timowest
Copy link
Member

@timowest timowest commented Jun 18, 2013

Caused by: java.lang.ClassCastException: com.mysema.query.types.query.SimpleSubQuery cannot be cast to com.mysema.query.types.expr.SimpleExpression
    at com.mysema.query.sql.SQLSubQuery.union(SQLSubQuery.java:50)
    at com.mysema.query.sql.SQLSubQuery.union(SQLSubQuery.java:54)

Code is as follows:

List<SubQueryExpression<Tuple>> subQueryExprs = new ArrayList<SubQueryExpression<Tuple>>();
for (...) {
   SQLSubQuery subQuery = new SQLSubQuery().from(...)...;
   subQueryExprs.add(subQuery.where(...).distinct().unique(...);
}
JPASQLQuery query = createQuery().from(new SQLSubQuery().union(subQueryExprs).as(subQueriesAlias));
timowest added a commit that referenced this issue Jun 18, 2013
@timowest
Copy link
Member Author

@timowest timowest commented Jun 26, 2013

Released in 3.2.1

@timowest timowest closed this Jun 26, 2013
@nyc2
Copy link

@nyc2 nyc2 commented Jun 27, 2013

This works now, thanks.

@timowest timowest added this to the 3.2.1 milestone Apr 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants