Class ConditionalSearchCriteria<V>

java.lang.Object
com.samupert.univpm.eurostat.filtering.criteria.conditional.ConditionalSearchCriteria<V>
Type Parameters:
V - The type of the value of the search criteria.
All Implemented Interfaces:
SearchCriteriaSpecification, Serializable, org.springframework.data.jpa.domain.Specification<MonetaryPoverty>
Direct Known Subclasses:
ContainsConditionalSearchCriteria, EqualsConditionalSearchCriteria, GreaterThanConditionalSearchCriteria, GreaterThanOrEqualToConditionalSearchCriteria, InArrayConditionalSearchCriteria, LessThanConditionalSearchCriteria, LessThanOrEqualToConditionalSearchCriteria

public abstract class ConditionalSearchCriteria<V> extends Object implements SearchCriteriaSpecification
Abstract class that represents a conditional search criteria that can be applied to a MonetaryPoverty entity.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected String
    The field name of the search criteria.
    protected V
    The value of the search criteria.

    Fields inherited from interface org.springframework.data.jpa.domain.Specification

    serialVersionUID
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a conditional search criteria that filters a value of type ConditionalSearchCriteria.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract jakarta.persistence.criteria.Predicate
    getPredicate(jakarta.persistence.criteria.Root<MonetaryPoverty> root, jakarta.persistence.criteria.CriteriaQuery<?> query, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder)
    Wrapper method that returns the predicate of the search criteria.
    protected abstract List<Class<?>>
    Gets the list of supported field types of the search criteria.
    jakarta.persistence.criteria.Predicate
    toPredicate(jakarta.persistence.criteria.Root<MonetaryPoverty> root, jakarta.persistence.criteria.CriteriaQuery<?> query, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder)
     
    protected void
    validateFieldName(jakarta.persistence.criteria.Root<MonetaryPoverty> root)
    Checks if the field name of the search criteria is valid.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.data.jpa.domain.Specification

    and, or
  • Field Details

    • fieldName

      protected String fieldName
      The field name of the search criteria.
    • value

      protected V value
      The value of the search criteria.
  • Constructor Details

    • ConditionalSearchCriteria

      public ConditionalSearchCriteria()
      Creates a conditional search criteria that filters a value of type ConditionalSearchCriteria.
  • Method Details

    • validateFieldName

      protected void validateFieldName(jakarta.persistence.criteria.Root<MonetaryPoverty> root) throws InvalidFieldNameException
      Checks if the field name of the search criteria is valid.
      Parameters:
      root - A root type in the from clause. Query roots always reference entities.
      Throws:
      InvalidFieldNameException - Thrown if the field name of the search criteria is not a valid field name.
    • toPredicate

      public jakarta.persistence.criteria.Predicate toPredicate(@NonNull jakarta.persistence.criteria.Root<MonetaryPoverty> root, @NonNull jakarta.persistence.criteria.CriteriaQuery<?> query, @NonNull jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) throws InvalidFilterException
      Specified by:
      toPredicate in interface org.springframework.data.jpa.domain.Specification<V>
      Throws:
      InvalidFilterException
    • getPredicate

      protected abstract jakarta.persistence.criteria.Predicate getPredicate(jakarta.persistence.criteria.Root<MonetaryPoverty> root, jakarta.persistence.criteria.CriteriaQuery<?> query, jakarta.persistence.criteria.CriteriaBuilder criteriaBuilder) throws InvalidFilterException
      Wrapper method that returns the predicate of the search criteria.
      Parameters:
      root - A root type in the from clause. Query roots always reference entities.
      query - The query to be built.
      criteriaBuilder - The criteria builder to be used.
      Returns:
      The predicate of the search criteria.
      Throws:
      InvalidFilterException - Thrown if the search criteria is not a valid filter.
    • getSupportedFieldTypes

      protected abstract List<Class<?>> getSupportedFieldTypes()
      Gets the list of supported field types of the search criteria.
      Returns:
      The list of supported field types of the search criteria.