public abstract class AbstractLoadPlanBasedLoader extends Object
EntityLoader
,
CollectionLoader
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractLoadPlanBasedLoader.SqlStatementWrapper
|
Constructor and Description |
---|
AbstractLoadPlanBasedLoader(SessionFactoryImplementor factory)
Constructs a
AbstractLoadPlanBasedLoader . |
Modifier and Type | Method and Description |
---|---|
protected void |
advance(ResultSet rs,
RowSelection selection)
Advance the cursor to the first required row of the ResultSet
|
protected abstract void |
autoDiscoverTypes(ResultSet rs) |
protected int |
bindNamedParameters(PreparedStatement statement,
Map namedParams,
int startIndex,
SessionImplementor session)
Bind named parameters to the JDBC prepared statement.
|
protected int |
bindParameterValues(PreparedStatement statement,
QueryParameters queryParameters,
int startIndex,
SessionImplementor session)
Bind all parameter values into the prepared statement in preparation
for execution.
|
protected int |
bindPositionalParameters(PreparedStatement statement,
QueryParameters queryParameters,
int startIndex,
SessionImplementor session)
Bind positional parameter values to the JDBC prepared statement.
|
protected List |
executeLoad(SessionImplementor session,
QueryParameters queryParameters,
LoadQueryDetails loadQueryDetails,
boolean returnProxies,
ResultTransformer forcedResultTransformer) |
protected List |
executeLoad(SessionImplementor session,
QueryParameters queryParameters,
LoadQueryDetails loadQueryDetails,
boolean returnProxies,
ResultTransformer forcedResultTransformer,
List<AfterLoadAction> afterLoadActions) |
protected AbstractLoadPlanBasedLoader.SqlStatementWrapper |
executeQueryStatement(QueryParameters queryParameters,
boolean scroll,
List<AfterLoadAction> afterLoadActions,
SessionImplementor session) |
protected AbstractLoadPlanBasedLoader.SqlStatementWrapper |
executeQueryStatement(String sqlStatement,
QueryParameters queryParameters,
boolean scroll,
List<AfterLoadAction> afterLoadActions,
SessionImplementor session) |
protected SessionFactoryImplementor |
getFactory() |
protected LimitHandler |
getLimitHandler(RowSelection selection)
Build LIMIT clause handler applicable for given selection criteria.
|
protected abstract int[] |
getNamedParameterLocs(String name) |
protected ResultSet |
getResultSet(PreparedStatement st,
RowSelection selection,
LimitHandler limitHandler,
boolean autodiscovertypes,
SessionImplementor 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 PreparedStatement |
prepareQueryStatement(String sql,
QueryParameters queryParameters,
LimitHandler limitHandler,
boolean scroll,
SessionImplementor 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(String name)
protected abstract void autoDiscoverTypes(ResultSet rs)
protected List executeLoad(SessionImplementor session, QueryParameters queryParameters, LoadQueryDetails loadQueryDetails, boolean returnProxies, ResultTransformer forcedResultTransformer) throws SQLException
SQLException
protected List executeLoad(SessionImplementor session, QueryParameters queryParameters, LoadQueryDetails loadQueryDetails, boolean returnProxies, ResultTransformer forcedResultTransformer, List<AfterLoadAction> afterLoadActions) throws SQLException
SQLException
protected AbstractLoadPlanBasedLoader.SqlStatementWrapper executeQueryStatement(QueryParameters queryParameters, boolean scroll, List<AfterLoadAction> afterLoadActions, SessionImplementor session) throws SQLException
SQLException
protected AbstractLoadPlanBasedLoader.SqlStatementWrapper executeQueryStatement(String sqlStatement, QueryParameters queryParameters, boolean scroll, List<AfterLoadAction> afterLoadActions, SessionImplementor session) throws SQLException
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 PreparedStatement prepareQueryStatement(String sql, QueryParameters queryParameters, LimitHandler limitHandler, boolean scroll, SessionImplementor session) throws SQLException, HibernateException
SQLException
HibernateException
protected ScrollMode getScrollMode(boolean scroll, boolean hasFirstRow, boolean useLimitOffSet, QueryParameters queryParameters)
protected int bindParameterValues(PreparedStatement statement, QueryParameters queryParameters, int startIndex, SessionImplementor session) throws 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.SQLException
- Indicates problems performing the binding.protected int bindPositionalParameters(PreparedStatement statement, QueryParameters queryParameters, int startIndex, SessionImplementor session) throws 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.SQLException
- Indicates problems performing the binding.HibernateException
- Indicates problems delegating binding to the types.protected int bindNamedParameters(PreparedStatement statement, Map namedParams, int startIndex, SessionImplementor session) throws 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.SQLException
- Indicates problems performing the binding.HibernateException
- Indicates problems delegating binding to the types.protected final ResultSet getResultSet(PreparedStatement st, RowSelection selection, LimitHandler limitHandler, boolean autodiscovertypes, SessionImplementor session) throws SQLException, HibernateException
SQLException
HibernateException
protected void advance(ResultSet rs, RowSelection selection) throws SQLException
SQLException
Copyright © 2017 JBoss by Red Hat. All rights reserved.