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
ConstructorsConstructorDescriptionBuilder(HibernateOrmLoadingMappingContext mappingContext, HibernateOrmLoadingSessionContext sessionContext) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Set the strategy for cache lookup before query results are loaded.fetchSize(int fetchSize) Set the fetch size for this query, i.e. the amount of entities to load for each query to the database.graph(EntityGraph<?> graph, GraphSemantic semantic) Customize fetching/loading of entity attributes and associations according to the given entity graph, with the given semantic.graph(String graphName, GraphSemantic semantic) Customize fetching/loading of entity attributes and associations according to the entity graph with the given name, with the given semantic.toAPI()
-
Constructor Details
-
Builder
public Builder(HibernateOrmLoadingMappingContext mappingContext, HibernateOrmLoadingSessionContext sessionContext)
-
-
Method Details
-
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
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:
-
cacheLookupStrategy
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
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:
-
graph
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:
-
build
- Specified by:
buildin interfacePojoSelectionLoadingContextBuilder<SearchLoadingOptionsStep>- Returns:
- The configured loading context.
-