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

Improve Panache projection with Hibernate ORM and Reactive #26510

Merged
merged 10 commits into from
Aug 10, 2022

Conversation

DavideD
Copy link
Contributor

@DavideD DavideD commented Jul 1, 2022

Fixes #26284

It makes it possible to use projection with HQL queries with a select clause.

@loicmathieu this seems to work.

@DavideD DavideD force-pushed the panache-project branch 14 times, most recently from 8b20bef to bbbffc5 Compare July 3, 2022 11:16
@DavideD DavideD marked this pull request as ready for review July 3, 2022 12:10
@quarkus-bot

This comment has been minimized.

@DavideD DavideD force-pushed the panache-project branch from bbbffc5 to 8a35bd0 Compare July 3, 2022 14:05
Copy link
Contributor

@loicmathieu loicmathieu left a 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.

@DavideD DavideD force-pushed the panache-project branch from 8a35bd0 to 364c1b4 Compare July 4, 2022 16:48
@DavideD
Copy link
Contributor Author

DavideD commented Jul 4, 2022

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.

@DavideD DavideD force-pushed the panache-project branch from 364c1b4 to 22438f5 Compare July 9, 2022 12:44
@quarkus-bot

This comment has been minimized.

@DavideD DavideD force-pushed the panache-project branch from 22438f5 to e99d9c2 Compare July 9, 2022 14:09
Copy link
Member

@FroMage FroMage left a 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?

@DavideD DavideD force-pushed the panache-project branch 2 times, most recently from 966f6af to 90af07f Compare July 18, 2022 15:30
Copy link
Member

@FroMage FroMage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@FroMage
Copy link
Member

FroMage commented Jul 25, 2022

@loicmathieu are you OK for me to merge this?

@loicmathieu
Copy link
Contributor

@FroMage yes, it's OK for me, I follow the discussion and had nothing to say ;)

Copy link
Member

@gsmet gsmet left a 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.

DavideD added 9 commits August 9, 2022 23:19
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
@DavideD
Copy link
Contributor Author

DavideD commented Aug 9, 2022

I've updated the PR and added a commit that replaces all the it's to it is: 4b45773

@gsmet
Copy link
Member

gsmet commented Aug 9, 2022

Thanks!

@gsmet gsmet added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Aug 9, 2022
@DavideD DavideD changed the title Improve Panache projection with Hibernate ORM Improve Panache projection with Hibernate ORM and Reactive Aug 10, 2022
@gsmet gsmet merged commit 8e4ee68 into quarkusio:main Aug 10, 2022
@quarkus-bot quarkus-bot bot added this to the 2.12 - main milestone Aug 10, 2022
@quarkus-bot quarkus-bot bot added kind/bugfix and removed triage/waiting-for-ci Ready to merge when CI successfully finishes labels Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panache projection doesn't work with aggregate JPQL functions
4 participants