Class UserFilterSpecificationImpl

java.lang.Object
com.app.persistence.specification.impl.UserFilterSpecificationImpl
All Implemented Interfaces:
FilterSpecification<UserEntity,UserSpecification>

@Component public class UserFilterSpecificationImpl extends Object implements FilterSpecification<UserEntity,UserSpecification>
Implementation of FilterSpecification for filtering UserEntity instances dynamically based on the provided UserSpecification criteria.
  • Constructor Details

    • UserFilterSpecificationImpl

      public UserFilterSpecificationImpl()
  • Method Details

    • dynamicFilter

      public org.springframework.data.jpa.domain.Specification<UserEntity> dynamicFilter(UserSpecification userSpecification)
      Builds a dynamic JPA Specification for UserEntity based on the non-null and non-empty fields of the given UserSpecification.

      Supports filtering by:

      • name - exact match
      • surname - exact match
      • username - exact match
      • email - exact match
      • minAge - users with age greater than or equal to this value
      • maxAge - users with age less than or equal to this value
      • minHolidayHours - users with holidaysHours greater than or equal to this value
      • maxHolidayHours - users with holidaysHours less than or equal to this value
      Specified by:
      dynamicFilter in interface FilterSpecification<UserEntity,UserSpecification>
      Parameters:
      userSpecification - the filter criteria to apply
      Returns:
      a JPA Specification representing the combined filter conditions