HHH-16223 Deprecate HBM2DDL_DROP_SOURCE

This commit is contained in:
Sanne Grinovero 2023-03-07 15:00:43 +00:00 committed by Sanne Grinovero
parent 335e468943
commit eeebd1c373
3 changed files with 7 additions and 17 deletions

View File

@ -1646,20 +1646,10 @@ public interface AvailableSettings {
String HBM2DDL_CREATE_SOURCE = "javax.persistence.schema-generation.create-source";
/**
* Specifies whether schema generation commands for schema dropping are to be determined
* based on object/relational mapping metadata, DDL scripts, or a combination of the two.
* See {@link org.hibernate.tool.schema.SourceType} for the list of legal values.
* <p>
* If no value is specified, a default is inferred as follows:
* <ul>
* <li>if source scripts are specified via {@value #HBM2DDL_DROP_SCRIPT_SOURCE}, then
* {@link org.hibernate.tool.schema.SourceType#SCRIPT "script"} is assumed, or
* <li>otherwise, {@link org.hibernate.tool.schema.SourceType#SCRIPT "metadata"} is
* assumed.
* </ul>
*
* @deprecated Migrate to {@link #JAKARTA_HBM2DDL_DROP_SOURCE}.
* @see org.hibernate.tool.schema.SourceType
*/
@Deprecated
String HBM2DDL_DROP_SOURCE = "javax.persistence.schema-generation.drop-source";
/**
@ -1937,7 +1927,7 @@ public interface AvailableSettings {
* Specifies the DROP script file as either a {@link java.io.Reader} configured for reading
* the DDL script file or a string designating a file {@link java.net.URL} for the DDL script.
*
* @see #HBM2DDL_DROP_SOURCE
* @see #JAKARTA_HBM2DDL_DROP_SOURCE
*/
String JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE = "jakarta.persistence.schema-generation.drop-script-source";

View File

@ -12,8 +12,8 @@ import org.hibernate.cfg.AvailableSettings;
* Enumeration of the various types of sources understood by various SchemaManagementTooling
* delegates.
*
* @see AvailableSettings#HBM2DDL_CREATE_SOURCE
* @see AvailableSettings#HBM2DDL_DROP_SOURCE
* @see AvailableSettings#JAKARTA_HBM2DDL_CREATE_SOURCE
* @see AvailableSettings#JAKARTA_HBM2DDL_DROP_SOURCE
*
* @author Steve Ebersole
*/

View File

@ -89,7 +89,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
@TestForIssue(jiraKey = "HHH-8271")
public void testSqlDropScriptSourceClasspath() {
Map<Object, Object> settings = buildSettings();
settings.put( AvailableSettings.HBM2DDL_DROP_SOURCE, "metadata-then-script" );
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DROP_SOURCE, "metadata-then-script" );
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "drop" );
settings.put( AvailableSettings.HBM2DDL_DROP_SCRIPT_SOURCE, getDropSqlScript() );
doTest( settings );
@ -99,7 +99,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
@TestForIssue(jiraKey = "HHH-8271")
public void testSqlDropScriptSourceUrl() {
Map<Object, Object> settings = buildSettings();
settings.put( AvailableSettings.HBM2DDL_DROP_SOURCE, "metadata-then-script" );
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DROP_SOURCE, "metadata-then-script" );
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "drop" );
settings.put( AvailableSettings.HBM2DDL_DROP_SCRIPT_SOURCE, getResourceUrlString( getDropSqlScript() ) );
doTest( settings );