Skip to content

Conversation

@beikov
Copy link
Member

@beikov beikov commented Apr 15, 2025

[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.


@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Apr 15, 2025

Thanks for your pull request!

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

❌ The pull request title should contain at least 2 words to describe the change properly
❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [20c2288, 0292679, 572c91c]

› This message was automatically generated.

@sebersole
Copy link
Member

Oh, I see what you are doing here now...

You are using Query itself as the abstraction. So this I do not like. IMO this should be a completely different contract. Soemthing like this maybe:

interface SelectionBuilder<T> {
    SelectionBuilder<T> setOrder(...);
    SelectionBuilder<T> addOrder(...);
    SelectionBuilder<T> setRestriction(...);
    SelectionBuilder<T> addRestriction(...);

    SelectionQuery<T> createQuery();
}

interface QueryProducer {
    <T> SelectionBuilder<T> createSelectionBuilder(String hql, Class<T> resultType);
}

with forms for mutation, etc...

@beikov beikov force-pushed the restrictions-experiment branch from 0267091 to 572c91c Compare April 15, 2025 17:57
@sebersole
Copy link
Member

0292679 Remove addRestriction and setOrder APIs from SelectionQuery
572c91c Change annotation processor to use JPA Criteria extension instead of mutating Query

This bit I disagree with, and it is explicitly something we discussed. We should not be changing the processor for 7.0

@beikov
Copy link
Member Author

beikov commented Apr 15, 2025

It's just an experiment to show it's possible, but I kept separate commits exactly to be able to pick just the parts that we want.

@sebersole
Copy link
Member

Closing this in favor of the approach in #10034, though that PR is also still a WIP.

@sebersole sebersole closed this Apr 16, 2025
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.

2 participants