---------------------------------------------------------------------------------------------------
.aMMMb dMMMMb dMP dMMMMMMP dMMMMMP dMMMMb .dMMMb
dMP"VMP dMP.dMP amr dMP dMP dMP.dMP dMP" VP
dMP dMMMM. dMP dMP dMMMP dMMMMK VMMMb
dMP.aMP dMP AMF dMP dMP dMP dMP AMF dP .dMP
VMMMP" dMP dMP dMP dMP dMMMMMP dMP dMP VMMMP"
---------------------------------------------------------------------------------------------------
Replace
{version}in the snippets below with the version shown in the badge above.
implementation("se.oyabun.criters:criters-annotation:{version}")Annotate your filter objects with the criters filter annotations.
//
// Make your object extend Filter<?> for the type of entity you want to find.
//
public class FooFilter extends Filter<Foo> {
//
// Use direct parameter restrictions on the entity
//
@Parameter(name ="value",
restriction = Restriction.EQUALS)
public Integer getValue() { return 0; }
//
// or via a relational property restriction
//
@Relations({
@Relation(name="bars",
iterable = true,
parameters = {
@Parameter(name = "id",
restriction = Restriction.EQUALS)
})
})
public long getBarId() { return 0L; }
}implementation("se.oyabun.criters:criters-engine:{version}")Use the convenient Criters factory builder to instantiate your criters factory. You then need to configure the factory to use an entity manager or a root, criteria query and criteria builder.
//
// Either configure an entity manager
//
Criters.<Foo, Filter<Foo>> factory().use(entityManager);
//
// or with the root, criteria query and criteria builder directly
//
Criters.<Foo, Filter<Foo>> factory().use(root, criteriaQuery, criteriaBuilder);implementation("se.oyabun.criters:criters-spring-data-jpa:{version}")Annotate your filter object the regular way and let your specifications extend CritersSpecification<E, F extends Filter<E>>.
public class FooSpecification
extends CritersSpecification<Foo, Filter<Foo>> {
public FooSpecification(final Filter<Foo> searchFilter) {
super(searchFilter);
}
}implementation("se.oyabun.criters:criters-engine:{version}")implementation 'se.oyabun.criters:criters-engine:{version}'╔════════════════════╗
║ Criters Project ║
╚═╤══════════════════╝
│ ╔═════════════════════╗
├───╢ Criters Annotations ║
│ ╚═════════════════════╝
│ ╔════════════════╗
├───╢ Criters Engine ║
│ ╚════════════════╝
│ ╔═════════════════════════╗
├───╢ Criters Spring Data JPA ║
│ ╚═════════════════════════╝
│ ╔════════════════════════╗
├───╢ Criters Hibernate Test ║
│ ╚════════════════════════╝
│ ╔══════════════════════════╗
├───╢ Criters EclipseLink Test ║
│ ╚══════════════════════════╝
│ ╔═══════════════════════╗
├───╢ Criters Core JPA Test ║
│ ╚═══════════════════════╝
│ ╔═══════════════════╗
└───╢ Criters Core Test ║
╚═══════════════════╝
The project is published to:
- GitHub Packages — Released on new version tags (
v*)
./gradlew build # Build all modules
./gradlew build -x test # Build without running tests
./gradlew clean # Clean build artifactsRequires Java 21 and Gradle 9.4.1+