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

View File

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