Skip to content

Commit e407c53

Browse files
quaffgavinking
authored andcommitted
Remove duplicated space before when matched
Running `org.hibernate.orm.test.stateless.UpsertTest`: Before -> `merge into "UpsertTest$Record" as t using (select cast(? as bigint) id, cast(? as varchar) message) as s on (t.id=s.id) when not matched then insert (id, message) values (s.id, s.message) when matched then update set message=s.message` After -> `merge into "UpsertTest$Record" as t using (select cast(? as bigint) id, cast(? as varchar) message) as s on (t.id=s.id) when not matched then insert (id, message) values (s.id, s.message) when matched then update set message=s.message`
1 parent 4cef240 commit e407c53

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hibernate-core/src/main/java/org/hibernate/dialect/SqlAstTranslatorWithMerge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ protected void renderMergeUpdate(OptionalTableUpdate optionalTableUpdate) {
242242
}
243243

244244
private void renderWhenMatched(List<ColumnValueBinding> optimisticLockBindings) {
245-
appendSql( " when matched" );
245+
appendSql( "when matched" );
246246
for (int i = 0; i < optimisticLockBindings.size(); i++) {
247247
final ColumnValueBinding binding = optimisticLockBindings.get( i );
248248
appendSql(" and ");

hibernate-core/src/main/java/org/hibernate/dialect/SqlAstTranslatorWithUpsert.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ protected void renderMergeUpdate(OptionalTableUpdate optionalTableUpdate) {
193193
final List<ColumnValueBinding> valueBindings = optionalTableUpdate.getValueBindings();
194194
final List<ColumnValueBinding> optimisticLockBindings = optionalTableUpdate.getOptimisticLockBindings();
195195

196-
appendSql( " when matched then update set " );
196+
appendSql( "when matched then update set " );
197197
for ( int i = 0; i < valueBindings.size(); i++ ) {
198198
final ColumnValueBinding binding = valueBindings.get( i );
199199
if ( i > 0 ) {

0 commit comments

Comments
 (0)