HHH-11458 - Optimize the SQL formatter call when iterating through multiple targets
This commit is contained in:
parent
efc041c9e6
commit
f82dd465b1
|
@ -519,9 +519,10 @@ public abstract class AbstractSchemaMigrator implements SchemaMigrator {
|
|||
ExecutionOptions options,
|
||||
GenerationTarget... targets) {
|
||||
if ( !StringHelper.isEmpty( sqlString ) ) {
|
||||
String sqlStringFormatted = formatter.format( sqlString );
|
||||
for ( GenerationTarget target : targets ) {
|
||||
try {
|
||||
target.accept( formatter.format( sqlString ) );
|
||||
target.accept( sqlStringFormatted );
|
||||
}
|
||||
catch (CommandAcceptanceException e) {
|
||||
if ( !quiet ) {
|
||||
|
|
|
@ -435,8 +435,9 @@ public class SchemaCreatorImpl implements SchemaCreator {
|
|||
}
|
||||
|
||||
try {
|
||||
String sqlStringFormatted = formatter.format( sqlString );
|
||||
for ( GenerationTarget target : targets ) {
|
||||
target.accept( formatter.format( sqlString ) );
|
||||
target.accept( sqlStringFormatted );
|
||||
}
|
||||
}
|
||||
catch (CommandAcceptanceException e) {
|
||||
|
|
|
@ -369,9 +369,10 @@ public class SchemaDropperImpl implements SchemaDropper {
|
|||
return;
|
||||
}
|
||||
|
||||
String sqlStringFormatted = formatter.format( sqlString );
|
||||
for ( GenerationTarget target : targets ) {
|
||||
try {
|
||||
target.accept( formatter.format( sqlString ) );
|
||||
target.accept( sqlStringFormatted );
|
||||
}
|
||||
catch (CommandAcceptanceException e) {
|
||||
options.getExceptionHandler().handleException( e );
|
||||
|
|
Loading…
Reference in New Issue