Top Description Fields Constructors Methods
org.hibernate.persister.entity

public final Class NamedQueryLoader

extends Object
implements UniqueEntityLoader
Class Inheritance
All Implemented Interfaces
org.hibernate.loader.entity.UniqueEntityLoader
Imports
java.io.Serializable, org.hibernate.FlushMode, .LockOptions, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.loader.entity.UniqueEntityLoader, org.hibernate.query.internal.AbstractProducedQuery

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 org.hibernate.annotations.Loader or <loader/>).
Authors
Gavin King, Steve Ebersole

Field Summary

Modifier and TypeField and Description
private static final CoreMessageLogger
private final EntityPersister
private final int
private final String

Constructor Summary

AccessConstructor and Description
public
NamedQueryLoader(String
The name of the named query to use
queryName
,
EntityPersister
The corresponding persister for the entity we are loading
persister
)

Constructs the NamedQueryLoader

Method Summary

Modifier and TypeMethod and Description
public Object
load(Serializable
The id to be loaded
id
,
Object
The (optional) entity instance in to which to load the state
optionalObject
,
SharedSessionContractImplementor
The session from which the request originated
session
,
LockOptions
The lock options.
lockOptions
)

Implements org.hibernate.loader.entity.UniqueEntityLoader.load.

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.
public Object
public Object
load(Serializable id, Object optionalObject, SharedSessionContractImplementor session)

Implements org.hibernate.loader.entity.UniqueEntityLoader.load.

Load an entity instance.
public Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final CoreMessageLogger LOG
persisterback to summary
private final EntityPersister persister
positionback to summary
private final int position
queryNameback to summary
private final String queryName

Constructor Detail

NamedQueryLoaderback to summary
public NamedQueryLoader(String queryName, EntityPersister persister)

Constructs the NamedQueryLoader

Parameters
queryName:String

The name of the named query to use

persister:EntityPersister

The corresponding persister for the entity we are loading

Method Detail

loadback to summary
public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions)

Implements org.hibernate.loader.entity.UniqueEntityLoader.load.

Doc from org.hibernate.loader.entity.UniqueEntityLoader.load.

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.

Parameters
id:Serializable

The id to be loaded

optionalObject:Object

The (optional) entity instance in to which to load the state

session:SharedSessionContractImplementor

The session from which the request originated

lockOptions:LockOptions

The lock options.

Returns:Object

The loaded entity

Annotations
@Override
loadback to summary
public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, LockOptions lockOptions, Boolean readOnly)

Overrides default org.hibernate.loader.entity.UniqueEntityLoader.load.

Annotations
@Override
loadback to summary
public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session)

Implements org.hibernate.loader.entity.UniqueEntityLoader.load.

Doc from org.hibernate.loader.entity.UniqueEntityLoader.load.

Load an entity instance. If optionalObject is supplied, load the entity state into the given (uninitialized) object.

Annotations
@Override
loadback to summary
public Object load(Serializable id, Object optionalObject, SharedSessionContractImplementor session, Boolean readOnly)

Overrides default org.hibernate.loader.entity.UniqueEntityLoader.load.

Annotations
@Override