-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Improve Panache projection with Hibernate ORM and Reactive #26510
Conversation
...me/src/main/java/io/quarkus/hibernate/orm/panache/common/runtime/CommonPanacheQueryImpl.java
Outdated
Show resolved
Hide resolved
8b20bef
to
bbbffc5
Compare
This comment has been minimized.
This comment has been minimized.
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.
LGTM, I was planning to ask for example with agregated query but you had the same idea and add them already ;)
Can you please update documentation / JavaDoc with a sentence explaing that if the query contains a select clause we do our best to transform it to a constructor expression, else we will build the query based on the constructor parameter list.
I would also like to have the opinion of @FroMage on this one now that the impl is matured and works.
I don't mind updating the documentation, but I would like to make sure that we agree on this approach and we are going to merge it before updating the docs. |
This comment has been minimized.
This comment has been minimized.
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.
This is great, IMO, and was missing. Can you do the same for HR and add documentation?
...me/src/main/java/io/quarkus/hibernate/orm/panache/common/runtime/CommonPanacheQueryImpl.java
Outdated
Show resolved
Hide resolved
966f6af
to
90af07f
Compare
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.
LGTM
@loicmathieu are you OK for me to merge this? |
@FroMage yes, it's OK for me, I follow the discussion and had nothing to say ;) |
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.
There are some problems in the documentation. The main one being the missing [
's. Always a good idea to do a doc rendering when introduction new sections that are not trivial.
...c/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/CommonPanacheQueryImpl.java
Show resolved
Hide resolved
User can now write an HQL with a select clause and project will work. It will run a valid HQL that converts each tuple in the result to selected type, as long as a valid constructor exists.
* Reduce number of `trim()` and `toLowerCase()` calls * Remove unecessary calls to `.length()`
Support `.project` with HQL queries with a select clause
Add tests with HQL queries with a select clause and .project
Add example for Panache .project with HQL query with a select clause
02cfd2c
to
38a2a05
Compare
I've updated the PR and added a commit that replaces all the |
38a2a05
to
4b45773
Compare
Thanks! |
Fixes #26284
It makes it possible to use projection with HQL queries with a select clause.
@loicmathieu this seems to work.