public final class NamedQueryLoader extends 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 (using Loader or <loader/>).
| Constructor and Description |
|---|
NamedQueryLoader(String queryName,
EntityPersister persister)
Constructs the NamedQueryLoader
|
| Modifier and Type | Method and Description |
|---|---|
Object |
load(Serializable id,
Object optionalObject,
SharedSessionContractImplementor session)
Load an entity instance.
|
Object |
load(Serializable id,
Object optionalObject,
SharedSessionContractImplementor session,
LockOptions lockOptions)
Load an entity instance by id.
|
public NamedQueryLoader(String queryName, EntityPersister persister)
Constructs the NamedQueryLoader
queryName - The name of the named query to usepersister - The corresponding persister for the entity we are loadingpublic Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions)
UniqueEntityLoaderLoad an entity instance by id. If <tt>optionalObject</tt> is supplied (non-<tt>null</tt>, the entity state is loaded into that object instance instead of instantiating a new one.
load in interface UniqueEntityLoaderid - 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.public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session)
UniqueEntityLoaderLoad an entity instance. If <tt>optionalObject</tt> is supplied, load the entity state into the given (uninitialized) object.
load in interface UniqueEntityLoaderCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.