Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hibernate.loader.custom
Class CustomLoader

    java.lang.Object
      org.hibernate.loader.Loader
          org.hibernate.loader.custom.CustomLoader

    public class CustomLoader

extends Loader

Extension point for loaders which use a SQL result set with "unexpected" column aliases.

Author:
  Gavin King, Steve Ebersole

Nested Class Summary
`class` | `CustomLoader.NonScalarResultColumnProcessor`
`class` | `CustomLoader.ResultRowProcessor`
`class` | `CustomLoader.ScalarResultColumnProcessor`

Constructor Summary
`CustomLoader(CustomQuery customQuery, SessionFactoryImplementor factory)`

Method Summary
`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(Map lockModesMap)` What lock mode 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 String` | `getSQLString()` The SQL query string to be called; implemented by all subclasses
`List` | `list(SessionImplementor session, QueryParameters queryParameters)`
`ScrollableResults` | `scroll(QueryParameters queryParameters, SessionImplementor session)`

Methods inherited from class org.hibernate.loader.Loader
`applyLocks, bindNamedParameters, bindParameterValues, bindPositionalParameters, checkScrollability, doList, getAliases, getEntityEagerPropertyFetches, getFactory, getOwnerAssociationTypes, getResultSet, hasSubselectLoadableCollections, isSingleRowLoader, isSubselectLoadingEnabled, list, loadCollection, loadCollectionBatch, loadCollectionSubselect, loadEntity, loadEntity, loadEntityBatch, loadSequentialRowsForward, loadSequentialRowsReverse, loadSingleRow, needsFetchingScroll, postInstantiate, prepareQueryStatement, preprocessSQL, processFilters, scroll, toString, upgradeLocks`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### CustomLoader

    public CustomLoader(CustomQuery customQuery,
                        SessionFactoryImplementor factory)

Method Detail

### getQueryIdentifier

    protected String getQueryIdentifier()

  Description copied from class: `Loader`
  Identifies the query for statistics reporting, if null, no statistics will be reported

  Overrides:
    `getQueryIdentifier` in class `Loader`

### getSQLString

    protected String getSQLString()

  Description copied from class: `Loader`
  The SQL query string to be called; implemented by all subclasses

  Specified by:
    `getSQLString` in class `Loader`
  Returns:
    The sql command this loader should use to get its `ResultSet`.

### getQuerySpaces

    public Set getQuerySpaces()

### getLockModes

    protected LockMode[] getLockModes(Map lockModesMap)

  Description copied from class: `Loader`
  What lock mode does this load entities with?

  Specified by:
    `getLockModes` in class `Loader`
  Parameters:
    `lockModesMap` - a collection of lock modes specified dynamically via the Query interface

### getEntityPersisters

    protected Loadable[] getEntityPersisters()

  Description copied from class: `Loader`
  An array of persisters of entity classes contained in each row of results; implemented by all subclasses

  Specified by:
    `getEntityPersisters` in class `Loader`
  Returns:
    The entity persisters.

### getCollectionPersisters

    protected CollectionPersister[] getCollectionPersisters()

  Description copied from class: `Loader`
  An (optional) persister for a collection to be initialized; only collection loaders return a non-null value

  Overrides:
    `getCollectionPersisters` in class `Loader`

### getCollectionOwners

    protected int[] getCollectionOwners()

  Description copied from class: `Loader`
  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.

  Overrides:
    `getCollectionOwners` in class `Loader`

### getOwners

    protected int[] getOwners()

  Description copied from class: `Loader`
  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 `Loader.getEntityPersisters()`.

  Overrides:
    `getOwners` in class `Loader`
  Returns:
    The owner indicators (see discussion above).

### list

    public List list(SessionImplementor session,
                     QueryParameters queryParameters)
              throws HibernateException

  Throws:
    `HibernateException`

### scroll

    public ScrollableResults scroll(QueryParameters queryParameters,
                                    SessionImplementor session)
                             throws HibernateException

  Throws:
    `HibernateException`

### getResultColumnOrRow

    protected Object getResultColumnOrRow(Object[] row,
                                          ResultTransformer transformer,
                                          ResultSet rs,
                                          SessionImplementor session)
                                   throws SQLException,
                                          HibernateException

  Description copied from class: `Loader`
  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.

  Overrides:
    `getResultColumnOrRow` in class `Loader`
  Throws:
    `SQLException`
    `HibernateException`

### getResultList

    protected List getResultList(List results,
                                 ResultTransformer resultTransformer)
                          throws QueryException

  Overrides:
    `getResultList` in class `Loader`
  Throws:
    `QueryException`

### getEntityAliases

    protected EntityAliases[] getEntityAliases()

  Description copied from class: `Loader`
  Get the result set descriptor

  Specified by:
    `getEntityAliases` in class `Loader`

### getCollectionAliases

    protected CollectionAliases[] getCollectionAliases()

  Specified by:
    `getCollectionAliases` in class `Loader`

### getNamedParameterLocs

    public int[] getNamedParameterLocs(String name)
                                throws QueryException

  Overrides:
    `getNamedParameterLocs` in class `Loader`
  Throws:
    `QueryException`

### autoDiscoverTypes

    protected void autoDiscoverTypes(ResultSet rs)

  Overrides:
    `autoDiscoverTypes` in class `Loader`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD