Class QueryLoader

  • public class QueryLoader
    extends BasicLoader
    A delegate that implements the Loader part of QueryTranslator.
    • Constructor Detail

      • QueryLoader

        public QueryLoader​(org.hibernate.hql.internal.ast.QueryTranslatorImpl queryTranslator,
                           SessionFactoryImplementor factory,
                           org.hibernate.hql.internal.ast.tree.SelectClause selectClause)
        Creates a new Loader implementation.
        queryTranslator - The query translator that is the delegator.
        factory - The factory from which this loader is being created.
        selectClause - The AST representing the select clause for loading.
    • Method Detail

      • getAggregatedSelectExpression

        public org.hibernate.hql.internal.ast.tree.AggregatedSelectExpression getAggregatedSelectExpression()
      • needsFetchingScroll

        protected boolean needsFetchingScroll()
        Description copied from class: Loader
        Does the result set to be scrolled contain collection fetches?
        needsFetchingScroll in class Loader
        True if it does, and thus needs the special fetching scroll functionality; false otherwise.
      • getEntityPersisters

        public 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
        The entity persisters.
      • getAliases

        public java.lang.String[] getAliases()
        Description copied from class: Loader
        Get the SQL table aliases of entities whose associations are subselect-loadable, returning null if this loader does not support subselect loading
        getAliases in class Loader
      • getSqlAliasSuffixes

        public java.lang.String[] getSqlAliasSuffixes()
      • getQueryIdentifier

        protected java.lang.String getQueryIdentifier()
        Description copied from class: Loader
        Identifies the query for statistics reporting, if null, no statistics will be reported
        getQueryIdentifier in class Loader
      • getSQLString

        public java.lang.String getSQLString()
        The SQL query string to be called.
        Specified by:
        getSQLString in class Loader
        The sql command this loader should use to get its ResultSet.
      • getCollectionPersisters

        protected CollectionPersister[] getCollectionPersisters()
        An (optional) persister for a collection to be initialized; only collection loaders return a non-null value
        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.
        getCollectionOwners in class Loader
      • getEntityEagerPropertyFetches

        protected boolean[] getEntityEagerPropertyFetches()
        Description copied from class: Loader
        An array indicating whether the entities have eager property fetching enabled.
        getEntityEagerPropertyFetches in class Loader
        Eager property fetching indicators.
      • getOwners

        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")
        getOwners in class Loader
        The owner indicators (see discussion above).
      • getOwnerAssociationTypes

        protected EntityType[] getOwnerAssociationTypes()
        Description copied from class: Loader
        An array of the owner types corresponding to the Loader.getOwners() returns. Indices indicating no owner would be null here.
        getOwnerAssociationTypes in class Loader
        The types for the owners.
      • getLockModes

        protected LockMode[] getLockModes​(LockOptions lockOptions)
        Description copied from class: Loader
        What lock options does this load entities with?
        Specified by:
        getLockModes in class Loader
        lockOptions - a collection of lock modes specified dynamically via the Query interface
      • upgradeLocks

        protected boolean upgradeLocks()
        Description copied from class: Loader
        Does this query return objects that might be already cached by the session, whose lock mode may need upgrading
        upgradeLocks in class Loader
      • getResultRowAliases

        protected java.lang.String[] getResultRowAliases()
        Description copied from class: Loader
        Returns the aliases that corresponding to a result row.
        getResultRowAliases in class Loader
        Returns the aliases that corresponding to a result row.
      • resolveResultTransformer

        protected ResultTransformer resolveResultTransformer​(ResultTransformer resultTransformer)
        Description copied from class: Loader
        Determine the actual ResultTransformer that will be used to transform query results.
        resolveResultTransformer in class Loader
        resultTransformer - the specified result transformer
        the actual result transformer
      • bindParameterValues

        protected int bindParameterValues​(java.sql.PreparedStatement statement,
                                          QueryParameters queryParameters,
                                          int startIndex,
                                          SharedSessionContractImplementor session)
                                   throws java.sql.SQLException
        We specifically override this method here, because in general we know much more about the parameters and their appropriate bind positions here then we do in our super because we track them explicitly here through the ParameterSpecification interface.
        bindParameterValues in class Loader
        queryParameters - The encapsulation of the parameter values to be bound.
        startIndex - The position from which to start binding parameter values.
        session - The originating session.
        statement - The JDBC prepared statement
        The number of JDBC bind positions actually bound during this method execution.
        java.sql.SQLException - Indicates problems performing the binding.