HHH-13534 AbstractLoadPlanBasedLoader never needs a List of AfterLoadAction

This commit is contained in:
Sanne Grinovero 2019-08-01 11:26:11 +01:00
parent 343deb982f
commit 618d186cb2
1 changed files with 4 additions and 23 deletions

View File

@ -12,6 +12,7 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Statement; import java.sql.Statement;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -84,24 +85,6 @@ public abstract class AbstractLoadPlanBasedLoader {
LoadQueryDetails loadQueryDetails, LoadQueryDetails loadQueryDetails,
boolean returnProxies, boolean returnProxies,
ResultTransformer forcedResultTransformer) throws SQLException { ResultTransformer forcedResultTransformer) throws SQLException {
final List<AfterLoadAction> afterLoadActions = new ArrayList<AfterLoadAction>();
return executeLoad(
session,
queryParameters,
loadQueryDetails,
returnProxies,
forcedResultTransformer,
afterLoadActions
);
}
protected List executeLoad(
SharedSessionContractImplementor session,
QueryParameters queryParameters,
LoadQueryDetails loadQueryDetails,
boolean returnProxies,
ResultTransformer forcedResultTransformer,
List<AfterLoadAction> afterLoadActions) throws SQLException {
final PersistenceContext persistenceContext = session.getPersistenceContextInternal(); final PersistenceContext persistenceContext = session.getPersistenceContextInternal();
final boolean defaultReadOnlyOrig = persistenceContext.isDefaultReadOnly(); final boolean defaultReadOnlyOrig = persistenceContext.isDefaultReadOnly();
if ( queryParameters.isReadOnlyInitialized() ) { if ( queryParameters.isReadOnlyInitialized() ) {
@ -120,7 +103,7 @@ public abstract class AbstractLoadPlanBasedLoader {
final String sql = loadQueryDetails.getSqlStatement(); final String sql = loadQueryDetails.getSqlStatement();
SqlStatementWrapper wrapper = null; SqlStatementWrapper wrapper = null;
try { try {
wrapper = executeQueryStatement( sql, queryParameters, false, afterLoadActions, session ); wrapper = executeQueryStatement( sql, queryParameters, false, session );
results = loadQueryDetails.getResultSetProcessor().extractResults( results = loadQueryDetails.getResultSetProcessor().extractResults(
wrapper.getResultSet(), wrapper.getResultSet(),
session, session,
@ -134,7 +117,7 @@ public abstract class AbstractLoadPlanBasedLoader {
returnProxies, returnProxies,
queryParameters.isReadOnly(), queryParameters.isReadOnly(),
forcedResultTransformer, forcedResultTransformer,
afterLoadActions Collections.EMPTY_LIST
); );
} }
finally { finally {
@ -158,16 +141,14 @@ public abstract class AbstractLoadPlanBasedLoader {
protected SqlStatementWrapper executeQueryStatement( protected SqlStatementWrapper executeQueryStatement(
final QueryParameters queryParameters, final QueryParameters queryParameters,
final boolean scroll, final boolean scroll,
List<AfterLoadAction> afterLoadActions,
final SharedSessionContractImplementor session) throws SQLException { final SharedSessionContractImplementor session) throws SQLException {
return executeQueryStatement( getStaticLoadQuery().getSqlStatement(), queryParameters, scroll, afterLoadActions, session ); return executeQueryStatement( getStaticLoadQuery().getSqlStatement(), queryParameters, scroll, session );
} }
protected SqlStatementWrapper executeQueryStatement( protected SqlStatementWrapper executeQueryStatement(
String sqlStatement, String sqlStatement,
QueryParameters queryParameters, QueryParameters queryParameters,
boolean scroll, boolean scroll,
List<AfterLoadAction> afterLoadActions,
SharedSessionContractImplementor session) throws SQLException { SharedSessionContractImplementor session) throws SQLException {
// Processing query filters. // Processing query filters.