Adapt Hibernate ORM 7.4 for GaussDB version 505.2

PR: Adapt for GaussDB version 505.2. by plafaithing · Pull Request #13143 · hibernate/hibernate-orm · GitHub

Background

Part of adapting Hibernate ORM (fork-7.4) for GaussDB. GaussDB 505.2 exposes two
compatibility modes via pg_database.datcompatibility:

  • A-mode (Oracle-compatible) — the default
  • M-mode / B (MySQL-compatible)

The two modes differ in identifier quoting, type mapping, sequence support,
generated-key retrieval, and keyword reservation, so a single static dialect cannot
serve both correctly.

Changes

  • hibernate-community-dialects
    ** GaussDBDialect now detects the compatibility mode — explicit config
    hibernate.dialect.gaussdb.compatibility_mode, falling back to probing
    datcompatibility — and applies mode-specific overrides (column types,
    identifier quoting, CHAR/TEXT/CLOB hand.
    ** Added JdbcTypes: Array, Boolean, Instant, LocalDate, LocalDateTime,
    OffsetDateTime, TimestampWithTimeZone.
    ** Enhanced FunctionRegistry, ExtractFunction, MinMax/JsonObject functions,
    AggregateSupport, SqlAstTranslator, LockingSupport.
    ** M-mode dedicated sequence support: GaussDBMModeSequenceInformationExtractor /
    GaussDBMModeSequenceSupport (M mode has no sequence view).

  • hibernate-core (tests)
    ** Test cases relying on features unsupported under A-mode or M-mode are
    proactively skipped for the corresponding mode. This does not affect the use
    of these test cases with other databases.

  • hibernate-testing
    ** Adapted PostgreSQLDatabaseCleaner, SharedDriverManagerConnectionProvider,
    DialectFeatureChecks for GaussDB.

  • build
    ** GaussDB 505.2 version/profile configuration (gradle.properties, local-build-plugins).

Why

To provide support for both A-mode and M-mode in GaussDB, the dialect must branch on
datcompatibility and override SQL generation accordingly; otherwise Hibernate emits
SQL valid only in one mode (e.g. double-quote identifiers in M mode, or clob/sequence
syntax that M mode rejects). Skipping mode-incompatible tests keeps the suite green on
GaussDB without weakening coverage on other databases.

I would like to merge this code modification into the 7.4 branch, but since I lack the permissions to create JIRA issues (as I am not a member of the Hibernate ORM team), I cannot obtain the key required for the commit message. How can I become a member of the team?

You don’t have to be a member of the Hibernate ORM team to create a Jira ticket.

Please take a look at the following similar reports:

We heard a couple of times from users that it takes a bit of time until newly created accounts are fully activated, so maybe try again the next day.