bugfix: creating Hibernate dialect with specific version (#5725)

* bugfix: creating Hibernate dialect with specific version

fixes https://github.com/hapifhir/hapi-fhir/issues/5723

* Apply fix to other dialects, and add changelog

* Spotless

---------

Co-authored-by: James Agnew <jamesagnew@gmail.com>
This commit is contained in:
pano-smals 2024-04-19 11:32:46 +02:00 committed by GitHub
parent aeb4299864
commit 79c7820d02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 49 additions and 37 deletions

View File

@ -0,0 +1,8 @@
---
type: fix
issue: 5725
jira: SMILE-8343
title: "The recommended constructor was not present on hibernate dialects
provided by HAPI FHIR, leading to warnings during startup, and failures
in some cases. This has been corrected. Thanks to GitHub user
@pano-smals for the contribution!"

View File

@ -20,7 +20,7 @@
package ca.uhn.fhir.jpa.model.dialect;
import org.hibernate.dialect.CockroachDialect;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
/**
* Dialect for CockroachDB database.
@ -29,7 +29,11 @@ import org.hibernate.dialect.DatabaseVersion;
public class HapiFhirCockroachDialect extends CockroachDialect {
public HapiFhirCockroachDialect() {
super(DatabaseVersion.make(21, 1));
super();
}
public HapiFhirCockroachDialect(DialectResolutionInfo info) {
super(info);
}
/**

View File

@ -19,8 +19,8 @@
*/
package ca.uhn.fhir.jpa.model.dialect;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.dialect.DerbyDialect;
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
/**
* Dialect for Derby database.
@ -28,12 +28,12 @@ import org.hibernate.dialect.DerbyDialect;
*/
public class HapiFhirDerbyDialect extends DerbyDialect {
public HapiFhirDerbyDialect(DatabaseVersion theDatabaseVersion) {
super(theDatabaseVersion);
public HapiFhirDerbyDialect() {
super();
}
public HapiFhirDerbyDialect() {
super(DatabaseVersion.make(10, 14, 2));
public HapiFhirDerbyDialect(DialectResolutionInfo info) {
super(info);
}
/**

View File

@ -19,8 +19,8 @@
*/
package ca.uhn.fhir.jpa.model.dialect;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
/**
* Dialect for H2 database.
@ -28,12 +28,12 @@ import org.hibernate.dialect.H2Dialect;
*/
public class HapiFhirH2Dialect extends H2Dialect {
public HapiFhirH2Dialect(DatabaseVersion theDatabaseVersion) {
super(theDatabaseVersion);
public HapiFhirH2Dialect() {
super();
}
public HapiFhirH2Dialect() {
super(DatabaseVersion.make(2, 2, 220));
public HapiFhirH2Dialect(DialectResolutionInfo info) {
super(info);
}
/**

View File

@ -19,8 +19,8 @@
*/
package ca.uhn.fhir.jpa.model.dialect;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.dialect.MariaDBDialect;
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
/**
* Dialect for MySQL database.
@ -28,12 +28,12 @@ import org.hibernate.dialect.MariaDBDialect;
*/
public class HapiFhirMariaDBDialect extends MariaDBDialect {
public HapiFhirMariaDBDialect(DatabaseVersion theDatabaseVersion) {
super(theDatabaseVersion);
public HapiFhirMariaDBDialect() {
super();
}
public HapiFhirMariaDBDialect() {
super(DatabaseVersion.make(10, 11, 5));
public HapiFhirMariaDBDialect(DialectResolutionInfo info) {
super(info);
}
/**

View File

@ -19,8 +19,8 @@
*/
package ca.uhn.fhir.jpa.model.dialect;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.dialect.MySQLDialect;
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
/**
* Dialect for MySQL database.
@ -28,12 +28,12 @@ import org.hibernate.dialect.MySQLDialect;
*/
public class HapiFhirMySQLDialect extends MySQLDialect {
public HapiFhirMySQLDialect(DatabaseVersion theDatabaseVersion) {
super(theDatabaseVersion);
public HapiFhirMySQLDialect() {
super();
}
public HapiFhirMySQLDialect() {
super(DatabaseVersion.make(5, 7));
public HapiFhirMySQLDialect(DialectResolutionInfo info) {
super(info);
}
/**

View File

@ -19,8 +19,8 @@
*/
package ca.uhn.fhir.jpa.model.dialect;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.dialect.OracleDialect;
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
/**
* Dialect for Oracle database.
@ -28,12 +28,12 @@ import org.hibernate.dialect.OracleDialect;
*/
public class HapiFhirOracleDialect extends OracleDialect {
public HapiFhirOracleDialect(DatabaseVersion theDatabaseVersion) {
super(theDatabaseVersion);
public HapiFhirOracleDialect() {
super();
}
public HapiFhirOracleDialect() {
super(DatabaseVersion.make(12, 2));
public HapiFhirOracleDialect(DialectResolutionInfo info) {
super(info);
}
/**

View File

@ -19,17 +19,17 @@
*/
package ca.uhn.fhir.jpa.model.dialect;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.dialect.PostgreSQLDialect;
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
public class HapiFhirPostgresDialect extends PostgreSQLDialect {
public HapiFhirPostgresDialect(DatabaseVersion theDatabaseVersion) {
super(theDatabaseVersion);
public HapiFhirPostgresDialect() {
super();
}
public HapiFhirPostgresDialect() {
super(DatabaseVersion.make(10, 0, 0));
public HapiFhirPostgresDialect(DialectResolutionInfo info) {
super(info);
}
/**

View File

@ -19,8 +19,8 @@
*/
package ca.uhn.fhir.jpa.model.dialect;
import org.hibernate.dialect.DatabaseVersion;
import org.hibernate.dialect.SQLServerDialect;
import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo;
/**
* Dialect for MS SQL Server database.
@ -28,12 +28,12 @@ import org.hibernate.dialect.SQLServerDialect;
*/
public class HapiFhirSQLServerDialect extends SQLServerDialect {
public HapiFhirSQLServerDialect(DatabaseVersion theDatabaseVersion) {
super(theDatabaseVersion);
public HapiFhirSQLServerDialect() {
super();
}
public HapiFhirSQLServerDialect() {
super(DatabaseVersion.make(11));
public HapiFhirSQLServerDialect(DialectResolutionInfo info) {
super(info);
}
/**