-
-
Notifications
You must be signed in to change notification settings - Fork 75
#1528: Hibernate CTE support #1529
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
base: master
Are you sure you want to change the base?
#1528: Hibernate CTE support #1529
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1529 +/- ##
=======================================
Coverage 0.00% 0.00%
=======================================
Files 813 840 +27
Lines 31466 31845 +379
Branches 3614 3631 +17
=======================================
- Misses 31466 31845 +379
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| } | ||
|
|
||
| private void handleJoinTarget(JoinExpression je) { | ||
| protected void handleJoinTarget(JoinExpression je) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find a nicer way to extend the logic of this method.
As NativeSQLSerializer also has a similarly named method, which is also marked as protected I hope this is okay to do.
| public Q with(Path<?> alias, SubQueryExpression<?> query) { | ||
| return with(alias, null, query); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hibernate only supports subqueries here, so there is no WithBuilder options here.
Also, recursive CTEs are not in scope for this change, so those are also not present.
| handle(alias); | ||
| withAliases.add(alias); | ||
| append(" as "); | ||
| if (args.get(1) instanceof ConstantImpl<?> materializedParam | ||
| && materializedParam.getConstant() instanceof Boolean materialized) { | ||
| if (!materialized) { | ||
| append("not "); | ||
| } | ||
| append("materialized "); | ||
| } | ||
| handle(args.get(2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally I wanted to use templates, but I couldn't figure out how to get the (not)? materialized part work with them. So I just append directly here.
...-libraries/querydsl-jpa/src/main/java/com/querydsl/jpa/hibernate/AbstractHibernateQuery.java
Outdated
Show resolved
Hide resolved
Extending AbstractHibernateQuery to support simple Common Table Expressions.
1fcdb17 to
c219fd9
Compare
|
CodeQL build is failing due to commit: 7f244eb. |
Extending AbstractHibernateQuery to support simple Common Table Expressions.