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

clone does not work properly for unions for sql #1096

Closed
dodgex opened this issue Dec 18, 2014 · 2 comments
Closed

clone does not work properly for unions for sql #1096

dodgex opened this issue Dec 18, 2014 · 2 comments
Milestone

Comments

@dodgex
Copy link
Contributor

@dodgex dodgex commented Dec 18, 2014

i have something like this:

SQLSubQuery sub1 = new SQLSubQuery();
ListSubQuery<Tuple> list1=sub1.list(...);

SQLSubQuery sub2 = new SQLSubQuery();
ListSubQuery<Tuple> list2=sub2.list(...);

SQLQuery query = ... ;

query.union(list1, list2);

the execution of this query works but when i do

SQLQuery query2 = query.clone() ;

i get when trying to execute the new query (firstUnionSubQuery == null)

java.lang.NullPointerException: null
    at com.mysema.query.sql.ProjectableSQLQuery.serialize(ProjectableSQLQuery.java:514) ~[querydsl-sql-3.5.0.jar:na]
    at com.mysema.query.sql.AbstractSQLQuery.list(AbstractSQLQuery.java:289) ~[querydsl-sql-3.5.0.jar:na]
    at com.mysema.query.sql.ProjectableSQLQuery.list(ProjectableSQLQuery.java:313) ~[querydsl-sql-3.5.0.jar:na]

my code related to the cloned query works fine for querys that do not use union.

@dodgex
Copy link
Contributor Author

@dodgex dodgex commented Dec 18, 2014

it looks like here: ProjectableSQLQuery.java#L482 should be another line like this.firstUnionSubQuery = query.firstUnionSubQuery;

@timowest timowest added this to the 3.6.1 milestone Dec 19, 2014
@timowest timowest closed this Dec 21, 2014
@timowest
Copy link
Member

@timowest timowest commented Jan 31, 2015

Released in 3.6.1

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
2 participants
You can’t perform that action at this time.