Top Fields Constructors Methods
org.hibernate.internal

public Class NaturalIdMultiLoadAccessStandard<T>

extends Object
implements NaturalIdMultiLoadAccess<T>, MultiNaturalIdLoadOptions
Class Inheritance
All Implemented Interfaces
org.hibernate.loader.ast.spi.MultiNaturalIdLoadOptions, org.hibernate.loader.ast.spi.MultiLoadOptions, org.hibernate.NaturalIdMultiLoadAccess
Imports
java.util.List, .Set, org.hibernate.CacheMode, .LockOptions, .NaturalIdMultiLoadAccess, org.hibernate.engine.spi.EffectiveEntityGraph, .LoadQueryInfluencers, org.hibernate.graph.GraphSemantic, .RootGraph, org.hibernate.graph.spi.RootGraphImplementor, org.hibernate.internal.util.collections.CollectionHelper, org.hibernate.loader.ast.spi.MultiNaturalIdLoadOptions, org.hibernate.persister.entity.EntityPersister

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

Implements org.hibernate.NaturalIdMultiLoadAccess.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 NaturalIdMultiLoadAccess<T>
enableReturnOfDeletedEntities(boolean
true if removed entities should be returned; false if they should be replaced by null values.
enabled
)

Implements org.hibernate.NaturalIdMultiLoadAccess.enableReturnOfDeletedEntities.

Should multiLoad return entity instances that have been marked for removal in the current session, but not yet deleted in 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 List<T>
multiLoad(Object...
The natural id values to load
ids
)

Implements org.hibernate.NaturalIdMultiLoadAccess.multiLoad.

Retrieve the entities with the given natural id values.
public List<T>
multiLoad(List<?>
The natural id values to load
ids
)

Implements org.hibernate.NaturalIdMultiLoadAccess.multiLoad.

Retrieve the entities with the given natural id values.
public NaturalIdMultiLoadAccess<T>
with(LockOptions
The lock options to use
lockOptions
)

Implements org.hibernate.NaturalIdMultiLoadAccess.with.

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

Implements org.hibernate.NaturalIdMultiLoadAccess.with.

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

Implements org.hibernate.NaturalIdMultiLoadAccess.with.

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

Implements org.hibernate.NaturalIdMultiLoadAccess.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
entityDescriptorback to summary
private final EntityPersister entityDescriptor
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

Constructor Detail

NaturalIdMultiLoadAccessStandardback to summary
public NaturalIdMultiLoadAccessStandard(EntityPersister entityDescriptor, SessionImpl session)

Method Detail

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

Implements org.hibernate.NaturalIdMultiLoadAccess.enableOrderedReturn.

Doc from org.hibernate.NaturalIdMultiLoadAccess.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:NaturalIdMultiLoadAccess<T>

this, for method chaining

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

Implements org.hibernate.NaturalIdMultiLoadAccess.enableReturnOfDeletedEntities.

Doc from org.hibernate.NaturalIdMultiLoadAccess.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:NaturalIdMultiLoadAccess<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
multiLoadback to summary
public List<T> multiLoad(Object... ids)

Implements org.hibernate.NaturalIdMultiLoadAccess.multiLoad.

Doc from org.hibernate.NaturalIdMultiLoadAccess.multiLoad.

Retrieve the entities with the given natural id values.

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

Parameters
ids:Object[]

The natural id values to load

Returns:List<T>

The managed entities.

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

Implements org.hibernate.NaturalIdMultiLoadAccess.multiLoad.

Doc from org.hibernate.NaturalIdMultiLoadAccess.multiLoad.

Retrieve the entities with the given natural id values.

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

Parameters
ids:List<?>

The natural id values to load

Returns:List<T>

The managed entities.

Annotations
@Override
withback to summary
public NaturalIdMultiLoadAccess<T> with(LockOptions lockOptions)

Implements org.hibernate.NaturalIdMultiLoadAccess.with.

Doc from org.hibernate.NaturalIdMultiLoadAccess.with.

Specify the lock options to use when querying the database.

Parameters
lockOptions:LockOptions

The lock options to use

Returns:NaturalIdMultiLoadAccess<T>

this, for method chaining

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

Implements org.hibernate.NaturalIdMultiLoadAccess.with.

Doc from org.hibernate.NaturalIdMultiLoadAccess.with.

Specify the CacheMode to use when obtaining an entity.

Parameters
cacheMode:CacheMode

The CacheMode to use

Returns:NaturalIdMultiLoadAccess<T>

this, for method chaining

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

Implements org.hibernate.NaturalIdMultiLoadAccess.with.

Doc from org.hibernate.NaturalIdMultiLoadAccess.with.

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

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

Implements org.hibernate.NaturalIdMultiLoadAccess.withBatchSize.

Doc from org.hibernate.NaturalIdMultiLoadAccess.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:NaturalIdMultiLoadAccess<T>

this, for method chaining

Annotations
@Override