Top Fields Constructors Methods
org.hibernate.internal

pack-priv Class MultiIdentifierLoadAccessImpl<T>

extends Object
implements MultiIdentifierLoadAccess<T>, MultiIdLoadOptions
Class Inheritance
All Implemented Interfaces
org.hibernate.loader.ast.spi.MultiIdLoadOptions, org.hibernate.loader.ast.spi.MultiLoadOptions, org.hibernate.MultiIdentifierLoadAccess
Imports
java.util.Collections, .List, java.util.function.Supplier, org.hibernate.CacheMode, .LockOptions, .MultiIdentifierLoadAccess, org.hibernate.graph.GraphSemantic, .RootGraph, org.hibernate.graph.spi.RootGraphImplementor, org.hibernate.loader.ast.internal.LoaderHelper, org.hibernate.persister.entity.EntityPersister, org.hibernate.loader.ast.spi.MultiIdLoadOptions

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private Integer
private CacheMode
private final EntityPersister
private GraphSemantic
private LockOptions
private boolean
private boolean
private RootGraphImplementor<T>
private final SessionImpl
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public MultiIdentifierLoadAccess<T>
enableOrderedReturn(boolean
true if entity instances should be ordered; false if they may be returned in any order.
enabled
)

Implements org.hibernate.MultiIdentifierLoadAccess.enableOrderedReturn.

Should the returned list of entity instances be ordered, with the position of an entity instance determined by the position of its identifier in the list if ids passed to multiLoad?
public MultiIdentifierLoadAccess<T>
enableReturnOfDeletedEntities(boolean
true if removed entities should be returned; false if they should be replaced by null values.
enabled
)

Implements org.hibernate.MultiIdentifierLoadAccess.enableReturnOfDeletedEntities.

Should multiLoad return entity instances that have been marked for removal in the current session, but not yet deleted in the database?
public MultiIdentifierLoadAccess<T>
enableSessionCheck(boolean
true if they should be excluded; false if they should be included.
enabled
)

Implements org.hibernate.MultiIdentifierLoadAccess.enableSessionCheck.

Specifies whether the ids of managed entity instances already cached in the current persistence context should be excluded from the list of ids sent to the database.
public Integer
getBatchSize()

Implements org.hibernate.loader.ast.spi.MultiLoadOptions.getBatchSize.

Batch size to use when loading entities from the database.
public LockOptions
getLockOptions()

Implements org.hibernate.loader.ast.spi.MultiLoadOptions.getLockOptions.

Specify the lock options applied during loading.
public boolean
isOrderReturnEnabled()

Implements org.hibernate.loader.ast.spi.MultiLoadOptions.isOrderReturnEnabled.

Should the entities be returned in the same order as their associated entity identifiers were provided.
public boolean
isReturnOfDeletedEntitiesEnabled()

Implements org.hibernate.loader.ast.spi.MultiLoadOptions.isReturnOfDeletedEntitiesEnabled.

Should we returned entities that are scheduled for deletion.
public boolean
isSecondLevelCacheCheckingEnabled()

Implements org.hibernate.loader.ast.spi.MultiIdLoadOptions.isSecondLevelCacheCheckingEnabled.

Check the second-level cache first, and only if the entity is not found in the cache should Hibernate hit the database.
public boolean
isSessionCheckingEnabled()

Implements org.hibernate.loader.ast.spi.MultiIdLoadOptions.isSessionCheckingEnabled.

Check the first-level cache first, and only if the entity is not found in the cache should Hibernate hit the database.
public <K> List<T>
multiLoad(K...
The ids to load
ids
)

Implements org.hibernate.MultiIdentifierLoadAccess.multiLoad.

Retrieve the entities with the given identifiers.
public <K> List<T>
multiLoad(List<K>
The ids to load
ids
)

Implements org.hibernate.MultiIdentifierLoadAccess.multiLoad.

Retrieve the entities with the given identifiers.
public List<T>
perform(Supplier<List<T>> executor)

public final MultiIdentifierLoadAccess<T>
with(LockOptions
The lock options to use
lockOptions
)

Implements org.hibernate.MultiIdentifierLoadAccess.with.

Specify the lock options to use when querying the database.
public MultiIdentifierLoadAccess<T>
with(CacheMode
The CacheMode to use
cacheMode
)

Implements org.hibernate.MultiIdentifierLoadAccess.with.

Specify the CacheMode to use when obtaining an entity.
public MultiIdentifierLoadAccess<T>
with(RootGraph<T> graph, GraphSemantic semantic)

Implements org.hibernate.MultiIdentifierLoadAccess.with.

