HHH-10288 - Temporary table support is broken using PostgresPlusDialect
This commit is contained in:
parent
0ed5fcfc66
commit
5a98ded540
|
@ -7,6 +7,10 @@
|
|||
package org.hibernate.dialect;
|
||||
|
||||
import org.hibernate.boot.model.TypeContributions;
|
||||
import org.hibernate.hql.spi.id.IdTableSupportStandardImpl;
|
||||
import org.hibernate.hql.spi.id.MultiTableBulkIdStrategy;
|
||||
import org.hibernate.hql.spi.id.local.AfterUseAction;
|
||||
import org.hibernate.hql.spi.id.local.LocalTemporaryTableBulkIdStrategy;
|
||||
import org.hibernate.service.ServiceRegistry;
|
||||
import org.hibernate.type.PostgresUUIDType;
|
||||
|
||||
|
@ -28,4 +32,23 @@ public class PostgreSQL82Dialect extends PostgreSQL81Dialect {
|
|||
// HHH-9562
|
||||
typeContributions.contributeType( PostgresUUIDType.INSTANCE );
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy() {
|
||||
return new LocalTemporaryTableBulkIdStrategy(
|
||||
new IdTableSupportStandardImpl() {
|
||||
@Override
|
||||
public String getCreateIdTableCommand() {
|
||||
return "create temporary table";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDropIdTableCommand() {
|
||||
return "drop table";
|
||||
}
|
||||
},
|
||||
AfterUseAction.DROP,
|
||||
null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,11 +6,6 @@
|
|||
*/
|
||||
package org.hibernate.dialect;
|
||||
|
||||
import org.hibernate.hql.spi.id.IdTableSupportStandardImpl;
|
||||
import org.hibernate.hql.spi.id.MultiTableBulkIdStrategy;
|
||||
import org.hibernate.hql.spi.id.local.AfterUseAction;
|
||||
import org.hibernate.hql.spi.id.local.LocalTemporaryTableBulkIdStrategy;
|
||||
|
||||
/**
|
||||
* An SQL dialect for Postgres 9 and later. Adds support for "if exists" when dropping constraints
|
||||
*
|
||||
|
@ -21,23 +16,4 @@ public class PostgreSQL9Dialect extends PostgreSQL82Dialect {
|
|||
public boolean supportsIfExistsBeforeConstraintName() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy() {
|
||||
return new LocalTemporaryTableBulkIdStrategy(
|
||||
new IdTableSupportStandardImpl() {
|
||||
@Override
|
||||
public String getCreateIdTableCommand() {
|
||||
return "create temporary table";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDropIdTableCommand() {
|
||||
return "drop table";
|
||||
}
|
||||
},
|
||||
AfterUseAction.DROP,
|
||||
null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue