Skip to content

Conversation

gavinking
Copy link
Member

@gavinking gavinking commented Apr 18, 2025

Usage looks like:

var books = 
        SelectionSpecification.create(factory, Book.class)
                 .addRestriction(Restriction.like(Book_.title, "%Hibernate%", false))
                 .addRestriction(Restriction.greaterThan(Book_.pages, 100))
                 .setOrder(Order.desc(Book_.title))
                 .createQuery(session)
                 .getResultList();

Alternatively, I can take the concept further, get rid of the factory argument to create(), and do all the work in createQuery(). Depends which you prefer @sebersole.


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 requested a review from sebersole April 18, 2025 08:18
@gavinking
Copy link
Member Author

#10050 won the competition!

@gavinking gavinking closed this Apr 18, 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.

1 participant