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

API inconsistency between JPA SQL and regular SQL: withRecursive() #537

Closed
msiedlarek opened this issue Nov 4, 2013 · 1 comment
Closed

API inconsistency between JPA SQL and regular SQL: withRecursive() #537

msiedlarek opened this issue Nov 4, 2013 · 1 comment
Milestone

Comments

@msiedlarek
Copy link
Contributor

@msiedlarek msiedlarek commented Nov 4, 2013

https://groups.google.com/forum/#!topic/querydsl/Jpz-9RVpMQI

Is there a reason why com.mysema.query.jpa.AbstractSQLQuery provides
only withRecursive() variant with subquery as a argument, while
com.mysema.query.sql.AbstractSQLQuery has also variants
accepting expressions?

It's a problem for me, because I'd like to use withRecursive on a
union expression, implementing typical recursive query in a style of:

WITH RECURSIVE t(n) AS (
    VALUES (1)
    UNION ALL
    SELECT n+1 FROM t WHERE n < 100
)
SELECT sum(n) FROM t;

I could do this with something like:

query.withRecursive(
    somePath,
    UnionUtils.union(
        new SubQueryExpression[] {firstSubQuery, secondSubQuery},
        true
    )
)

But only if `query` is a regular SQLQuery and not a JPASQLQuery.
timowest added a commit that referenced this issue Nov 4, 2013
@timowest
Copy link
Member

@timowest timowest commented Nov 17, 2013

Released in 3.3.0.BETA1

@timowest timowest closed this Nov 17, 2013
@timowest timowest added this to the 3.3.0 milestone Apr 13, 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants