com.vaadin.hilla.crud.

Class JpaFilterConverter

java.lang.Object
com.vaadin.hilla.crud.JpaFilterConverter
public final class JpaFilterConverter extends Object

Utility class for converting Hilla Filter specifications into JPA filter specifications. This class can be used to implement filtering for custom ListService or CrudService implementations that use JPA as the data source.

  • Method Details

    • toSpec

      public static <T> org.springframework.data.jpa.domain.Specification<T> toSpec(Filter rawFilter, Class<T> entity)

      Converts the given filter specification into a JPA filter specification for the specified entity class.

      If the filter contains PropertyStringFilter instances, their properties, or nested property paths, need to match the structure of the entity class. Likewise, their filter values should be in a format that can be parsed into the type that the property is of.

      Type Parameters:

      T - the type of the entity

      Parameters:

      rawFilter - the filter to convert

      entity - the entity class

      Returns:

      a JPA filter specification for the given filter