HHH-16223 Deprecate HBM2DDL_SCRIPTS_DROP_TARGET

This commit is contained in:
Sanne Grinovero 2023-03-07 15:11:05 +00:00 committed by Sanne Grinovero
parent a15eb53f6f
commit 755e78ba18
7 changed files with 9 additions and 14 deletions

View File

@ -1683,14 +1683,9 @@ public interface AvailableSettings {
String HBM2DDL_SCRIPTS_CREATE_APPEND = "hibernate.hbm2ddl.schema-generation.script.append"; String HBM2DDL_SCRIPTS_CREATE_APPEND = "hibernate.hbm2ddl.schema-generation.script.append";
/** /**
* For cases where the {@value #HBM2DDL_SCRIPTS_ACTION} value indicates that schema drop commands * @deprecated Migrate to {@link #JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET}
* should be written to DDL script file, {@value #HBM2DDL_SCRIPTS_DROP_TARGET} specifies either a
* {@link java.io.Writer} configured for output of the DDL script or a string specifying the file
* URL for the DDL script.
*
* @see #HBM2DDL_SCRIPTS_ACTION
*/ */
@SuppressWarnings("JavaDoc") @Deprecated
String HBM2DDL_SCRIPTS_DROP_TARGET = "javax.persistence.schema-generation.scripts.drop-target"; String HBM2DDL_SCRIPTS_DROP_TARGET = "javax.persistence.schema-generation.scripts.drop-target";
/** /**

View File

@ -690,7 +690,7 @@ public class DefaultCatalogAndSchemaTest {
StringWriter writer = new StringWriter(); StringWriter writer = new StringWriter();
settings.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, action ); settings.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, action );
settings.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, writer ); settings.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, writer );
settings.put( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, writer ); settings.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, writer );
SchemaManagementToolCoordinator.process( SchemaManagementToolCoordinator.process(
metadata, serviceRegistry, settings, DelayedDropRegistryNotAvailableImpl.INSTANCE ); metadata, serviceRegistry, settings, DelayedDropRegistryNotAvailableImpl.INSTANCE );

View File

@ -29,8 +29,8 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import static org.hibernate.cfg.AvailableSettings.HBM2DDL_SCRIPTS_ACTION; import static org.hibernate.cfg.AvailableSettings.HBM2DDL_SCRIPTS_ACTION;
import static org.hibernate.cfg.AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET;
import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET; import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET;
import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
/** /**
@ -46,7 +46,7 @@ public class SchemaCreateDropUtf8WithoutHbm2DdlCharsetNameTest {
protected Map getConfig() { protected Map getConfig() {
final Map<Object, Object> config = Environment.getProperties(); final Map<Object, Object> config = Environment.getProperties();
config.put( JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() ); config.put( JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() );
config.put( HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() ); config.put( JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() );
config.put( HBM2DDL_SCRIPTS_ACTION, "drop-and-create" ); config.put( HBM2DDL_SCRIPTS_ACTION, "drop-and-create" );
ArrayList<Class> classes = new ArrayList<Class>(); ArrayList<Class> classes = new ArrayList<Class>();

View File

@ -110,7 +110,7 @@ public class SchemaScriptFileGenerationFailureTest {
private Map getConfig() { private Map getConfig() {
final Map<Object, Object> config = Environment.getProperties(); final Map<Object, Object> config = Environment.getProperties();
config.put( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, writer ); config.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, writer );
config.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "drop-and-create" ); config.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "drop-and-create" );
config.put( AvailableSettings.HBM2DDL_HALT_ON_ERROR, "true" ); config.put( AvailableSettings.HBM2DDL_HALT_ON_ERROR, "true" );
ArrayList<Class> classes = new ArrayList<>(); ArrayList<Class> classes = new ArrayList<>();

View File

@ -109,7 +109,7 @@ public class SchemaScriptFileGenerationTest {
private Map getConfig() { private Map getConfig() {
final Map<Object, Object> config = Environment.getProperties(); final Map<Object, Object> config = Environment.getProperties();
config.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() ); config.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() );
config.put( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() ); config.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() );
config.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "drop-and-create" ); config.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "drop-and-create" );
ArrayList<Class> classes = new ArrayList<Class>(); ArrayList<Class> classes = new ArrayList<Class>();

View File

@ -77,7 +77,7 @@ public class SchemaDropToOutputScriptTest {
final StandardServiceRegistryBuilder standardServiceRegistryBuilder = new StandardServiceRegistryBuilder() final StandardServiceRegistryBuilder standardServiceRegistryBuilder = new StandardServiceRegistryBuilder()
.applySetting( Environment.FORMAT_SQL, "false" ) .applySetting( Environment.FORMAT_SQL, "false" )
.applySetting( Environment.HBM2DDL_SCRIPTS_ACTION, "drop" ) .applySetting( Environment.HBM2DDL_SCRIPTS_ACTION, "drop" )
.applySetting( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, output.getAbsolutePath() ); .applySetting( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, output.getAbsolutePath() );
if ( append != null ) { if ( append != null ) {
standardServiceRegistryBuilder.applySetting( AvailableSettings.HBM2DDL_SCRIPTS_CREATE_APPEND, append ); standardServiceRegistryBuilder.applySetting( AvailableSettings.HBM2DDL_SCRIPTS_CREATE_APPEND, append );

View File

@ -55,7 +55,7 @@ public class OrderSequenceGenerationTest extends BaseEnversJPAFunctionalTestCase
protected void addConfigOptions(Map options) { protected void addConfigOptions(Map options) {
super.addConfigOptions( options ); super.addConfigOptions( options );
options.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() ); options.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() );
options.put( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() ); options.put( AvailableSettings.JAKARTA_HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() );
options.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "drop-and-create" ); options.put( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "drop-and-create" );
options.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" ); options.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" );
options.put( AvailableSettings.HBM2DDL_AUTO, "create-drop" ); options.put( AvailableSettings.HBM2DDL_AUTO, "create-drop" );