se.oyabun.criters:criters-reactor

Criters engine is a framework for automating searches using JPA.

License

License

Categories

Categories

React User Interface Web Frameworks Reactor Container Microservices Reactive libraries
GroupId

GroupId

se.oyabun.criters
ArtifactId

ArtifactId

criters-reactor
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

pom
Description

Description

se.oyabun.criters:criters-reactor
Criters engine is a framework for automating searches using JPA.
Project URL

Project URL

https://github.com/OyabunAB/criters/
Project Organization

Project Organization

Oyabun AB
Source Code Management

Source Code Management

https://github.com/OyabunAB/criters/

Download criters-reactor

Filename Size
criters-reactor-1.0.1.pom 13 KB
Browse

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • criters-annotation
  • criters-engine
  • criters-test-core
  • criters-test-core-jpa
  • criters-test-hibernate
  • criters-test-eclipselink
  • criters-spring-data-jpa
---------------------------------------------------------------------------------------------------
     .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

Versions

Version
1.0.1
1.0.0