Rename AvailbaleSetting JAKARTA_DIALECT_DB_VERSION to JAKARTA_HBM2DDL_DB_VERSION and fix its values

This commit is contained in:
Andrea Boriero 2021-09-28 09:18:50 +02:00 committed by Steve Ebersole
parent 60b3d4ec8f
commit 05b2ca3b83
2 changed files with 4 additions and 4 deletions

View File

@ -1831,7 +1831,7 @@ public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings {
*
* @see #DIALECT_DB_NAME
*/
String JAKARTA_DIALECT_DB_VERSION = "javax.persistence.database-product-version";
String JAKARTA_HBM2DDL_DB_VERSION = "jakarta.persistence.database-product-version";
/**
* Specifies the major version of the underlying database, as would be returned by

View File

@ -57,7 +57,7 @@ import static org.hibernate.cfg.AvailableSettings.HBM2DDL_CONNECTION;
import static org.hibernate.cfg.AvailableSettings.HBM2DDL_DB_MAJOR_VERSION;
import static org.hibernate.cfg.AvailableSettings.HBM2DDL_DB_MINOR_VERSION;
import static org.hibernate.cfg.AvailableSettings.HBM2DDL_DELIMITER;
import static org.hibernate.cfg.AvailableSettings.JAKARTA_DIALECT_DB_VERSION;
import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_DB_VERSION;
import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_CONNECTION;
import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_DB_MAJOR_VERSION;
import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_DB_MINOR_VERSION;
@ -245,11 +245,11 @@ public class HibernateSchemaManagementTool implements SchemaManagementTool, Serv
);
if ( dbName != null ) {
final String dbVersion = (String) coalesceSuppliedValues(
() -> configurationValues.get( JAKARTA_DIALECT_DB_VERSION ),
() -> configurationValues.get( JAKARTA_HBM2DDL_DB_VERSION ),
() -> {
final String name = (String) configurationValues.get( DIALECT_DB_VERSION );
if ( StringHelper.isNotEmpty( name ) ) {
DEPRECATION_LOGGER.deprecatedSetting( DIALECT_DB_VERSION, JAKARTA_DIALECT_DB_VERSION );
DEPRECATION_LOGGER.deprecatedSetting( DIALECT_DB_VERSION, JAKARTA_HBM2DDL_DB_VERSION );
}
return name;
}