public abstract class AbstractLoadPlanBasedLoader
extends java.lang.Object
EntityLoader
,
CollectionLoader
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractLoadPlanBasedLoader.SqlStatementWrapper
Wrapper class for
Statement and associated ResultSet . |
Constructor and Description |
---|
AbstractLoadPlanBasedLoader(SessionFactoryImplementor factory)
Constructs a
AbstractLoadPlanBasedLoader . |
Modifier and Type | Method and Description |
---|---|
protected void |
advance(java.sql.ResultSet rs,
RowSelection selection)
Advance the cursor to the first required row of the ResultSet
|
protected abstract void |
autoDiscoverTypes(java.sql.ResultSet rs) |
protected int |
bindNamedParameters(java.sql.PreparedStatement statement,
java.util.Map namedParams,
int startIndex,
SharedSessionContractImplementor session)
Bind named parameters to the JDBC prepared statement.
|
protected int |
bindParameterValues(java.sql.PreparedStatement statement,
QueryParameters queryParameters,
int startIndex,
SharedSessionContractImplementor session)
Bind all parameter values into the prepared statement in preparation
for execution.
|
protected int |
bindPositionalParameters(java.sql.PreparedStatement statement,
QueryParameters queryParameters,
int startIndex,
SharedSessionContractImplementor session)
Bind positional parameter values to the JDBC prepared statement.
|
protected java.util.List |
executeLoad(SharedSessionContractImplementor session,
QueryParameters queryParameters,
LoadQueryDetails loadQueryDetails,
boolean returnProxies,
ResultTransformer forcedResultTransformer) |
protected java.util.List |
executeLoad(SharedSessionContractImplementor session,
QueryParameters queryParameters,
LoadQueryDetails loadQueryDetails,
boolean returnProxies,
ResultTransformer forcedResultTransformer,
java.util.List<AfterLoadAction> afterLoadActions) |
protected AbstractLoadPlanBasedLoader.SqlStatementWrapper |
executeQueryStatement(QueryParameters queryParameters,
boolean scroll,
java.util.List<AfterLoadAction> afterLoadActions,
SharedSessionContractImplementor session) |
protected AbstractLoadPlanBasedLoader.SqlStatementWrapper |
executeQueryStatement(java.lang.String sqlStatement,
QueryParameters queryParameters,
boolean scroll,
java.util.List<AfterLoadAction> afterLoadActions,
SharedSessionContractImplementor session) |
protected SessionFactoryImplementor |
getFactory() |
protected LimitHandler |
getLimitHandler(RowSelection selection)
Build LIMIT clause handler applicable for given selection criteria.
|
protected abstract int[] |
getNamedParameterLocs(java.lang.String name) |
protected java.sql.ResultSet |
getResultSet(java.sql.PreparedStatement st,
RowSelection selection,
LimitHandler limitHandler,
boolean autodiscovertypes,
SharedSessionContractImplementor session)
Execute given PreparedStatement, advance to the first result and return SQL ResultSet.
|
protected ScrollMode |
getScrollMode(boolean scroll,
boolean hasFirstRow,
boolean useLimitOffSet,
QueryParameters queryParameters) |
protected abstract LoadQueryDetails |
getStaticLoadQuery() |
protected java.sql.PreparedStatement |
prepareQueryStatement(java.lang.String sql,
QueryParameters queryParameters,
LimitHandler limitHandler,
boolean scroll,
SharedSessionContractImplementor session)
Obtain a PreparedStatement with all parameters pre-bound.
|
public AbstractLoadPlanBasedLoader(SessionFactoryImplementor factory)
AbstractLoadPlanBasedLoader
.factory
- The session factorySessionFactoryImplementor
protected SessionFactoryImplementor getFactory()
protected abstract LoadQueryDetails getStaticLoadQuery()
protected abstract int[] getNamedParameterLocs(java.lang.String name)
protected abstract void autoDiscoverTypes(java.sql.ResultSet rs)
protected java.util.List executeLoad(SharedSessionContractImplementor session, QueryParameters queryParameters, LoadQueryDetails loadQueryDetails, boolean returnProxies, ResultTransformer forcedResultTransformer) throws java.sql.SQLException
java.sql.SQLException
protected java.util.List executeLoad(SharedSessionContractImplementor session, QueryParameters queryParameters, LoadQueryDetails loadQueryDetails, boolean returnProxies, ResultTransformer forcedResultTransformer, java.util.List<AfterLoadAction> afterLoadActions) throws java.sql.SQLException
java.sql.SQLException
protected AbstractLoadPlanBasedLoader.SqlStatementWrapper executeQueryStatement(QueryParameters queryParameters, boolean scroll, java.util.List<AfterLoadAction> afterLoadActions, SharedSessionContractImplementor session) throws java.sql.SQLException
java.sql.SQLException
protected AbstractLoadPlanBasedLoader.SqlStatementWrapper executeQueryStatement(java.lang.String sqlStatement, QueryParameters queryParameters, boolean scroll, java.util.List<AfterLoadAction> afterLoadActions, SharedSessionContractImplementor session) throws java.sql.SQLException
java.sql.SQLException
protected LimitHandler getLimitHandler(RowSelection selection)
NoopLimitHandler
delegate
if dialect does not support LIMIT expression or processed query does not use pagination.selection
- Selection criteria.protected final java.sql.PreparedStatement prepareQueryStatement(java.lang.String sql, QueryParameters queryParameters, LimitHandler limitHandler, boolean scroll, SharedSessionContractImplementor session) throws java.sql.SQLException, HibernateException
java.sql.SQLException
HibernateException
protected ScrollMode getScrollMode(boolean scroll, boolean hasFirstRow, boolean useLimitOffSet, QueryParameters queryParameters)
protected int bindParameterValues(java.sql.PreparedStatement statement, QueryParameters queryParameters, int startIndex, SharedSessionContractImplementor session) throws java.sql.SQLException
statement
- The JDBC prepared statementqueryParameters
- The encapsulation of the parameter values to be bound.startIndex
- The position from which to start binding parameter values.session
- The originating session.java.sql.SQLException
- Indicates problems performing the binding.protected int bindPositionalParameters(java.sql.PreparedStatement statement, QueryParameters queryParameters, int startIndex, SharedSessionContractImplementor session) throws java.sql.SQLException, HibernateException
statement
- The JDBC prepared statementqueryParameters
- The encapsulation of the parameter values to be bound.startIndex
- The position from which to start binding parameter values.session
- The originating session.java.sql.SQLException
- Indicates problems performing the binding.HibernateException
- Indicates problems delegating binding to the types.protected int bindNamedParameters(java.sql.PreparedStatement statement, java.util.Map namedParams, int startIndex, SharedSessionContractImplementor session) throws java.sql.SQLException, HibernateException
statement
- The JDBC prepared statementnamedParams
- A map of parameter names to valuesstartIndex
- The position from which to start binding parameter values.session
- The originating session.java.sql.SQLException
- Indicates problems performing the binding.HibernateException
- Indicates problems delegating binding to the types.protected final java.sql.ResultSet getResultSet(java.sql.PreparedStatement st, RowSelection selection, LimitHandler limitHandler, boolean autodiscovertypes, SharedSessionContractImplementor session) throws java.sql.SQLException, HibernateException
java.sql.SQLException
HibernateException
protected void advance(java.sql.ResultSet rs, RowSelection selection) throws java.sql.SQLException
java.sql.SQLException
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.