Skip to content

Commit e59999e

Browse files
committed
HHH-10150 - Override PostgreSQL9Dialect#getDefaultMultiTableBulkIdStrategy() causing exception in deleting joined subclasses
1 parent a58a866 commit e59999e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
*/
77
package org.hibernate.dialect;
88

9+
import org.hibernate.hql.spi.id.IdTableSupportStandardImpl;
10+
import org.hibernate.hql.spi.id.MultiTableBulkIdStrategy;
11+
import org.hibernate.hql.spi.id.local.AfterUseAction;
12+
import org.hibernate.hql.spi.id.local.LocalTemporaryTableBulkIdStrategy;
13+
914
/**
1015
* An SQL dialect for Postgres 9 and later. Adds support for "if exists" when dropping constraints
1116
*
@@ -16,4 +21,23 @@ public class PostgreSQL9Dialect extends PostgreSQL82Dialect {
1621
public boolean supportsIfExistsBeforeConstraintName() {
1722
return true;
1823
}
24+
25+
@Override
26+
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy() {
27+
return new LocalTemporaryTableBulkIdStrategy(
28+
new IdTableSupportStandardImpl() {
29+
@Override
30+
public String getCreateIdTableCommand() {
31+
return "create temporary table";
32+
}
33+
34+
@Override
35+
public String getDropIdTableCommand() {
36+
return "drop table";
37+
}
38+
},
39+
AfterUseAction.DROP,
40+
null
41+
);
42+
}
1943
}

0 commit comments

Comments
 (0)