Customize the associations fetched by specifying an entity graph, and how it should be interpreted.
public MultiIdentifierLoadAccess<T>
withBatchSize(int
The batch size
batchSize
)

Implements org.hibernate.MultiIdentifierLoadAccess.withBatchSize.

Specify a batch size, that is, how many entities should be fetched in each request to the database.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

batchSizeback to summary
private Integer batchSize
cacheModeback to summary
private CacheMode cacheMode
entityPersisterback to summary
private final EntityPersister entityPersister
graphSemanticback to summary
private GraphSemantic graphSemantic
lockOptionsback to summary
private LockOptions lockOptions
orderedReturnEnabledback to summary
private boolean orderedReturnEnabled
returnOfDeletedEntitiesEnabledback to summary
private boolean returnOfDeletedEntitiesEnabled
rootGraphback to summary
private RootGraphImplementor<T> rootGraph
sessionback to summary
private final SessionImpl session
sessionCheckingEnabledback to summary
private boolean sessionCheckingEnabled

Constructor Detail

MultiIdentifierLoadAccessImplback to summary
public MultiIdentifierLoadAccessImpl(SessionImpl session, EntityPersister entityPersister)

Method Detail

enableOrderedReturnback to summary
public MultiIdentifierLoadAccess<T> enableOrderedReturn(boolean enabled)

Implements org.hibernate.MultiIdentifierLoadAccess.enableOrderedReturn.

Doc from org.hibernate.MultiIdentifierLoadAccess.enableOrderedReturn.

Should the returned list of entity instances be ordered, with the position of an entity instance determined by the position of its identifier in the list if ids passed to multiLoad?

By default, the returned list is ordered and the positions of the entities correspond to the positions of their ids. In this case, the handling of entities marked for removal becomes important.

Parameters
enabled:boolean

true if entity instances should be ordered; false if they may be returned in any order.

Returns:MultiIdentifierLoadAccess<T>

this, for method chaining

Annotations
@Override
enableReturnOfDeletedEntitiesback to summary
public MultiIdentifierLoadAccess<T> enableReturnOfDeletedEntities(boolean enabled)

Implements org.hibernate.MultiIdentifierLoadAccess.enableReturnOfDeletedEntities.

Doc from org.hibernate.MultiIdentifierLoadAccess.enableReturnOfDeletedEntities.

Should multiLoad return entity instances that have been marked for removal in the current session, but not yet deleted in the database?

By default, instances marked for removal are replaced by null in the returned list of entities when enableOrderedReturn is used.

Parameters
enabled:boolean

true if removed entities should be returned; false if they should be replaced by null values.

Returns:MultiIdentifierLoadAccess<T>

this, for method chaining

Annotations
@Override
enableSessionCheckback to summary
public MultiIdentifierLoadAccess<T> enableSessionCheck(boolean enabled)

Implements org.hibernate.MultiIdentifierLoadAccess.enableSessionCheck.

Doc from org.hibernate.MultiIdentifierLoadAccess.enableSessionCheck.

Specifies whether the ids of managed entity instances already cached in the current persistence context should be excluded from the list of ids sent to the database.

By default, all ids are included and sent to the database.

Parameters
enabled:boolean

true if they should be excluded; false if they should be included.

Returns:MultiIdentifierLoadAccess<T>

this, for method chaining

Annotations
@Override
getBatchSizeback to summary
public Integer getBatchSize()

Implements org.hibernate.loader.ast.spi.MultiLoadOptions.getBatchSize.

Doc from org.hibernate.loader.ast.spi.MultiLoadOptions.getBatchSize.

Batch size to use when loading entities from the database.

Returns:Integer

JDBC batch size

Annotations
@Override
getLockOptionsback to summary
public LockOptions getLockOptions()

Implements org.hibernate.loader.ast.spi.MultiLoadOptions.getLockOptions.

Doc from org.hibernate.loader.ast.spi.MultiLoadOptions.getLockOptions.

Specify the lock options applied during loading.

Returns:LockOptions

lock options applied during loading.

Annotations
@Override
isOrderReturnEnabledback to summary
public boolean isOrderReturnEnabled()

Implements org.hibernate.loader.ast.spi.MultiLoadOptions.isOrderReturnEnabled.

Doc from org.hibernate.loader.ast.spi.MultiLoadOptions.isOrderReturnEnabled.

Should the entities be returned in the same order as their associated entity identifiers were provided.

Returns:boolean

entities follow the provided identifier order

Annotations
@Override
isReturnOfDeletedEntitiesEnabledback to summary
public boolean isReturnOfDeletedEntitiesEnabled()

