java.lang.Object | |
↳ | org.hibernate.loader.Loader |
![]() |
![]() |
Abstract superclass of object loading (and querying) strategies. This class implements
useful common functionality that concrete loaders delegate to. It is not intended that this
functionality would be directly accessed by client code. (Hence, all methods of this class
are declared protected or private.) This class relies heavily upon the
Loadable interface, which is the contract between this class and
EntityPersisters that may be loaded by it.
The present implementation is able to load any number of columns of entities and at most
one collection role per query.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called by subclasses that initialize collections
| |||||||||||
Called by wrappers that batch initialize collections
| |||||||||||
Called by wrappers that batch load entities
| |||||||||||
Loads a single logical row from the result set moving forward.
| |||||||||||
Loads a single logical row from the result set moving forward.
| |||||||||||
Loads a single row from the result set.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Append FOR UPDATE OF clause, if necessary.
| |||||||||||
Are rows transformed immediately after being read from the ResultSet?
| |||||||||||
Bind named parameters to the JDBC prepared statement.
| |||||||||||
Bind all parameter values into the prepared statement in preparation
for execution.
| |||||||||||
Bind positional parameter values to the JDBC prepared statement.
| |||||||||||
Check whether the current loader can support returning ScrollableResults.
| |||||||||||
Actually execute a query, ignoring the query cache
| |||||||||||
Get the SQL table aliases of entities whose
associations are subselect-loadable, returning
null if this loader does not support subselect
loading
| |||||||||||
Get the index of the entity that owns the collection, or -1
if there is no owner in the query results (ie.
| |||||||||||
An (optional) persister for a collection to be initialized; only
collection loaders return a non-null value
| |||||||||||
Get the result set descriptor
| |||||||||||
An array indicating whether the entities have eager property fetching
enabled.
| |||||||||||
An array of persisters of entity classes contained in each row of results;
implemented by all subclasses
| |||||||||||
What lock options does this load entities with?
| |||||||||||
An array of the owner types corresponding to the
getOwners()
returns. | |||||||||||
An array of indexes of the entity that owns a one-to-one association
to the entity at the given index (-1 if there is no "owner").
| |||||||||||
Identifies the query for statistics reporting, if null,
no statistics will be reported
| |||||||||||
Get the actual object that is returned in the user-visible result list.
| |||||||||||
Fetch a PreparedStatement, call setMaxRows and then execute it,
advance to the first result and return an SQL ResultSet
| |||||||||||
The SQL query string to be called; implemented by all subclasses
| |||||||||||
Return false is this loader is a batch entity loader
| |||||||||||
Return the query results, using the query cache, called
by subclasses that implement cacheable queries
| |||||||||||
Called by subclasses that batch initialize collections
| |||||||||||
Called by subclasses that load entities
| |||||||||||
Called by subclasses that load entities
| |||||||||||
Does the result set to be scrolled contain collection fetches?
| |||||||||||
Calculate and cache select-clause suffixes.
| |||||||||||
Obtain a PreparedStatement with all parameters pre-bound.
| |||||||||||
Modify the SQL, adding lock hints and comments, if necessary
| |||||||||||
Determine the actual ResultTransformer that will be used to
transform query results.
| |||||||||||
Return the query results, as an instance of ScrollableResults
| |||||||||||
Does this query return objects that might be already cached
by the session, whose lock mode may need upgrading
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Called by subclasses that initialize collections
HibernateException |
---|
Called by wrappers that batch initialize collections
HibernateException |
---|
Called by wrappers that batch load entities
persister | only needed for logging |
---|
HibernateException |
---|
Loads a single logical row from the result set moving forward. This is the processing used from the ScrollableResults where there were collection fetches encountered; thus a single logical row may have multiple rows in the underlying result set.
resultSet | The result set from which to do the load. |
---|---|
session | The session from which the request originated. |
queryParameters | The query parameters specified by the user. |
returnProxies | Should proxies be generated |
HibernateException |
---|
Loads a single logical row from the result set moving forward. This is the processing used from the ScrollableResults where there were collection fetches encountered; thus a single logical row may have multiple rows in the underlying result set.
resultSet | The result set from which to do the load. |
---|---|
session | The session from which the request originated. |
queryParameters | The query parameters specified by the user. |
returnProxies | Should proxies be generated |
HibernateException |
---|
Loads a single row from the result set. This is the processing used from the ScrollableResults where no collection fetches were encountered.
resultSet | The result set from which to do the load. |
---|---|
session | The session from which the request originated. |
queryParameters | The query parameters specified by the user. |
returnProxies | Should proxies be generated |
HibernateException |
---|
Append FOR UPDATE OF clause, if necessary. This empty superclass implementation merely returns its first argument.
HibernateException |
---|
Are rows transformed immediately after being read from the ResultSet?
transformer | the specified transformer |
---|
Bind named parameters to the JDBC prepared statement.
This is a generic implementation, the problem being that in the general case we do not know enough information about the named parameters to perform this in a complete manner here. Thus this is generally overridden on subclasses allowing named parameters to apply the specific behavior. The most usual limitation here is that we need to assume the type span is always one...statement | The JDBC prepared statement |
---|---|
namedParams | A map of parameter names to values |
startIndex | The position from which to start binding parameter values. |
session | The originating session. |
SQLException | Indicates problems performing the binding. |
---|---|
HibernateException | Indicates problems delegating binding to the types. |
Bind all parameter values into the prepared statement in preparation for execution.
statement | The JDBC prepared statement |
---|---|
queryParameters | The encapsulation of the parameter values to be bound. |
startIndex | The position from which to start binding parameter values. |
session | The originating session. |
SQLException | Indicates problems performing the binding. |
---|
Bind positional parameter values to the JDBC prepared statement.
Positional parameters are those specified by JDBC-style ? parameters in the source query. It is (currently) expected that these come before any named parameters in the source query.statement | The JDBC prepared statement |
---|---|
queryParameters | The encapsulation of the parameter values to be bound. |
startIndex | The position from which to start binding parameter values. |
session | The originating session. |
SQLException | Indicates problems performing the binding. |
---|---|
HibernateException | Indicates problems delegating binding to the types. |
Check whether the current loader can support returning ScrollableResults.
HibernateException |
---|
Actually execute a query, ignoring the query cache
HibernateException |
---|
SQLException |
---|
Get the SQL table aliases of entities whose associations are subselect-loadable, returning null if this loader does not support subselect loading
Get the index of the entity that owns the collection, or -1 if there is no owner in the query results (ie. in the case of a collection initializer) or no collection.
An (optional) persister for a collection to be initialized; only collection loaders return a non-null value
An array indicating whether the entities have eager property fetching enabled.
An array of persisters of entity classes contained in each row of results; implemented by all subclasses
What lock options does this load entities with?
lockOptions | a collection of lock options specified dynamically via the Query interface |
---|
An array of the owner types corresponding to the getOwners()
returns. Indices indicating no owner would be null here.
An array of indexes of the entity that owns a one-to-one association
to the entity at the given index (-1 if there is no "owner"). The
indexes contained here are relative to the result of
getEntityPersisters()
.
Identifies the query for statistics reporting, if null, no statistics will be reported
Get the actual object that is returned in the user-visible result list. This empty implementation merely returns its first argument. This is overridden by some subclasses.
HibernateException | |
---|---|
SQLException |
QueryException |
---|
Fetch a PreparedStatement, call setMaxRows and then execute it, advance to the first result and return an SQL ResultSet
HibernateException | |
---|---|
SQLException |
The SQL query string to be called; implemented by all subclasses
Return false is this loader is a batch entity loader
Return the query results, using the query cache, called by subclasses that implement cacheable queries
HibernateException |
---|
Called by subclasses that batch initialize collections
HibernateException |
---|
Called by subclasses that load entities
persister | only needed for logging |
---|
HibernateException |
---|
Called by subclasses that load entities
persister | only needed for logging |
---|
HibernateException |
---|
Does the result set to be scrolled contain collection fetches?
Calculate and cache select-clause suffixes. Must be called by subclasses after instantiation.
Obtain a PreparedStatement with all parameters pre-bound. Bind JDBC-style ? parameters, named parameters, and limit parameters.
HibernateException | |
---|---|
SQLException |
Modify the SQL, adding lock hints and comments, if necessary
HibernateException |
---|
Determine the actual ResultTransformer that will be used to transform query results.
resultTransformer | the specified result transformer |
---|
Return the query results, as an instance of ScrollableResults
queryParameters | The parameters with which the query should be executed. |
---|---|
returnTypes | The expected return types of the query |
holderInstantiator | If the return values are expected to be wrapped in a holder, this is the thing that knows how to wrap them. |
session | The session from which the scroll request originated. |
HibernateException | Indicates an error executing the query, or constructing the ScrollableResults. |
---|
Does this query return objects that might be already cached by the session, whose lock mode may need upgrading