Class QueryByExampleDataFetcher.Builder<T,R>
java.lang.Object
org.springframework.graphql.data.query.QueryByExampleDataFetcher.Builder<T,R>
- Type Parameters:
T
- domain typeR
- result type
- Enclosing class:
- QueryByExampleDataFetcher<T>
Builder for a Query by Example-based
DataFetcher
. Note that builder
instances are immutable and return a new instance of the builder
when calling configuration methods.-
Method Summary
Modifier and TypeMethodDescriptionmany()
Build aDataFetcher
to fetch many object instances.Project results returned from theQueryByExampleExecutor
into the targetprojectionType
.single()
Build aDataFetcher
to fetch single object instances.sortBy
(org.springframework.data.domain.Sort sort) Apply aSort
order.
-
Method Details
-
projectAs
Project results returned from theQueryByExampleExecutor
into the targetprojectionType
. Projection types can be either interfaces with property getters to expose or regular classes outside the entity type hierarchy for DTO projections.- Parameters:
projectionType
- projection type- Returns:
- a new
QueryByExampleDataFetcher.Builder
instance with all previously configured options andprojectionType
applied
-
sortBy
Apply aSort
order.- Parameters:
sort
- the default sort order- Returns:
- a new
QueryByExampleDataFetcher.Builder
instance with all previously configured options andSort
applied
-
single
Build aDataFetcher
to fetch single object instances. -
many
Build aDataFetcher
to fetch many object instances.
-