minor changes

This commit is contained in:
Gavin 2023-04-15 16:19:36 +02:00
parent 98f8e7ecfa
commit 61696189f5
1 changed files with 16 additions and 19 deletions

View File

@ -616,13 +616,13 @@ public class PostgreSQLDialect extends Dialect {
} }
/** /**
* Whether PostgreSQL supports `min(uuid)`/`max(uuid)` which it doesn't by default. * Whether PostgreSQL supports {@code min(uuid)}/{@code max(uuid)},
* Since the emulation is not very performant, this can be overridden by users which * which it doesn't by default. Since the emulation does not perform well,
* make sure that an aggregate function for uuid exists on their database. * this method may be overridden by any user who ensures that aggregate
* * functions for handling uuids exist in the database.
* <p>
* The following definitions can be used for this purpose: * The following definitions can be used for this purpose:
* * <code><pre>
* <code>
* create or replace function min(uuid, uuid) * create or replace function min(uuid, uuid)
* returns uuid * returns uuid
* immutable parallel safe * immutable parallel safe
@ -658,7 +658,7 @@ public class PostgreSQLDialect extends Dialect {
* parallel = safe, * parallel = safe,
* sortop = operator (&gt;) * sortop = operator (&gt;)
* ); * );
* </code> * </pre></code>
*/ */
protected boolean supportsMinMaxOnUuid() { protected boolean supportsMinMaxOnUuid() {
return false; return false;
@ -986,7 +986,9 @@ public class PostgreSQLDialect extends Dialect {
@Override @Override
public CallableStatementSupport getCallableStatementSupport() { public CallableStatementSupport getCallableStatementSupport() {
return getVersion().isSameOrAfter( 11 ) ? PostgreSQLCallableStatementSupport.INSTANCE : PostgreSQLCallableStatementSupport.V10_INSTANCE; return getVersion().isSameOrAfter( 11 )
? PostgreSQLCallableStatementSupport.INSTANCE
: PostgreSQLCallableStatementSupport.V10_INSTANCE;
} }
@Override @Override
@ -1305,9 +1307,7 @@ public class PostgreSQLDialect extends Dialect {
super.augmentRecognizedTableTypes( tableTypesList ); super.augmentRecognizedTableTypes( tableTypesList );
tableTypesList.add( "MATERIALIZED VIEW" ); tableTypesList.add( "MATERIALIZED VIEW" );
/* //PostgreSQL 10 and later adds support for Partition table.
PostgreSQL 10 and later adds support for Partition table.
*/
tableTypesList.add( "PARTITIONED TABLE" ); tableTypesList.add( "PARTITIONED TABLE" );
} }
@ -1319,15 +1319,14 @@ public class PostgreSQLDialect extends Dialect {
/** /**
* Allow for extension points to override this only * Allow for extension points to override this only
* @param typeContributions
* @param serviceRegistry
*/ */
protected void contributePostgreSQLTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) { protected void contributePostgreSQLTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry) {
final JdbcTypeRegistry jdbcTypeRegistry = typeContributions.getTypeConfiguration() final JdbcTypeRegistry jdbcTypeRegistry = typeContributions.getTypeConfiguration()
.getJdbcTypeRegistry(); .getJdbcTypeRegistry();
// For discussion of BLOB support in Postgres, as of 8.4, have a peek at // For discussion of BLOB support in Postgres, as of 8.4, see:
// <a href="http://jdbc.postgresql.org/documentation/84/binary-data.html">http://jdbc.postgresql.org/documentation/84/binary-data.html</a>. // http://jdbc.postgresql.org/documentation/84/binary-data.html
// For the effects in regards to Hibernate see <a href="http://in.relation.to/15492.lace">http://in.relation.to/15492.lace</a> // For how this affects Hibernate, see:
// http://in.relation.to/15492.lace
// Force BLOB binding. Otherwise, byte[] fields annotated // Force BLOB binding. Otherwise, byte[] fields annotated
// with @Lob will attempt to use // with @Lob will attempt to use
@ -1339,9 +1338,8 @@ public class PostgreSQLDialect extends Dialect {
//jdbcTypeRegistry.addDescriptor( TimestampUtcAsOffsetDateTimeJdbcType.INSTANCE ); //jdbcTypeRegistry.addDescriptor( TimestampUtcAsOffsetDateTimeJdbcType.INSTANCE );
jdbcTypeRegistry.addDescriptor( XmlJdbcType.INSTANCE ); jdbcTypeRegistry.addDescriptor( XmlJdbcType.INSTANCE );
jdbcTypeRegistry.addDescriptorIfAbsent( UUIDJdbcType.INSTANCE ); // HHH-9562
if ( driverKind == PostgreSQLDriverKind.PG_JDBC ) { if ( driverKind == PostgreSQLDriverKind.PG_JDBC ) {
// HHH-9562
jdbcTypeRegistry.addDescriptorIfAbsent( UUIDJdbcType.INSTANCE );
if ( PgJdbcHelper.isUsable( serviceRegistry ) ) { if ( PgJdbcHelper.isUsable( serviceRegistry ) ) {
jdbcTypeRegistry.addDescriptorIfAbsent( PgJdbcHelper.getInetJdbcType( serviceRegistry ) ); jdbcTypeRegistry.addDescriptorIfAbsent( PgJdbcHelper.getInetJdbcType( serviceRegistry ) );
jdbcTypeRegistry.addDescriptorIfAbsent( PgJdbcHelper.getIntervalJdbcType( serviceRegistry ) ); jdbcTypeRegistry.addDescriptorIfAbsent( PgJdbcHelper.getIntervalJdbcType( serviceRegistry ) );
@ -1356,7 +1354,6 @@ public class PostgreSQLDialect extends Dialect {
} }
} }
else { else {
jdbcTypeRegistry.addDescriptorIfAbsent( UUIDJdbcType.INSTANCE );
jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLCastingInetJdbcType.INSTANCE ); jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLCastingInetJdbcType.INSTANCE );
jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLCastingIntervalSecondJdbcType.INSTANCE ); jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLCastingIntervalSecondJdbcType.INSTANCE );
jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLStructCastingJdbcType.INSTANCE ); jdbcTypeRegistry.addDescriptorIfAbsent( PostgreSQLStructCastingJdbcType.INSTANCE );