Class EntityBatchLoaderArrayParam<T>
- java.lang.Object
-
- org.hibernate.loader.ast.internal.SingleIdEntityLoaderSupport<T>
-
- org.hibernate.loader.ast.internal.AbstractEntityBatchLoader<T>
-
- org.hibernate.loader.ast.internal.EntityBatchLoaderArrayParam<T>
-
- All Implemented Interfaces:
BatchLoader
,EntityBatchLoader<T>
,EntityLoader
,Loader
,MultiKeyLoader
,SingleEntityLoader<T>
,SingleIdEntityLoader<T>
,SqlArrayMultiKeyLoader
public class EntityBatchLoaderArrayParam<T> extends AbstractEntityBatchLoader<T> implements SqlArrayMultiKeyLoader
SingleIdEntityLoaderSupport
implementation based on using a single array parameter to pass the entire batch of ids.
-
-
Field Summary
-
Fields inherited from class org.hibernate.loader.ast.internal.SingleIdEntityLoaderSupport
sessionFactory
-
-
Constructor Summary
Constructors Constructor Description EntityBatchLoaderArrayParam(int domainBatchSize, EntityMappingType entityDescriptor, SessionFactoryImplementor sessionFactory)
Instantiates the loader
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDomainBatchSize()
The total number of loadable references that can be initialized per each load operation.protected void
initializeEntities(Object[] idsToInitialize, Object id, Object entityInstance, LockOptions lockOptions, Boolean readOnly, SharedSessionContractImplementor session)
T
load(Object pkValue, LockOptions lockOptions, Boolean readOnly, SharedSessionContractImplementor session)
Load by primary key valueprotected Object[]
resolveIdsToInitialize(Object pkValue, SharedSessionContractImplementor session)
String
toString()
-
Methods inherited from class org.hibernate.loader.ast.internal.AbstractEntityBatchLoader
load, load
-
Methods inherited from class org.hibernate.loader.ast.internal.SingleIdEntityLoaderSupport
getLoadable, loadDatabaseSnapshot
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.loader.ast.spi.SingleEntityLoader
getLoadable
-
Methods inherited from interface org.hibernate.loader.ast.spi.SingleIdEntityLoader
loadDatabaseSnapshot
-
-
-
-
Constructor Detail
-
EntityBatchLoaderArrayParam
public EntityBatchLoaderArrayParam(int domainBatchSize, EntityMappingType entityDescriptor, SessionFactoryImplementor sessionFactory)
Instantiates the loader- Parameters:
domainBatchSize
- The number of domain model parts (up to)- Implementation Note:
- We delay initializing the internal SQL AST state until first use. Creating
the SQL AST internally relies on the entity's
EntityIdentifierMapping
. However, we do create the static batch-loader for the entity in the persister constructor andEntityIdentifierMapping
is not available at that time. On first use, we know we have it available
-
-
Method Detail
-
getDomainBatchSize
public int getDomainBatchSize()
Description copied from interface:BatchLoader
The total number of loadable references that can be initialized per each load operation.- Specified by:
getDomainBatchSize
in interfaceBatchLoader
-
resolveIdsToInitialize
protected Object[] resolveIdsToInitialize(Object pkValue, SharedSessionContractImplementor session)
- Specified by:
resolveIdsToInitialize
in classAbstractEntityBatchLoader<T>
-
initializeEntities
protected void initializeEntities(Object[] idsToInitialize, Object id, Object entityInstance, LockOptions lockOptions, Boolean readOnly, SharedSessionContractImplementor session)
- Specified by:
initializeEntities
in classAbstractEntityBatchLoader<T>
-
load
public T load(Object pkValue, LockOptions lockOptions, Boolean readOnly, SharedSessionContractImplementor session)
Description copied from interface:SingleIdEntityLoader
Load by primary key value- Specified by:
load
in interfaceSingleEntityLoader<T>
- Specified by:
load
in interfaceSingleIdEntityLoader<T>
-
-