se.oyabun.criters:criters-spring-data-jpa

Criters engine is a framework for automating searches using JPA.

Лицензия

Лицензия

Категории

Категории

Данные
Группа

Группа

se.oyabun.criters
Идентификатор

Идентификатор

criters-spring-data-jpa
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Criters engine is a framework for automating searches using JPA.
Организация-разработчик

Организация-разработчик

Oyabun AB

Скачать criters-spring-data-jpa

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/se.oyabun.criters/criters-spring-data-jpa/ -->
<dependency>
    <groupId>se.oyabun.criters</groupId>
    <artifactId>criters-spring-data-jpa</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/se.oyabun.criters/criters-spring-data-jpa/
implementation 'se.oyabun.criters:criters-spring-data-jpa:1.0.1'
// https://jarcasting.com/artifacts/se.oyabun.criters/criters-spring-data-jpa/
implementation ("se.oyabun.criters:criters-spring-data-jpa:1.0.1")
'se.oyabun.criters:criters-spring-data-jpa:jar:1.0.1'
<dependency org="se.oyabun.criters" name="criters-spring-data-jpa" rev="1.0.1">
  <artifact name="criters-spring-data-jpa" type="jar" />
</dependency>
@Grapes(
@Grab(group='se.oyabun.criters', module='criters-spring-data-jpa', version='1.0.1')
)
libraryDependencies += "se.oyabun.criters" % "criters-spring-data-jpa" % "1.0.1"
[se.oyabun.criters/criters-spring-data-jpa "1.0.1"]

Зависимости

compile (6)

Идентификатор библиотеки Тип Версия
se.oyabun.criters : criters-annotation jar 1.0.1
se.oyabun.criters : criters-engine jar 1.0.1
org.springframework.data : spring-data-jpa jar 1.11.6.RELEASE
javax.persistence : javax.persistence-api jar 2.2
org.apache.commons : commons-lang3 jar 3.4
org.slf4j : slf4j-api jar 1.7.21

test (7)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
ch.qos.logback : logback-classic jar 1.1.7
se.oyabun.criters.test : criters-test-core jar 1.0.1
se.oyabun.criters.test : criters-test-core-jpa jar 1.0.1
org.hibernate : hibernate-entitymanager jar 5.2.10.Final
org.springframework.boot : spring-boot-starter-data-jpa jar 1.5.6.RELEASE
org.springframework.boot : spring-boot-starter-test jar 1.5.6.RELEASE

Модули Проекта

Данный проект не имеет модулей.
---------------------------------------------------------------------------------------------------
     .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"
--------------------------------------------------------------------------------------------------- 

Criters Criteria Automation Engine Build Status Maven Central

Configuration

Search filter configuration

<dependency>
    <groupId>se.oyabun.criters</groupId>
    <artifactId>criters-annotation</artifactId>
    <version>${criters-annotation.version}</version>
</dependency>

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; }
    }

Engine configuration

<dependency>
    <groupId>se.oyabun.criters</groupId>
    <artifactId>criters-engine</artifactId>
    <version>${criters-engine.version}</version>
</dependency>

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);

Spring Data JPA

<dependency>
    <groupId>se.oyabun.criters</groupId>
    <artifactId>criters-spring-data-jpa</artifactId>
    <version>${criters-engine.version}</version>
</dependency>

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);
   
       }
   
   }

Project Structure

╔═════════════════════════╗ 
║ Criters Project Reactor ║
╚═╤═══════════════════════╝ 
  │   ╔═════════════════════╗
  ├───╢ Criters Annotations ║
  │   ╚═════════════════════╝
  │   ╔════════════════╗
  ├───╢ Criters Engine ║
  │   ╚════════════════╝
  │   ╔═════════════════════════╗
  ├───╢ Criters Spring Data JPA ║
  │   ╚═════════════════════════╝
  │   ╔════════════════════════╗
  ├───╢ Criters Hibernate Test ║
  │   ╚════════════════════════╝
  │   ╔══════════════════════════╗
  ├───╢ Criters EclipseLink Test ║
  │   ╚══════════════════════════╝
  │   ╔═══════════════════════╗
  ├───╢ Criters Core JPA Test ║
  │   ╚═══════════════════════╝
  │   ╔═══════════════════╗
  └───╢ Criters Core Test ║
      ╚═══════════════════╝
se.oyabun.criters

Oyabun AB

Open source repositories

Версии библиотеки

Версия
1.0.1
1.0.0