Interface Specification<T>

Type Parameters:
T - The entity type

public interface Specification<T>
A type to represent a specific view on data, heavily inspired by Spring Data's Specification.
Since:
1.2.0
Author:
Christian Beikov
  • Method Summary

    Modifier and Type
    Method
    Description
    javax.persistence.criteria.Predicate
    toPredicate(javax.persistence.criteria.Root<T> root, javax.persistence.criteria.CriteriaQuery<?> query, javax.persistence.criteria.CriteriaBuilder cb)
    Creates a WHERE clause for a query of the referenced entity in form of a Predicate for the given Root and CriteriaQuery.
  • Method Details

    • toPredicate

      javax.persistence.criteria.Predicate toPredicate(javax.persistence.criteria.Root<T> root, javax.persistence.criteria.CriteriaQuery<?> query, javax.persistence.criteria.CriteriaBuilder cb)
      Creates a WHERE clause for a query of the referenced entity in form of a Predicate for the given Root and CriteriaQuery.
      Parameters:
      root - The query root
      query - The criteria query
      Returns:
      a Predicate, may be null