|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.loader.Loader
org.hibernate.loader.custom.CustomLoader
public class CustomLoader
Extension point for loaders which use a SQL result set with "unexpected" column aliases.
| Nested Class Summary | |
|---|---|
class |
CustomLoader.NonScalarResultColumnProcessor
|
class |
CustomLoader.ResultRowProcessor
|
class |
CustomLoader.ScalarResultColumnProcessor
|
| Nested classes/interfaces inherited from class org.hibernate.loader.Loader |
|---|
Loader.AfterLoadAction, Loader.SqlStatementWrapper |
| Field Summary |
|---|
| Fields inherited from class org.hibernate.loader.Loader |
|---|
DEBUG_ENABLED, LOG |
| Constructor Summary | |
|---|---|
CustomLoader(CustomQuery customQuery,
SessionFactoryImplementor factory)
|
|
| Method Summary | |
|---|---|
protected String |
applyLocks(String sql,
QueryParameters parameters,
Dialect dialect,
List<Loader.AfterLoadAction> afterLoadActions)
Append FOR UPDATE OF clause, if necessary. |
protected void |
autoDiscoverTypes(ResultSet rs)
|
protected CollectionAliases[] |
getCollectionAliases()
|
protected int[] |
getCollectionOwners()
Get the index of the entity that owns the collection, or -1 if there is no owner in the query results (ie. |
protected CollectionPersister[] |
getCollectionPersisters()
An (optional) persister for a collection to be initialized; only collection loaders return a non-null value |
protected EntityAliases[] |
getEntityAliases()
Get the result set descriptor |
protected Loadable[] |
getEntityPersisters()
An array of persisters of entity classes contained in each row of results; implemented by all subclasses |
protected LockMode[] |
getLockModes(LockOptions lockOptions)
What lock options does this load entities with? |
int[] |
getNamedParameterLocs(String name)
|
protected int[] |
getOwners()
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"). |
protected String |
getQueryIdentifier()
Identifies the query for statistics reporting, if null, no statistics will be reported |
Set |
getQuerySpaces()
|
protected Object |
getResultColumnOrRow(Object[] row,
ResultTransformer transformer,
ResultSet rs,
SessionImplementor session)
Get the actual object that is returned in the user-visible result list. |
protected List |
getResultList(List results,
ResultTransformer resultTransformer)
|
protected Object[] |
getResultRow(Object[] row,
ResultSet rs,
SessionImplementor session)
|
protected String[] |
getResultRowAliases()
Returns the aliases that corresponding to a result row. |
String |
getSQLString()
The SQL query string to be called; implemented by all subclasses |
protected boolean[] |
includeInResultRow()
|
List |
list(SessionImplementor session,
QueryParameters queryParameters)
|
protected void |
putResultInQueryCache(SessionImplementor session,
QueryParameters queryParameters,
Type[] resultTypes,
QueryCache queryCache,
QueryKey key,
List result)
resultTypes can be overridden by autoDiscoverTypes(ResultSet),
*after* list(SessionImplementor, QueryParameters) has already been called. |
protected ResultTransformer |
resolveResultTransformer(ResultTransformer resultTransformer)
Determine the actual ResultTransformer that will be used to transform query results. |
ScrollableResults |
scroll(QueryParameters queryParameters,
SessionImplementor session)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public CustomLoader(CustomQuery customQuery,
SessionFactoryImplementor factory)
| Method Detail |
|---|
protected String getQueryIdentifier()
Loader
getQueryIdentifier in class Loaderpublic String getSQLString()
Loader
getSQLString in class LoaderResultSet.public Set getQuerySpaces()
protected LockMode[] getLockModes(LockOptions lockOptions)
Loader
getLockModes in class LoaderlockOptions - a collection of lock options specified dynamically via the Query interfaceprotected Loadable[] getEntityPersisters()
Loader
getEntityPersisters in class Loaderprotected CollectionPersister[] getCollectionPersisters()
Loader
getCollectionPersisters in class Loaderprotected int[] getCollectionOwners()
Loader
getCollectionOwners in class Loaderprotected int[] getOwners()
LoaderLoader.getEntityPersisters().
getOwners in class Loader
public List list(SessionImplementor session,
QueryParameters queryParameters)
throws HibernateException
HibernateException
protected String applyLocks(String sql,
QueryParameters parameters,
Dialect dialect,
List<Loader.AfterLoadAction> afterLoadActions)
throws QueryException
Loader
applyLocks in class LoaderQueryException
public ScrollableResults scroll(QueryParameters queryParameters,
SessionImplementor session)
throws HibernateException
HibernateExceptionprotected String[] getResultRowAliases()
Loader
getResultRowAliases in class Loaderprotected ResultTransformer resolveResultTransformer(ResultTransformer resultTransformer)
Loader
resolveResultTransformer in class LoaderresultTransformer - the specified result transformer
protected boolean[] includeInResultRow()
includeInResultRow in class Loader
protected Object getResultColumnOrRow(Object[] row,
ResultTransformer transformer,
ResultSet rs,
SessionImplementor session)
throws SQLException,
HibernateException
Loader
getResultColumnOrRow in class LoaderSQLException
HibernateException
protected Object[] getResultRow(Object[] row,
ResultSet rs,
SessionImplementor session)
throws SQLException,
HibernateException
getResultRow in class LoaderSQLException
HibernateException
protected List getResultList(List results,
ResultTransformer resultTransformer)
throws QueryException
getResultList in class LoaderQueryExceptionprotected EntityAliases[] getEntityAliases()
Loader
getEntityAliases in class Loaderprotected CollectionAliases[] getCollectionAliases()
getCollectionAliases in class Loader
public int[] getNamedParameterLocs(String name)
throws QueryException
getNamedParameterLocs in class LoaderQueryExceptionprotected void autoDiscoverTypes(ResultSet rs)
autoDiscoverTypes in class Loader
protected void putResultInQueryCache(SessionImplementor session,
QueryParameters queryParameters,
Type[] resultTypes,
QueryCache queryCache,
QueryKey key,
List result)
resultTypes can be overridden by autoDiscoverTypes(ResultSet),
*after* list(SessionImplementor, QueryParameters) has already been called. It's a bit of a
chicken-and-the-egg issue since autoDiscoverTypes(ResultSet) needs the ResultSet.
As a hacky workaround, override
putResultInQueryCache(SessionImplementor, QueryParameters, Type[], QueryCache, QueryKey, List) here
and provide the resultTypes.
putResultInQueryCache in class LoaderHHH-3051
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||