Skip to content

Commit 6afc759

Browse files
committed
HHH-10288 - Temporary table support is broken using PostgresPlusDialect
1 parent 1cc67e3 commit 6afc759

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
package org.hibernate.dialect;
88

99
import org.hibernate.boot.model.TypeContributions;
10+
import org.hibernate.hql.spi.id.IdTableSupportStandardImpl;
11+
import org.hibernate.hql.spi.id.MultiTableBulkIdStrategy;
12+
import org.hibernate.hql.spi.id.local.AfterUseAction;
13+
import org.hibernate.hql.spi.id.local.LocalTemporaryTableBulkIdStrategy;
1014
import org.hibernate.service.ServiceRegistry;
1115
import org.hibernate.type.PostgresUUIDType;
1216

@@ -28,4 +32,23 @@ public void contributeTypes(TypeContributions typeContributions, ServiceRegistry
2832
// HHH-9562
2933
typeContributions.contributeType( PostgresUUIDType.INSTANCE );
3034
}
35+
36+
@Override
37+
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy() {
38+
return new LocalTemporaryTableBulkIdStrategy(
39+
new IdTableSupportStandardImpl() {
40+
@Override
41+
public String getCreateIdTableCommand() {
42+
return "create temporary table";
43+
}
44+
45+
@Override
46+
public String getDropIdTableCommand() {
47+
return "drop table";
48+
}
49+
},
50+
AfterUseAction.DROP,
51+
null
52+
);
53+
}
3154
}

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

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
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-
149
/**
1510
* An SQL dialect for Postgres 9 and later. Adds support for "if exists" when dropping constraints
1611
*
@@ -21,23 +16,4 @@ public class PostgreSQL9Dialect extends PostgreSQL82Dialect {
2116
public boolean supportsIfExistsBeforeConstraintName() {
2217
return true;
2318
}
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-
}
4319
}

0 commit comments

Comments
 (0)