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,
|
ExecutionOptions options,
|
||||||
GenerationTarget... targets) {
|
GenerationTarget... targets) {
|
||||||
if ( !StringHelper.isEmpty( sqlString ) ) {
|
if ( !StringHelper.isEmpty( sqlString ) ) {
|
||||||
|
String sqlStringFormatted = formatter.format( sqlString );
|
||||||
for ( GenerationTarget target : targets ) {
|
for ( GenerationTarget target : targets ) {
|
||||||
try {
|
try {
|
||||||
target.accept( formatter.format( sqlString ) );
|
target.accept( sqlStringFormatted );
|
||||||
}
|
}
|
||||||
catch (CommandAcceptanceException e) {
|
catch (CommandAcceptanceException e) {
|
||||||
if ( !quiet ) {
|
if ( !quiet ) {
|
||||||
|
|
|
@ -435,8 +435,9 @@ public class SchemaCreatorImpl implements SchemaCreator {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
String sqlStringFormatted = formatter.format( sqlString );
|
||||||
for ( GenerationTarget target : targets ) {
|
for ( GenerationTarget target : targets ) {
|
||||||
target.accept( formatter.format( sqlString ) );
|
target.accept( sqlStringFormatted );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (CommandAcceptanceException e) {
|
catch (CommandAcceptanceException e) {
|
||||||
|
|
|
@ -369,9 +369,10 @@ public class SchemaDropperImpl implements SchemaDropper {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String sqlStringFormatted = formatter.format( sqlString );
|
||||||
for ( GenerationTarget target : targets ) {
|
for ( GenerationTarget target : targets ) {
|
||||||
try {
|
try {
|
||||||
target.accept( formatter.format( sqlString ) );
|
target.accept( sqlStringFormatted );
|
||||||
}
|
}
|
||||||
catch (CommandAcceptanceException e) {
|
catch (CommandAcceptanceException e) {
|
||||||
options.getExceptionHandler().handleException( e );
|
options.getExceptionHandler().handleException( e );
|
||||||
|
|
Loading…
Reference in New Issue