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

Comments

Projects
None yet
2 participants
@dodgex
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@dodgex

dodgex Dec 18, 2014

Contributor

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

Contributor

dodgex commented Dec 18, 2014

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

dodgex added a commit to dodgex/querydsl that referenced this issue Dec 18, 2014

@timowest timowest added this to the 3.6.1 milestone Dec 19, 2014

dodgex added a commit to dodgex/querydsl that referenced this issue Dec 20, 2014

@timowest timowest closed this Dec 21, 2014

@timowest

This comment has been minimized.

Show comment
Hide comment
@timowest

timowest Jan 31, 2015

Member

Released in 3.6.1

Member

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