HHH-16223 Deprecate HBM2DDL_CREATE_SCRIPT_SOURCE

This commit is contained in:
Sanne Grinovero 2023-03-07 15:03:35 +00:00
parent b86758ecab
commit 39f05629fc
2 changed files with 4 additions and 10 deletions

View File

@ -1653,15 +1653,9 @@ public interface AvailableSettings {
String HBM2DDL_DROP_SOURCE = "javax.persistence.schema-generation.drop-source"; String HBM2DDL_DROP_SOURCE = "javax.persistence.schema-generation.drop-source";
/** /**
* Specifies the CREATE script file as either a {@link java.io.Reader} configured for reading * @deprecated Migrate to {@link #JAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE}
* the DDL script file or a string designating a file {@link java.net.URL} for the DDL script.
* <p>
* Hibernate historically also accepted {@link #HBM2DDL_IMPORT_FILES} for a similar purpose.
* This setting is now preferred.
*
* @see #HBM2DDL_CREATE_SOURCE
* @see #HBM2DDL_IMPORT_FILES
*/ */
@Deprecated
String HBM2DDL_CREATE_SCRIPT_SOURCE = "javax.persistence.schema-generation.create-script-source"; String HBM2DDL_CREATE_SCRIPT_SOURCE = "javax.persistence.schema-generation.create-script-source";
/** /**

View File

@ -70,7 +70,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
Map<Object, Object> settings = buildSettings(); Map<Object, Object> settings = buildSettings();
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" ); settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" );
settings.put( AvailableSettings.JAKARTA_HBM2DDL_CREATE_SOURCE, "metadata-then-script" ); settings.put( AvailableSettings.JAKARTA_HBM2DDL_CREATE_SOURCE, "metadata-then-script" );
settings.put( AvailableSettings.HBM2DDL_CREATE_SCRIPT_SOURCE, getCreateSqlScript() ); settings.put( AvailableSettings.JAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE, getCreateSqlScript() );
doTest( settings ); doTest( settings );
} }
@ -80,7 +80,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
Map<Object, Object> settings = buildSettings(); Map<Object, Object> settings = buildSettings();
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" ); settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" );
settings.put( AvailableSettings.JAKARTA_HBM2DDL_CREATE_SOURCE, "metadata-then-script" ); settings.put( AvailableSettings.JAKARTA_HBM2DDL_CREATE_SOURCE, "metadata-then-script" );
settings.put( AvailableSettings.HBM2DDL_CREATE_SCRIPT_SOURCE, getResourceUrlString( getCreateSqlScript() ) ); settings.put( AvailableSettings.JAKARTA_HBM2DDL_CREATE_SCRIPT_SOURCE, getResourceUrlString( getCreateSqlScript() ) );
doTest( settings ); doTest( settings );
} }