Implements org.hibernate.loader.ast.spi.MultiLoadOptions.isReturnOfDeletedEntitiesEnabled.

Doc from org.hibernate.loader.ast.spi.MultiLoadOptions.isReturnOfDeletedEntitiesEnabled.

Should we returned entities that are scheduled for deletion.

Returns:boolean

entities that are scheduled for deletion are returned as well.

Annotations
@Override
isSecondLevelCacheCheckingEnabledback to summary
public boolean isSecondLevelCacheCheckingEnabled()

Implements org.hibernate.loader.ast.spi.MultiIdLoadOptions.isSecondLevelCacheCheckingEnabled.

Doc from org.hibernate.loader.ast.spi.MultiIdLoadOptions.isSecondLevelCacheCheckingEnabled.

Check the second-level cache first, and only if the entity is not found in the cache should Hibernate hit the database.

Returns:boolean

the session factory cache is checked first

Annotations
@Override
isSessionCheckingEnabledback to summary
public boolean isSessionCheckingEnabled()

Implements org.hibernate.loader.ast.spi.MultiIdLoadOptions.isSessionCheckingEnabled.

Doc from org.hibernate.loader.ast.spi.MultiIdLoadOptions.isSessionCheckingEnabled.

Check the first-level cache first, and only if the entity is not found in the cache should Hibernate hit the database.

Returns:boolean

the session cache is checked first

Annotations
@Override
multiLoadback to summary
public <K> List<T> multiLoad(K... ids)

Implements org.hibernate.MultiIdentifierLoadAccess.multiLoad.

Doc from org.hibernate.MultiIdentifierLoadAccess.multiLoad.

Retrieve the entities with the given identifiers.

Note that the options enableReturnOfDeletedEntities and enableOrderedReturn affect the size and shape of the returned list of entity instances.

Parameters
<K>
The identifier type
ids:K[]

The ids to load

Returns:List<T>

The persistent entities.

Annotations
@Override
@SuppressWarnings:unchecked
multiLoadback to summary
public <K> List<T> multiLoad(List<K> ids)

Implements org.hibernate.MultiIdentifierLoadAccess.multiLoad.

Doc from org.hibernate.MultiIdentifierLoadAccess.multiLoad.

Retrieve the entities with the given identifiers.

Note that the options enableReturnOfDeletedEntities and enableOrderedReturn affect the size and shape of the returned list of entity instances.

Parameters
<K>
The identifier type
ids:List<K>

The ids to load

Returns:List<T>

The persistent entities.

Annotations
@Override
@SuppressWarnings:unchecked
performback to summary
public List<T> perform(Supplier<List<T>> executor)
withback to summary
public final MultiIdentifierLoadAccess<T> with(LockOptions lockOptions)

Implements org.hibernate.MultiIdentifierLoadAccess.with.

Doc from org.hibernate.MultiIdentifierLoadAccess.with.

Specify the lock options to use when querying the database.

Parameters
lockOptions:LockOptions

The lock options to use

Returns:MultiIdentifierLoadAccess<T>

this, for method chaining

Annotations
@Override
withback to summary
public MultiIdentifierLoadAccess<T> with(CacheMode cacheMode)

Implements org.hibernate.MultiIdentifierLoadAccess.with.

Doc from org.hibernate.MultiIdentifierLoadAccess.with.

Specify the CacheMode to use when obtaining an entity.

Parameters
cacheMode:CacheMode

The CacheMode to use

Returns:MultiIdentifierLoadAccess<T>

this, for method chaining

Annotations
@Override
withback to summary
public MultiIdentifierLoadAccess<T> with(RootGraph<T> graph, GraphSemantic semantic)

Implements org.hibernate.MultiIdentifierLoadAccess.with.

Doc from org.hibernate.MultiIdentifierLoadAccess.with.

Customize the associations fetched by specifying an entity graph, and how it should be interpreted.

Annotations
@Override
withBatchSizeback to summary
public MultiIdentifierLoadAccess<T> withBatchSize(int batchSize)

Implements org.hibernate.MultiIdentifierLoadAccess.withBatchSize.

Doc from org.hibernate.MultiIdentifierLoadAccess.withBatchSize.

Specify a batch size, that is, how many entities should be fetched in each request to the database.

  • By default, the batch sizing strategy is determined by the SQL dialect, but
  • if some batchSize>1 is specified as an argument to this method, then that batch size will be used.

If an explicit batch size is set manually, care should be taken to not exceed the capabilities of the underlying database.

A batch size is considered a hint.

Parameters
batchSize:int

The batch size

Returns:MultiIdentifierLoadAccess<T>

this, for method chaining

Annotations
@Override