public class SearchDescriptorBuilder<T>
Class to construct a new interface SearchDescriptor
using the Builder pattern.
interface SearchDescriptor
public static com.weedow.spring.data.search.descriptor.SearchDescriptorBuilder.Companion Companion
public SearchDescriptorBuilder(@NotNull java.lang.Class<T> entityClass)
Class to construct a new interface SearchDescriptor
using the Builder pattern.
interface SearchDescriptor
@NotNull public SearchDescriptorBuilder<T> id(@NotNull java.lang.String id)
Set the Search Descriptor ID. If this method is not called, the default value is the Entity Name in lowercase, deduced by the given Entity Class.
@NotNull public SearchDescriptorBuilder<T> validators(@NotNull com.weedow.spring.data.search.validation.DataSearchValidator... validators)
Set the validators to validate the query parameters.
@NotNull public SearchDescriptorBuilder<T> dtoMapper(@NotNull DtoMapper<T,?> dtoMapper)
Set the interface DtoMapper
to convert the Entities returned by the SQL queries to DTO object.
If this method is not called, the Entities are not converted and they are returned directly.
interface DtoMapper
@NotNull public SearchDescriptorBuilder<T> jpaSpecificationExecutor(@NotNull org.springframework.data.jpa.repository.JpaSpecificationExecutor<T> jpaSpecificationExecutor)
Set a specific JpaSpecificationExecutor to be used to search for entities.
If this method is not called, a default implementation of JpaSpecificationExecutor is retrieved from class JpaSpecificationExecutorFactory
.
class JpaSpecificationExecutorFactory
@NotNull public SearchDescriptorBuilder<T> entityJoinHandlers(@NotNull com.weedow.spring.data.search.join.handler.EntityJoinHandler... entityJoinHandlers)
Set the interface EntityJoinHandler
to specify join types for any fields having Join Annotation_
interface EntityJoinHandler
@NotNull public SearchDescriptor<T> build()
Builds a new interface SearchDescriptor
according to the specified options.
interface SearchDescriptor