Skip to content

Commit bc31357

Browse files
committed
HHH-6255 correctly handling quoting fk names
1 parent 0593cbb commit bc31357

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2052,7 +2052,7 @@ public String getAddForeignKeyConstraintString(
20522052
final StringBuilder res = new StringBuilder( 30 );
20532053

20542054
res.append( " add constraint " )
2055-
.append( constraintName )
2055+
.append( quote( constraintName ) )
20562056
.append( " foreign key (" )
20572057
.append( StringHelper.join( ", ", foreignKey ) )
20582058
.append( ") references " )

hibernate-core/src/main/java/org/hibernate/mapping/ForeignKey.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public String sqlDropString(Dialect dialect, String defaultCatalog, String defau
133133
if ( dialect.supportsIfExistsBeforeConstraintName() ) {
134134
buf.append( "if exists " );
135135
}
136-
buf.append( getName() );
136+
buf.append( dialect.quote( getName() ) );
137137
if ( dialect.supportsIfExistsAfterConstraintName() ) {
138138
buf.append( " if exists" );
139139
}

0 commit comments

Comments
 (0)