Package org.hibernate.loader.custom
Class CustomLoader
java.lang.Object
org.hibernate.loader.Loader
org.hibernate.loader.custom.CustomLoader
Extension point for loaders which use a SQL result set with "unexpected" column aliases.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected CollectionAliases[]protected int[]Get the index of the entity that owns the collection, or -1 if there is no owner in the query results (ie.protected CollectionPersister[]An (optional) persister for a collection to be initialized; only collection loaders return a non-null valueprotected EntityAliases[]Get the result set descriptorprotected Loadable[]An array of persisters of entity classes contained in each row of results; implemented by all subclassesprotected LockMode[]getLockModes(LockOptions lockOptions) What lock options does this load entities with?int[]getNamedParameterLocs(String name) protected int[]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 StringIdentifies the query for statistics reporting, if null, no statistics will be reportedprotected ObjectgetResultColumnOrRow(Object[] row, ResultTransformer transformer, ResultSet rs, SessionImplementor session) Get the actual object that is returned in the user-visible result list.protected ListgetResultList(List results, ResultTransformer resultTransformer) protected StringThe SQL query string to be called; implemented by all subclasseslist(SessionImplementor session, QueryParameters queryParameters) protected ResultTransformerresolveResultTransformer(ResultTransformer resultTransformer) Determine the actual ResultTransformer that will be used to transform query results.scroll(QueryParameters queryParameters, SessionImplementor session) Methods inherited from class org.hibernate.loader.Loader
applyLocks, applyPostLoadLocks, areResultSetRowsTransformedImmediately, bindNamedParameters, bindParameterValues, bindPositionalParameters, checkScrollability, doList, extractKeysFromResultSet, getAliases, getCompositeKeyManyToOneTargetIndices, getEntityEagerPropertyFetches, getFactory, getOwnerAssociationTypes, getResultSet, hasSubselectLoadableCollections, isSingleRowLoader, isSubselectLoadingEnabled, list, loadCollection, loadCollectionBatch, loadCollectionSubselect, loadEntity, loadEntity, loadEntityBatch, loadSequentialRowsForward, loadSequentialRowsReverse, loadSingleRow, needsFetchingScroll, postInstantiate, prepareQueryStatement, preprocessSQL, scroll, toString, upgradeLocks
-
Constructor Details
-
CustomLoader
-
-
Method Details
-
getQueryIdentifier
Description copied from class:LoaderIdentifies the query for statistics reporting, if null, no statistics will be reported- Overrides:
getQueryIdentifierin classLoader
-
getSQLString
Description copied from class:LoaderThe SQL query string to be called; implemented by all subclasses- Specified by:
getSQLStringin classLoader- Returns:
- The sql command this loader should use to get its
ResultSet.
-
getQuerySpaces
-
getLockModes
Description copied from class:LoaderWhat lock options does this load entities with?- Specified by:
getLockModesin classLoader- Parameters:
lockOptions- a collection of lock options specified dynamically via the Query interface
-
getEntityPersisters
Description copied from class:LoaderAn array of persisters of entity classes contained in each row of results; implemented by all subclasses- Specified by:
getEntityPersistersin classLoader- Returns:
- The entity persisters.
-
getCollectionPersisters
Description copied from class:LoaderAn (optional) persister for a collection to be initialized; only collection loaders return a non-null value- Overrides:
getCollectionPersistersin classLoader
-
getCollectionOwners
protected int[] getCollectionOwners()Description copied from class:LoaderGet 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.- Overrides:
getCollectionOwnersin classLoader
-
getOwners
protected int[] getOwners()Description copied from class:LoaderAn 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 ofLoader.getEntityPersisters(). -
list
public List list(SessionImplementor session, QueryParameters queryParameters) throws HibernateException - Throws:
HibernateException
-
scroll
public ScrollableResults scroll(QueryParameters queryParameters, SessionImplementor session) throws HibernateException - Throws:
HibernateException
-
resolveResultTransformer
Description copied from class:LoaderDetermine the actual ResultTransformer that will be used to transform query results.- Overrides:
resolveResultTransformerin classLoader- Parameters:
resultTransformer- the specified result transformer- Returns:
- the actual result transformer
-
getResultColumnOrRow
protected Object getResultColumnOrRow(Object[] row, ResultTransformer transformer, ResultSet rs, SessionImplementor session) throws SQLException, HibernateException Description copied from class:LoaderGet 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.- Overrides:
getResultColumnOrRowin classLoader- Throws:
SQLExceptionHibernateException
-
getResultList
protected List getResultList(List results, ResultTransformer resultTransformer) throws QueryException - Overrides:
getResultListin classLoader- Throws:
QueryException
-
getEntityAliases
Description copied from class:LoaderGet the result set descriptor- Specified by:
getEntityAliasesin classLoader
-
getCollectionAliases
- Specified by:
getCollectionAliasesin classLoader
-
getNamedParameterLocs
- Overrides:
getNamedParameterLocsin classLoader- Throws:
QueryException
-
autoDiscoverTypes
- Overrides:
autoDiscoverTypesin classLoader
-