HHH-13214 Delete re-firing SQL from previous calls

This commit is contained in:
Andrea Boriero 2020-07-14 21:03:02 +01:00
parent 3fcd4a00a2
commit 295eb870a3
1 changed files with 3 additions and 2 deletions

View File

@ -34,7 +34,7 @@ public abstract class AbstractInlineIdsDeleteHandlerImpl
extends AbstractInlineIdsBulkIdHandler extends AbstractInlineIdsBulkIdHandler
implements MultiTableBulkIdStrategy.DeleteHandler { implements MultiTableBulkIdStrategy.DeleteHandler {
private List<String> deletes = new ArrayList<>(); private List<String> deletes ;
public AbstractInlineIdsDeleteHandlerImpl( public AbstractInlineIdsDeleteHandlerImpl(
SessionFactoryImplementor factory, SessionFactoryImplementor factory,
@ -44,7 +44,7 @@ public abstract class AbstractInlineIdsDeleteHandlerImpl
@Override @Override
public String[] getSqlStatements() { public String[] getSqlStatements() {
if ( deletes.isEmpty() ) { if ( deletes == null || deletes.isEmpty() ) {
return ArrayHelper.EMPTY_STRING_ARRAY; return ArrayHelper.EMPTY_STRING_ARRAY;
} }
return deletes.toArray( new String[deletes.size()] ); return deletes.toArray( new String[deletes.size()] );
@ -56,6 +56,7 @@ public abstract class AbstractInlineIdsDeleteHandlerImpl
QueryParameters queryParameters) { QueryParameters queryParameters) {
IdsClauseBuilder values = prepareInlineStatement( session, queryParameters ); IdsClauseBuilder values = prepareInlineStatement( session, queryParameters );
deletes = new ArrayList<>();
if ( !values.getIds().isEmpty() ) { if ( !values.getIds().isEmpty() ) {
final String idSubselect = values.toStatement(); final String idSubselect = values.toStatement();