mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-25 21:04:51 +00:00
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 @@ private static void applySqlString(
|
||||
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 @@ private static void applySqlString(
|
||||
}
|
||||
|
||||
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 @@ private static void applySqlString(
|
||||
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…
x
Reference in New Issue
Block a user