Class EntityBatchLoaderInPredicate<T>
- java.lang.Object
-
- org.hibernate.loader.ast.internal.SingleIdEntityLoaderSupport<T>
-
- org.hibernate.loader.ast.internal.AbstractEntityBatchLoader<T>
-
- org.hibernate.loader.ast.internal.EntityBatchLoaderInPredicate<T>
-
- All Implemented Interfaces:
Preparable
,BatchLoader
,EntityBatchLoader<T>
,EntityLoader
,Loader
,MultiKeyLoader
,SingleEntityLoader<T>
,SingleIdEntityLoader<T>
,SqlInPredicateMultiKeyLoader
public class EntityBatchLoaderInPredicate<T> extends AbstractEntityBatchLoader<T> implements SqlInPredicateMultiKeyLoader, Preparable
An EntityBatchLoader using one or more SQL queries, which each initialize up to getSqlBatchSize() entities using a SQL IN predicate restriction - e.g.,... where id in (?,?,...)
. The number of parameters rendered into the SQL is controlled by getSqlBatchSize(). Any unused parameter slots for a particular execution are set tonull
.
-
-
Field Summary
-
Fields inherited from class org.hibernate.loader.ast.internal.AbstractEntityBatchLoader
singleIdLoader
-
Fields inherited from class org.hibernate.loader.ast.internal.SingleIdEntityLoaderSupport
sessionFactory
-
-
Constructor Summary
Constructors Constructor Description EntityBatchLoaderInPredicate(int domainBatchSize, int sqlBatchSize, EntityMappingType entityDescriptor, SessionFactoryImplementor sessionFactory)
-
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.int
getSqlBatchSize()
protected void
initializeEntities(Object[] idsToInitialize, Object pkValue, Object entityInstance, LockOptions lockOptions, Boolean readOnly, SharedSessionContractImplementor session)
T
load(Object pkValue, Object entityInstance, LockOptions lockOptions, Boolean readOnly, SharedSessionContractImplementor session)
T
load(Object pkValue, LockOptions lockOptions, Boolean readOnly, SharedSessionContractImplementor session)
Load by primary key valuevoid
prepare()
Perform the preparationprotected Object[]
resolveIdsToLoad(Object pkValue, SharedSessionContractImplementor session)
String
toString()
-
Methods inherited from class org.hibernate.loader.ast.internal.AbstractEntityBatchLoader
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
-
EntityBatchLoaderInPredicate
public EntityBatchLoaderInPredicate(int domainBatchSize, int sqlBatchSize, EntityMappingType entityDescriptor, SessionFactoryImplementor sessionFactory)
- Parameters:
domainBatchSize
- The maximum number of entities we will initialize for eachload
sqlBatchSize
- The number of keys our SQL AST should be able to fetch
-
-
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
-
getSqlBatchSize
public int getSqlBatchSize()
-
load
public final 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>
-
load
public final T load(Object pkValue, Object entityInstance, LockOptions lockOptions, Boolean readOnly, SharedSessionContractImplementor session)
- Specified by:
load
in interfaceSingleIdEntityLoader<T>
-
resolveIdsToLoad
protected Object[] resolveIdsToLoad(Object pkValue, SharedSessionContractImplementor session)
-
initializeEntities
protected void initializeEntities(Object[] idsToInitialize, Object pkValue, Object entityInstance, LockOptions lockOptions, Boolean readOnly, SharedSessionContractImplementor session)
-
prepare
public void prepare()
Description copied from interface:Preparable
Perform the preparation- Specified by:
prepare
in interfacePreparable
-
-