Skip to content

Commit 68f520f

Browse files
committed
[#1546] Replace parameters for dialect using TemporaryTableExporter
Hibernate ORM doesn't generate the query using the correct parameters marker. See [HHH-16486](https://hibernate.atlassian.net/browse/HHH-16486)
1 parent 66e1685 commit 68f520f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/query/sqm/mutation/internal/temptable/ReactiveTemporaryTableHelper.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.hibernate.reactive.logging.impl.Log;
2323
import org.hibernate.reactive.logging.impl.LoggerFactory;
2424
import org.hibernate.reactive.pool.ReactiveConnection;
25+
import org.hibernate.reactive.pool.impl.Parameters;
2526
import org.hibernate.reactive.session.ReactiveConnectionSupplier;
2627
import org.hibernate.reactive.util.impl.CompletionStages;
2728

@@ -145,7 +146,10 @@ public static CompletionStage<Void> cleanTemporaryTableRows(
145146
TemporaryTableExporter exporter,
146147
Function<SharedSessionContractImplementor, String> sessionUidAccess,
147148
SharedSessionContractImplementor session) {
148-
final String sql = exporter.getSqlTruncateCommand( temporaryTable, sessionUidAccess, session );
149+
// Workaround for https://hibernate.atlassian.net/browse/HHH-16486
150+
final String sql = Parameters.instance( temporaryTable.getDialect() )
151+
.process( exporter.getSqlTruncateCommand( temporaryTable, sessionUidAccess, session ) );
152+
149153
Object[] params = PreparedStatementAdaptor.bind( ps -> {
150154
if ( temporaryTable.getSessionUidColumn() != null ) {
151155
final String sessionUid = sessionUidAccess.apply( session );

0 commit comments

Comments
 (0)