Class SpecFactory<T extends jp.ecuacion.lib.jpa.entity.EclibEntity>

java.lang.Object
jp.ecuacion.splib.web.jpa.util.SpecFactory<T>
Type Parameters:
T - Entity

public class SpecFactory<T extends jp.ecuacion.lib.jpa.entity.EclibEntity> extends Object
Provides Spec factory.
  • Constructor Details

    • SpecFactory

      public SpecFactory()
  • Method Details

    • equals

      public org.springframework.data.jpa.domain.Specification<T> equals(String propertyPath, Object value)
      String、boolean、数値など、同一比較であれば型を絞らず共通使用可能。Enum項目(DB上はString)はvalueをEnum指定する必要があるので注意. fieldは"name", "parentRecord.id", "parentRecord.childRecord.id"など関連のrecordを含めて記載可能。
    • stringEqualsIgnoringCase

      public org.springframework.data.jpa.domain.Specification<T> stringEqualsIgnoringCase(String propertyPath, String value)
      Returns Specification for stringEqualsIgnoringCase.
      Parameters:
      propertyPath - propertyPath
      value - value
      Returns:
      Specification<T>
    • stringEquals

      public org.springframework.data.jpa.domain.Specification<T> stringEquals(String propertyPath, String value, boolean ignoresCase)
      Returns Specification for stringEquals.
      Parameters:
      propertyPath - propertyPath
      value - value
      Returns:
      Specification<T>
    • stringNotEquals

      public org.springframework.data.jpa.domain.Specification<T> stringNotEquals(String propertyPath, String value)
      Returns Specification for stringNotEquals.
      Parameters:
      propertyPath - propertyPath
      value - value
      Returns:
      Specification<T>
    • stringContains

      public org.springframework.data.jpa.domain.Specification<T> stringContains(String propertyPath, String value)
      Returns Specification for stringContains.
      Parameters:
      propertyPath - propertyPath
      value - value
      Returns:
      Specification<T>
    • stringContainsIgnoringCase

      public org.springframework.data.jpa.domain.Specification<T> stringContainsIgnoringCase(String propertyPath, String value)
      Returns Specification for stringContainsIgnoringCase.
      Parameters:
      propertyPath - propertyPath
      value - value
      Returns:
      Specification<T>
    • stringStartsWith

      public org.springframework.data.jpa.domain.Specification<T> stringStartsWith(String propertyPath, String value)
      Returns Specification for stringStartsWith.
      Parameters:
      propertyPath - propertyPath
      value - value
      Returns:
      Specification<T>
    • stringStartsWithIgnoringCase

      public org.springframework.data.jpa.domain.Specification<T> stringStartsWithIgnoringCase(String propertyPath, String value)
      Returns Specification for stringStartsWithIgnoringCase.
      Parameters:
      propertyPath - propertyPath
      value - value
      Returns:
      Specification<T>
    • stringEndsWith

      public org.springframework.data.jpa.domain.Specification<T> stringEndsWith(String propertyPath, String value)
      Returns Specification for stringEndsWith.
      Parameters:
      propertyPath - propertyPath
      value - value
      Returns:
      Specification<T>
    • stringEndsWithIgnoringCase

      public org.springframework.data.jpa.domain.Specification<T> stringEndsWithIgnoringCase(String propertyPath, String value)
      Returns Specification for stringEndsWithIgnoringCase.
      Parameters:
      propertyPath - propertyPath
      value - value
      Returns:
      Specification<T>
    • localDateEqualToOrLessThan

      public org.springframework.data.jpa.domain.Specification<T> localDateEqualToOrLessThan(String field, LocalDate date)
      Returns Specification for localDateEqualToOrLessThan.
      Parameters:
      field - field
      date - date
      Returns:
      Specification<T>
    • localDateEqualToOrLessThan

      public org.springframework.data.jpa.domain.Specification<T> localDateEqualToOrLessThan(String entity, String field, LocalDate date)
      Returns Specification for localDateEqualToOrLessThan.
      Parameters:
      field - field
      date - date
      Returns:
      Specification<T>
    • localDateEqualToOrGreaterThan

      public org.springframework.data.jpa.domain.Specification<T> localDateEqualToOrGreaterThan(String field, LocalDate date)
      Returns Specification for localDateEqualToOrLessThan.
      Parameters:
      field - field
      date - date
      Returns:
      Specification<T>
    • localDateEqualToOrGreaterThan

      public org.springframework.data.jpa.domain.Specification<T> localDateEqualToOrGreaterThan(String entity, String field, LocalDate date)
      Returns Specification for localDateEqualToOrGreaterThan.
      Parameters:
      field - field
      date - date
      Returns:
      Specification<T>
    • addExplicitSearchConditions

      public List<org.springframework.data.jpa.domain.Specification<T>> addExplicitSearchConditions(jp.ecuacion.splib.core.record.SplibRecord rec)
      add all the search conditions which are sure how to search from the kind of HtmlItem.
      Parameters:
      rec - rec
      Returns:
      List<Specification<T>>