Override CockroachDialect#determineDatabaseVersion implementation

This commit is contained in:
Marco Belladelli 2024-09-16 10:45:09 +02:00
parent e66cbc1d8f
commit 9b5f17340f
2 changed files with 12 additions and 1 deletions

View File

@ -149,7 +149,13 @@ public class CockroachLegacyDialect extends Dialect {
super(version); super(version);
this.driverKind = driverKind; this.driverKind = driverKind;
} }
protected static DatabaseVersion fetchDataBaseVersion( DialectResolutionInfo info ) {
@Override
public DatabaseVersion determineDatabaseVersion(DialectResolutionInfo info) {
return fetchDataBaseVersion( info );
}
protected static DatabaseVersion fetchDataBaseVersion(DialectResolutionInfo info ) {
String versionString = null; String versionString = null;
if ( info.getDatabaseMetadata() != null ) { if ( info.getDatabaseMetadata() != null ) {
try (java.sql.Statement s = info.getDatabaseMetadata().getConnection().createStatement() ) { try (java.sql.Statement s = info.getDatabaseMetadata().getConnection().createStatement() ) {

View File

@ -163,6 +163,11 @@ public class CockroachDialect extends Dialect {
this.driverKind = driverKind; this.driverKind = driverKind;
} }
@Override
public DatabaseVersion determineDatabaseVersion(DialectResolutionInfo info) {
return fetchDataBaseVersion( info );
}
protected static DatabaseVersion fetchDataBaseVersion(DialectResolutionInfo info) { protected static DatabaseVersion fetchDataBaseVersion(DialectResolutionInfo info) {
String versionString = null; String versionString = null;
if ( info.getDatabaseMetadata() != null ) { if ( info.getDatabaseMetadata() != null ) {