Skip to content

Conversation

gavinking
Copy link
Member

@gavinking gavinking commented May 29, 2023

This patch incorporates several different improvements to the handling of query "result types".

  1. When a result type is passed to createSelectionQuery(), the select new Xxx(...) is now optional, and results will be happily packaged as a Map, List, or record, just like what happens already with Tuple.
  2. Similarly, for native queries when a result type is passed to createNativeQuery().
  3. Fixed some bugs in Tuple instantiation.
  4. Fixed, as well as possible for now, issue https://hibernate.atlassian.net/browse/HHH-16747, so that creating a query with no explicit result type is always that same as either and entity result type, or the result type Object[], and never has a weird third behavior which cannot be recovered for any explicit result type.
  5. Deprecated the createXxxxQuery() method with no explicit result type, since, even so, they still have pretty unintuitive behavior when the select clause is missing. I propose to eventually undeprecate them and have them throw an exception when the select clause is missing (except, perhaps, in extremely unambiguous cases).
  6. Properly documented all of this stuff, including in the Javadoc.

@hibernate-github-bot
Copy link

hibernate-github-bot bot commented May 29, 2023

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [50f2b73, 2e78325, 2f9071c]

› This message was automatically generated.

@gavinking gavinking force-pushed the implicit-instantiation branch from 4a2b1f7 to 15f8b54 Compare May 29, 2023 12:11
@gavinking gavinking requested a review from sebersole May 29, 2023 15:18
@gavinking gavinking force-pushed the implicit-instantiation branch from ac0d99b to 8d61946 Compare May 30, 2023 14:23
@gavinking gavinking changed the title HHH-16710 implicit instantiation for HQL result types HHH-16710, HHH-16742 implicit instantiation for HQL result types Jun 3, 2023
@gavinking gavinking force-pushed the implicit-instantiation branch from 0153b0b to ca0a8d6 Compare June 5, 2023 10:53
@gavinking gavinking changed the title HHH-16710, HHH-16742 implicit instantiation for HQL result types HHH-16710, HHH-16742, HHH-16747 implicit instantiation for HQL result types Jun 5, 2023
@gavinking gavinking force-pushed the implicit-instantiation branch from ca0a8d6 to d79cc1d Compare June 5, 2023 11:17
@gavinking gavinking force-pushed the implicit-instantiation branch from d79cc1d to 31350cf Compare June 5, 2023 15:11
@gavinking
Copy link
Member Author

There's now too much stuff rolled into this PR, and I'm starting to suffer from merge conflicts, so I'm going to merge this soon.

We're going to have to make some time to discuss the fallout, however.

@gavinking gavinking merged commit 4eee305 into hibernate:main Jun 5, 2023
@gavinking gavinking deleted the implicit-instantiation branch June 15, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant