Skip to content

HHH-19364 changes to Specifications to support Hibernate Processor #10066

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

Merged
merged 1 commit into from
Apr 22, 2025

Conversation

gavinking
Copy link
Member

@gavinking gavinking commented Apr 22, 2025

  1. fix generic types of parameters (should be lower bounds)
  2. make it work with plain-vanilla EntityManager
  3. to eliminate ambiguity in overload resolution, this unfortunately required disallowing SharedSessionContract
  4. make Path.fetch() use LEFT join

[Please describe here what your change is about]


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-19364

@gavinking gavinking force-pushed the HHH-19364-changes branch 2 times, most recently from 2b84dd9 to fa0c470 Compare April 22, 2025 14:15
1. fix generic types of parameters (should be lower bounds)
2. make it work with plain-vanilla EntityManager
3. to eliminate ambiguity in overload resolution, this unfortunately
   required disallowing SharedSessionContract
4. make Path.fetch() use LEFT join
@gavinking
Copy link
Member Author

cc @sebersole


/**
* Finalize the building and create executable query instance.
*/
CommonQueryContract createQuery(SharedSessionContract session);
CommonQueryContract createQuery(EntityManager entityManager);

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method QuerySpecification.createQuery(..) could be confused with overloaded method
createQuery
, since dispatch depends on static types.
@@ -101,6 +113,11 @@
return new QuerySqmImpl<>( sqmStatement, true, null, sessionImpl );
}

@Override
public MutationQuery createQuery(EntityManager entityManager) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method MutationSpecificationImpl.createQuery(..) could be confused with overloaded method
createQuery
, since dispatch depends on static types.
@@ -145,6 +157,11 @@
return new SqmSelectionQueryImpl<>( sqmStatement, true, resultType, sessionImpl );
}

@Override
public SelectionQuery<T> createQuery(EntityManager entityManager) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method SelectionSpecificationImpl.createQuery(..) could be confused with overloaded method
createQuery
, since dispatch depends on static types.
@gavinking gavinking merged commit 0c3654b into hibernate:main Apr 22, 2025
25 checks passed
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