Avoid possible NullPointerExceptions in AbstractCollectionPersister.logStaticSQL()

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
Jan Schatteman 2022-12-14 18:03:02 +01:00 committed by Christian Beikov
parent 75e6cfd125
commit 74f3c1715b
1 changed files with 15 additions and 9 deletions

View File

@ -688,19 +688,25 @@ public abstract class AbstractCollectionPersister
MODEL_MUTATION_LOGGER.debugf( "Static SQL for collection: %s", getRole() );
final String insertRowSql = getRowMutationOperations().getInsertRowOperation().getSqlString();
if ( insertRowSql != null ) {
MODEL_MUTATION_LOGGER.debugf( " Row insert: %s", insertRowSql );
if ( getRowMutationOperations().hasInsertRow() ) {
final String insertRowSql = getRowMutationOperations().getInsertRowOperation().getSqlString();
if ( insertRowSql != null ) {
MODEL_MUTATION_LOGGER.debugf( " Row insert: %s", insertRowSql );
}
}
final String updateRowSql = getRowMutationOperations().getUpdateRowOperation().getSqlString();
if ( updateRowSql != null ) {
MODEL_MUTATION_LOGGER.debugf( " Row update: %s", updateRowSql );
if ( getRowMutationOperations().hasUpdateRow() ) {
final String updateRowSql = getRowMutationOperations().getUpdateRowOperation().getSqlString();
if ( updateRowSql != null ) {
MODEL_MUTATION_LOGGER.debugf( " Row update: %s", updateRowSql );
}
}
final String deleteRowSql = getRowMutationOperations().getDeleteRowOperation().getSqlString();
if ( deleteRowSql != null ) {
MODEL_MUTATION_LOGGER.debugf( " Row delete: %s", deleteRowSql );
if ( getRowMutationOperations().hasDeleteRow() ) {
final String deleteRowSql = getRowMutationOperations().getDeleteRowOperation().getSqlString();
if ( deleteRowSql != null ) {
MODEL_MUTATION_LOGGER.debugf( " Row delete: %s", deleteRowSql );
}
}
final String deleteAllSql = getRemoveCoordinator().getSqlString();