HHH-16223 Deprecate HBM2DDL_DROP_SOURCE
This commit is contained in:
parent
335e468943
commit
eeebd1c373
|
@ -1646,20 +1646,10 @@ public interface AvailableSettings {
|
||||||
String HBM2DDL_CREATE_SOURCE = "javax.persistence.schema-generation.create-source";
|
String HBM2DDL_CREATE_SOURCE = "javax.persistence.schema-generation.create-source";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies whether schema generation commands for schema dropping are to be determined
|
* @deprecated Migrate to {@link #JAKARTA_HBM2DDL_DROP_SOURCE}.
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
* @see org.hibernate.tool.schema.SourceType
|
* @see org.hibernate.tool.schema.SourceType
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
String HBM2DDL_DROP_SOURCE = "javax.persistence.schema-generation.drop-source";
|
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
|
* 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.
|
* 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";
|
String JAKARTA_HBM2DDL_DROP_SCRIPT_SOURCE = "jakarta.persistence.schema-generation.drop-script-source";
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@ import org.hibernate.cfg.AvailableSettings;
|
||||||
* Enumeration of the various types of sources understood by various SchemaManagementTooling
|
* Enumeration of the various types of sources understood by various SchemaManagementTooling
|
||||||
* delegates.
|
* delegates.
|
||||||
*
|
*
|
||||||
* @see AvailableSettings#HBM2DDL_CREATE_SOURCE
|
* @see AvailableSettings#JAKARTA_HBM2DDL_CREATE_SOURCE
|
||||||
* @see AvailableSettings#HBM2DDL_DROP_SOURCE
|
* @see AvailableSettings#JAKARTA_HBM2DDL_DROP_SOURCE
|
||||||
*
|
*
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
|
||||||
@TestForIssue(jiraKey = "HHH-8271")
|
@TestForIssue(jiraKey = "HHH-8271")
|
||||||
public void testSqlDropScriptSourceClasspath() {
|
public void testSqlDropScriptSourceClasspath() {
|
||||||
Map<Object, Object> settings = buildSettings();
|
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.JAKARTA_HBM2DDL_DATABASE_ACTION, "drop" );
|
||||||
settings.put( AvailableSettings.HBM2DDL_DROP_SCRIPT_SOURCE, getDropSqlScript() );
|
settings.put( AvailableSettings.HBM2DDL_DROP_SCRIPT_SOURCE, getDropSqlScript() );
|
||||||
doTest( settings );
|
doTest( settings );
|
||||||
|
@ -99,7 +99,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
|
||||||
@TestForIssue(jiraKey = "HHH-8271")
|
@TestForIssue(jiraKey = "HHH-8271")
|
||||||
public void testSqlDropScriptSourceUrl() {
|
public void testSqlDropScriptSourceUrl() {
|
||||||
Map<Object, Object> settings = buildSettings();
|
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.JAKARTA_HBM2DDL_DATABASE_ACTION, "drop" );
|
||||||
settings.put( AvailableSettings.HBM2DDL_DROP_SCRIPT_SOURCE, getResourceUrlString( getDropSqlScript() ) );
|
settings.put( AvailableSettings.HBM2DDL_DROP_SCRIPT_SOURCE, getResourceUrlString( getDropSqlScript() ) );
|
||||||
doTest( settings );
|
doTest( settings );
|
||||||
|
|
Loading…
Reference in New Issue