Package org.hibernate.persister.entity
Class NamedQueryLoader
- java.lang.Object
-
- org.hibernate.persister.entity.NamedQueryLoader
-
- All Implemented Interfaces:
UniqueEntityLoader
public final class NamedQueryLoader extends java.lang.Object implements UniqueEntityLoader
Not really a Loader, just a wrapper around a named query. Used when the metadata has named a query to use for loading an entity (usingLoader
or<loader/>
).
-
-
Constructor Summary
Constructors Constructor Description NamedQueryLoader(java.lang.String queryName, EntityPersister persister)
Constructs the NamedQueryLoader
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
load(java.io.Serializable id, java.lang.Object optionalObject, SharedSessionContractImplementor session)
Load an entity instance.java.lang.Object
load(java.io.Serializable id, java.lang.Object optionalObject, SharedSessionContractImplementor session, java.lang.Boolean readOnly)
java.lang.Object
load(java.io.Serializable id, java.lang.Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions)
Load an entity instance by id.java.lang.Object
load(java.io.Serializable id, java.lang.Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions, java.lang.Boolean readOnly)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.loader.entity.UniqueEntityLoader
load
-
-
-
-
Constructor Detail
-
NamedQueryLoader
public NamedQueryLoader(java.lang.String queryName, EntityPersister persister)
Constructs the NamedQueryLoader- Parameters:
queryName
- The name of the named query to usepersister
- The corresponding persister for the entity we are loading
-
-
Method Detail
-
load
public java.lang.Object load(java.io.Serializable id, java.lang.Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions)
Description copied from interface:UniqueEntityLoader
Load an entity instance by id. If optionalObject is supplied (non-null, the entity state is loaded into that object instance instead of instantiating a new one.- Specified by:
load
in interfaceUniqueEntityLoader
- Parameters:
id
- The id to be loadedoptionalObject
- The (optional) entity instance in to which to load the statesession
- The session from which the request originatedlockOptions
- The lock options.- Returns:
- The loaded entity
-
load
public java.lang.Object load(java.io.Serializable id, java.lang.Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions, java.lang.Boolean readOnly)
- Specified by:
load
in interfaceUniqueEntityLoader
-
load
public java.lang.Object load(java.io.Serializable id, java.lang.Object optionalObject, SharedSessionContractImplementor session)
Description copied from interface:UniqueEntityLoader
Load an entity instance. If optionalObject is supplied, load the entity state into the given (uninitialized) object.- Specified by:
load
in interfaceUniqueEntityLoader
-
load
public java.lang.Object load(java.io.Serializable id, java.lang.Object optionalObject, SharedSessionContractImplementor session, java.lang.Boolean readOnly)
- Specified by:
load
in interfaceUniqueEntityLoader
-
-