Class IgnoreOnTypeMismatch<T>

java.lang.Object
net.kaczmarzyk.spring.data.jpa.domain.EmptyResultOnTypeMismatch<T>
net.kaczmarzyk.spring.data.jpa.domain.IgnoreOnTypeMismatch<T>
All Implemented Interfaces:
Serializable, org.springframework.data.jpa.domain.Specification<T>

public class IgnoreOnTypeMismatch<T> extends EmptyResultOnTypeMismatch<T>

Wrapper that turns a Specification into a one that ignores wrapped specification containing mismatched parameter (except spec = In.class - in this specification only mismatched parameter values are ignored). Type mismatch - e.g. when type on path is Long and the value from the HTTP parameter is not a numeric.

A spec will be wrapped with this decorator if onTypeMismatch property of @Spec is explicitly set to OnTypeMismatch.IGNORE, i.e.: @Spec(path="id", onTypeMismatch=IGNORE).

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    IgnoreOnTypeMismatch(org.springframework.data.jpa.domain.Specification<T> wrappedSpec)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
     
    jakarta.persistence.criteria.Predicate
    toPredicate(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.criteria.CriteriaQuery<?> query, jakarta.persistence.criteria.CriteriaBuilder cb)
     
     

    Methods inherited from class net.kaczmarzyk.spring.data.jpa.domain.EmptyResultOnTypeMismatch

    getWrappedSpec

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

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

    and, or
  • Constructor Details

    • IgnoreOnTypeMismatch

      public IgnoreOnTypeMismatch(org.springframework.data.jpa.domain.Specification<T> wrappedSpec)
  • Method Details