Class HibernateOrmSelectionLoadingContext.Builder
- java.lang.Object
-
- org.hibernate.search.mapper.orm.loading.impl.HibernateOrmSelectionLoadingContext.Builder
-
- All Implemented Interfaces:
SearchLoadingOptionsStep,PojoSelectionLoadingContextBuilder<SearchLoadingOptionsStep>
- Enclosing class:
- HibernateOrmSelectionLoadingContext
public static final class HibernateOrmSelectionLoadingContext.Builder extends Object implements PojoSelectionLoadingContextBuilder<SearchLoadingOptionsStep>, SearchLoadingOptionsStep
-
-
Constructor Summary
Constructors Constructor Description Builder(LoadingMappingContext mappingContext, LoadingIndexedTypeContextProvider typeContextProvider, LoadingSessionContext sessionContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PojoSelectionLoadingContextbuild()SearchLoadingOptionsStepcacheLookupStrategy(EntityLoadingCacheLookupStrategy strategy)Set the strategy for cache lookup before query results are loaded.SearchLoadingOptionsStepfetchSize(int fetchSize)Set the fetch size for this query, i.e.SearchLoadingOptionsStepgraph(EntityGraph<?> graph, org.hibernate.graph.GraphSemantic semantic)Customize fetching/loading of entity attributes and associations according to the given entity graph, with the given semantic.SearchLoadingOptionsStepgraph(String graphName, org.hibernate.graph.GraphSemantic semantic)Customize fetching/loading of entity attributes and associations according to the entity graph with the given name, with the given semantic.SearchLoadingOptionsSteptoAPI()
-
-
-
Constructor Detail
-
Builder
public Builder(LoadingMappingContext mappingContext, LoadingIndexedTypeContextProvider typeContextProvider, LoadingSessionContext sessionContext)
-
-
Method Detail
-
toAPI
public SearchLoadingOptionsStep toAPI()
- Specified by:
toAPIin interfacePojoSelectionLoadingContextBuilder<SearchLoadingOptionsStep>- Returns:
- The inital step of the loading options definition DSL passed to user-defined consumers added through
SearchQueryOptionsStep.loading(Consumer).
-
fetchSize
public SearchLoadingOptionsStep fetchSize(int fetchSize)
Description copied from interface:SearchLoadingOptionsStepSet the fetch size for this query, i.e. the amount of entities to load for each query to the database.Higher numbers mean fewer queries, but larger result sets.
- Specified by:
fetchSizein interfaceSearchLoadingOptionsStep- Parameters:
fetchSize- The fetch size. Must be positive or zero.- Returns:
thisfor method chaining.- See Also:
Query.setFetchSize(int)
-
cacheLookupStrategy
public SearchLoadingOptionsStep cacheLookupStrategy(EntityLoadingCacheLookupStrategy strategy)
Description copied from interface:SearchLoadingOptionsStepSet the strategy for cache lookup before query results are loaded.- Specified by:
cacheLookupStrategyin interfaceSearchLoadingOptionsStep- Parameters:
strategy- The strategy.- Returns:
thisfor method chaining.
-
graph
public SearchLoadingOptionsStep graph(EntityGraph<?> graph, org.hibernate.graph.GraphSemantic semantic)
Description copied from interface:SearchLoadingOptionsStepCustomize fetching/loading of entity attributes and associations according to the given entity graph, with the given semantic.- Specified by:
graphin interfaceSearchLoadingOptionsStep- Parameters:
graph- The graph to apply.semantic- The semantic to use when applying the graph.- Returns:
thisfor method chaining.- See Also:
Session.createEntityGraph(Class),Session.createEntityGraph(String),Session.getEntityGraph(String)
-
graph
public SearchLoadingOptionsStep graph(String graphName, org.hibernate.graph.GraphSemantic semantic)
Description copied from interface:SearchLoadingOptionsStepCustomize fetching/loading of entity attributes and associations according to the entity graph with the given name, with the given semantic.- Specified by:
graphin interfaceSearchLoadingOptionsStep- Parameters:
graphName- The name of the graph to apply.semantic- The semantic to use when applying the graph.- Returns:
thisfor method chaining.- See Also:
NamedEntityGraph
-
build
public PojoSelectionLoadingContext build()
- Specified by:
buildin interfacePojoSelectionLoadingContextBuilder<SearchLoadingOptionsStep>- Returns:
- The configured loading context.
-
-