HHH-16223 Deprecate HBM2DDL_DATABASE_ACTION
This commit is contained in:
parent
82ee4c9250
commit
335e468943
|
@ -1639,20 +1639,10 @@ public interface AvailableSettings {
|
||||||
String HBM2DDL_CONNECTION = "javax.persistence.schema-generation-connection";
|
String HBM2DDL_CONNECTION = "javax.persistence.schema-generation-connection";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Specifies whether schema generation commands for schema creation are to be determined based
|
* @deprecated Migrate to {@link #JAKARTA_HBM2DDL_CREATE_SOURCE} instead
|
||||||
* 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_CREATE_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_CREATE_SOURCE = "javax.persistence.schema-generation.create-source";
|
String HBM2DDL_CREATE_SOURCE = "javax.persistence.schema-generation.create-source";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class OneToOneJoinTableUniquenessTest extends BaseCoreFunctionalTestCase
|
||||||
String value = output.toPath().toString();
|
String value = output.toPath().toString();
|
||||||
configuration.setProperty( AvailableSettings.HBM2DDL_SCRIPTS_CREATE_TARGET, value );
|
configuration.setProperty( AvailableSettings.HBM2DDL_SCRIPTS_CREATE_TARGET, value );
|
||||||
configuration.setProperty( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "create" );
|
configuration.setProperty( AvailableSettings.HBM2DDL_SCRIPTS_ACTION, "create" );
|
||||||
configuration.setProperty( AvailableSettings.HBM2DDL_DATABASE_ACTION, "create-drop" );
|
configuration.setProperty( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" );
|
||||||
configuration.setProperty( AvailableSettings.FORMAT_SQL, "false" );
|
configuration.setProperty( AvailableSettings.FORMAT_SQL, "false" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
@SessionFactory(useCollectingStatementInspector = true)
|
@SessionFactory(useCollectingStatementInspector = true)
|
||||||
@ServiceRegistry(
|
@ServiceRegistry(
|
||||||
settings = {
|
settings = {
|
||||||
@Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
@Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public class EagerToOneWithJoinFetchModeTests {
|
public class EagerToOneWithJoinFetchModeTests {
|
||||||
|
|
|
@ -46,7 +46,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
@SessionFactory(useCollectingStatementInspector = true)
|
@SessionFactory(useCollectingStatementInspector = true)
|
||||||
@ServiceRegistry(
|
@ServiceRegistry(
|
||||||
settings = {
|
settings = {
|
||||||
@Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
@Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public class EagerToOneWithSelectFetchModeTests {
|
public class EagerToOneWithSelectFetchModeTests {
|
||||||
|
|
|
@ -47,7 +47,7 @@ import static org.hamcrest.MatcherAssert.assertThat;
|
||||||
@SessionFactory(useCollectingStatementInspector = true)
|
@SessionFactory(useCollectingStatementInspector = true)
|
||||||
@ServiceRegistry(
|
@ServiceRegistry(
|
||||||
settings = {
|
settings = {
|
||||||
@Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
@Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public class LazyToOneWithJoinFetchModeTests {
|
public class LazyToOneWithJoinFetchModeTests {
|
||||||
|
|
|
@ -47,7 +47,7 @@ import static org.hibernate.testing.hamcrest.CollectionMatchers.hasSize;
|
||||||
@SessionFactory(useCollectingStatementInspector = true)
|
@SessionFactory(useCollectingStatementInspector = true)
|
||||||
@ServiceRegistry(
|
@ServiceRegistry(
|
||||||
settings = {
|
settings = {
|
||||||
@Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
@Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public class LazyToOneWithSelectFetchModeTests {
|
public class LazyToOneWithSelectFetchModeTests {
|
||||||
|
|
|
@ -44,7 +44,7 @@ import org.junit.jupiter.api.Test;
|
||||||
)
|
)
|
||||||
@ServiceRegistry(
|
@ServiceRegistry(
|
||||||
settings = {
|
settings = {
|
||||||
@Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
@Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@SessionFactory
|
@SessionFactory
|
||||||
|
|
|
@ -37,7 +37,7 @@ import static org.junit.Assert.assertThat;
|
||||||
)
|
)
|
||||||
@ServiceRegistry(
|
@ServiceRegistry(
|
||||||
settings = {
|
settings = {
|
||||||
@Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
@Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@SessionFactory
|
@SessionFactory
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
|
||||||
@TestForIssue(jiraKey = "HHH-8271")
|
@TestForIssue(jiraKey = "HHH-8271")
|
||||||
public void testSqlLoadScriptSourceClasspath() {
|
public void testSqlLoadScriptSourceClasspath() {
|
||||||
Map<Object, Object> settings = buildSettings();
|
Map<Object, Object> settings = buildSettings();
|
||||||
settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "create-drop" );
|
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" );
|
||||||
settings.put( AvailableSettings.HBM2DDL_LOAD_SCRIPT_SOURCE, getLoadSqlScript() );
|
settings.put( AvailableSettings.HBM2DDL_LOAD_SCRIPT_SOURCE, getLoadSqlScript() );
|
||||||
doTest( settings );
|
doTest( settings );
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
|
||||||
@TestForIssue(jiraKey = "HHH-8271")
|
@TestForIssue(jiraKey = "HHH-8271")
|
||||||
public void testSqlLoadScriptSourceUrl() {
|
public void testSqlLoadScriptSourceUrl() {
|
||||||
Map<Object, Object> settings = buildSettings();
|
Map<Object, Object> settings = buildSettings();
|
||||||
settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "create-drop" );
|
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" );
|
||||||
settings.put( AvailableSettings.HBM2DDL_LOAD_SCRIPT_SOURCE, getResourceUrlString( getLoadSqlScript() ) );
|
settings.put( AvailableSettings.HBM2DDL_LOAD_SCRIPT_SOURCE, getResourceUrlString( getLoadSqlScript() ) );
|
||||||
doTest( settings );
|
doTest( settings );
|
||||||
}
|
}
|
||||||
|
@ -68,8 +68,8 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
|
||||||
@TestForIssue(jiraKey = "HHH-8271")
|
@TestForIssue(jiraKey = "HHH-8271")
|
||||||
public void testSqlCreateScriptSourceClasspath() {
|
public void testSqlCreateScriptSourceClasspath() {
|
||||||
Map<Object, Object> settings = buildSettings();
|
Map<Object, Object> settings = buildSettings();
|
||||||
settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "create-drop" );
|
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" );
|
||||||
settings.put( AvailableSettings.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.HBM2DDL_CREATE_SCRIPT_SOURCE, getCreateSqlScript() );
|
||||||
doTest( settings );
|
doTest( settings );
|
||||||
}
|
}
|
||||||
|
@ -78,8 +78,8 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
|
||||||
@TestForIssue(jiraKey = "HHH-8271")
|
@TestForIssue(jiraKey = "HHH-8271")
|
||||||
public void testSqlCreateScriptSourceUrl() {
|
public void testSqlCreateScriptSourceUrl() {
|
||||||
Map<Object, Object> settings = buildSettings();
|
Map<Object, Object> settings = buildSettings();
|
||||||
settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "create-drop" );
|
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "create-drop" );
|
||||||
settings.put( AvailableSettings.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.HBM2DDL_CREATE_SCRIPT_SOURCE, getResourceUrlString( getCreateSqlScript() ) );
|
||||||
doTest( settings );
|
doTest( settings );
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
|
||||||
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.HBM2DDL_DROP_SOURCE, "metadata-then-script" );
|
||||||
settings.put( AvailableSettings.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 );
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ public class JpaSchemaGeneratorTest extends EntityManagerFactoryBasedFunctionalT
|
||||||
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.HBM2DDL_DROP_SOURCE, "metadata-then-script" );
|
||||||
settings.put( AvailableSettings.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 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,7 +119,7 @@ public class SchemaDatabaseFileGenerationFailureTest {
|
||||||
private Map getConfig() {
|
private Map getConfig() {
|
||||||
final Map<Object, Object> config = Environment.getProperties();
|
final Map<Object, Object> config = Environment.getProperties();
|
||||||
config.put( AvailableSettings.HBM2DDL_CONNECTION, connection );
|
config.put( AvailableSettings.HBM2DDL_CONNECTION, connection );
|
||||||
config.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, "drop" );
|
config.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, "drop" );
|
||||||
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<>();
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ import static org.junit.Assert.assertTrue;
|
||||||
settings = {
|
settings = {
|
||||||
@Setting( name = AvailableSettings.USE_SECOND_LEVEL_CACHE, value = "true" ),
|
@Setting( name = AvailableSettings.USE_SECOND_LEVEL_CACHE, value = "true" ),
|
||||||
@Setting( name = AvailableSettings.GENERATE_STATISTICS, value = "true" ),
|
@Setting( name = AvailableSettings.GENERATE_STATISTICS, value = "true" ),
|
||||||
@Setting( name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop" )
|
@Setting( name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop" )
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@DomainModel(
|
@DomainModel(
|
||||||
|
|
|
@ -51,7 +51,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
@ServiceRegistry(
|
@ServiceRegistry(
|
||||||
settings = {
|
settings = {
|
||||||
@Setting(name = AvailableSettings.GENERATE_STATISTICS, value = "true"),
|
@Setting(name = AvailableSettings.GENERATE_STATISTICS, value = "true"),
|
||||||
@Setting(name = AvailableSettings.HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
@Setting(name = AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public class OneToManyBidirectionalTest {
|
public class OneToManyBidirectionalTest {
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class SchemaMigrationTargetScriptCreationTest extends BaseCoreFunctionalT
|
||||||
fail( e.getMessage() );
|
fail( e.getMessage() );
|
||||||
}
|
}
|
||||||
output.deleteOnExit();
|
output.deleteOnExit();
|
||||||
configuration.setProperty( Environment.HBM2DDL_DATABASE_ACTION, "update" );
|
configuration.setProperty( Environment.JAKARTA_HBM2DDL_DATABASE_ACTION, "update" );
|
||||||
configuration.setProperty( Environment.HBM2DDL_SCRIPTS_ACTION, "update" );
|
configuration.setProperty( Environment.HBM2DDL_SCRIPTS_ACTION, "update" );
|
||||||
configuration.setProperty( Environment.HBM2DDL_SCRIPTS_CREATE_TARGET, output.getAbsolutePath() );
|
configuration.setProperty( Environment.HBM2DDL_SCRIPTS_CREATE_TARGET, output.getAbsolutePath() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,15 +25,18 @@ import org.hibernate.testing.orm.junit.SkipForDialect;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.hibernate.cfg.AvailableSettings.HBM2DDL_DATABASE_ACTION;
|
import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
@SessionFactory
|
@SessionFactory
|
||||||
@DomainModel(annotatedClasses = { Account.class, Client.class, Record.class })
|
@DomainModel(annotatedClasses = { Account.class, Client.class, Record.class })
|
||||||
@ServiceRegistry(
|
@ServiceRegistry(
|
||||||
settings = {
|
settings = {
|
||||||
@Setting(name = HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
@Setting(name = JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public class TenantIdTest implements SessionFactoryProducer {
|
public class TenantIdTest implements SessionFactoryProducer {
|
||||||
|
|
|
@ -21,14 +21,14 @@ import org.hibernate.binder.internal.TenantIdBinder;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import static org.hibernate.cfg.AvailableSettings.HBM2DDL_DATABASE_ACTION;
|
import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
@SessionFactory
|
@SessionFactory
|
||||||
@DomainModel(annotatedClasses = { Account.class, Client.class })
|
@DomainModel(annotatedClasses = { Account.class, Client.class })
|
||||||
@ServiceRegistry(
|
@ServiceRegistry(
|
||||||
settings = {
|
settings = {
|
||||||
@Setting(name = HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
@Setting(name = JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public class TenantLongIdTest implements SessionFactoryProducer {
|
public class TenantLongIdTest implements SessionFactoryProducer {
|
||||||
|
|
|
@ -23,14 +23,17 @@ import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import static org.hibernate.cfg.AvailableSettings.HBM2DDL_DATABASE_ACTION;
|
import static org.hibernate.cfg.AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
@SessionFactory
|
@SessionFactory
|
||||||
@DomainModel(annotatedClasses = { Account.class, Client.class })
|
@DomainModel(annotatedClasses = { Account.class, Client.class })
|
||||||
@ServiceRegistry(
|
@ServiceRegistry(
|
||||||
settings = {
|
settings = {
|
||||||
@Setting(name = HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
@Setting(name = JAKARTA_HBM2DDL_DATABASE_ACTION, value = "create-drop")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
public class TenantUuidTest implements SessionFactoryProducer {
|
public class TenantUuidTest implements SessionFactoryProducer {
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class OrderSequenceGenerationTest extends BaseEnversJPAFunctionalTestCase
|
||||||
options.put( AvailableSettings.HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() );
|
options.put( AvailableSettings.HBM2DDL_SCRIPTS_CREATE_TARGET, createSchema.toPath() );
|
||||||
options.put( AvailableSettings.HBM2DDL_SCRIPTS_DROP_TARGET, dropSchema.toPath() );
|
options.put( AvailableSettings.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.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" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class RefreshUpdatedDataTest {
|
||||||
|
|
||||||
serviceRegistry = ssrb
|
serviceRegistry = ssrb
|
||||||
.configure( "hibernate-config/hibernate.cfg.xml" )
|
.configure( "hibernate-config/hibernate.cfg.xml" )
|
||||||
.applySetting( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP )
|
.applySetting( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP )
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
final MetadataSources metadataSources = new MetadataSources( serviceRegistry );
|
final MetadataSources metadataSources = new MetadataSources( serviceRegistry );
|
||||||
|
|
|
@ -119,7 +119,7 @@ public class TestHelper {
|
||||||
final StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder()
|
final StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder()
|
||||||
.configure( "hibernate-config/hibernate.cfg.xml" )
|
.configure( "hibernate-config/hibernate.cfg.xml" )
|
||||||
.applySetting( AvailableSettings.GENERATE_STATISTICS, "true" )
|
.applySetting( AvailableSettings.GENERATE_STATISTICS, "true" )
|
||||||
.applySetting( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP )
|
.applySetting( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP )
|
||||||
.applySetting( AvailableSettings.HBM2DDL_AUTO, "create-drop" );
|
.applySetting( AvailableSettings.HBM2DDL_AUTO, "create-drop" );
|
||||||
|
|
||||||
if ( H2Dialect.class.equals( DialectContext.getDialect().getClass() ) ) {
|
if ( H2Dialect.class.equals( DialectContext.getDialect().getClass() ) ) {
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class EntityManagerFactoryExtension
|
||||||
|
|
||||||
if ( emfAnn.exportSchema() ) {
|
if ( emfAnn.exportSchema() ) {
|
||||||
pui.getProperties().setProperty(
|
pui.getProperties().setProperty(
|
||||||
AvailableSettings.HBM2DDL_DATABASE_ACTION,
|
AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION,
|
||||||
Action.CREATE_DROP.getExternalHbm2ddlName()
|
Action.CREATE_DROP.getExternalHbm2ddlName()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -251,7 +251,7 @@ public class EntityManagerFactoryExtension
|
||||||
}
|
}
|
||||||
|
|
||||||
final HashMap<String,Object> settings = new HashMap<>( baseProperties );
|
final HashMap<String,Object> settings = new HashMap<>( baseProperties );
|
||||||
settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP );
|
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE_DROP );
|
||||||
|
|
||||||
final StandardServiceRegistry serviceRegistry = model.getMetadataBuildingOptions().getServiceRegistry();
|
final StandardServiceRegistry serviceRegistry = model.getMetadataBuildingOptions().getServiceRegistry();
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class SchemaCreateHelper {
|
||||||
|
|
||||||
public static void create(Metadata metadata, ServiceRegistry serviceRegistry) {
|
public static void create(Metadata metadata, ServiceRegistry serviceRegistry) {
|
||||||
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
||||||
settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE );
|
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE );
|
||||||
SchemaManagementToolCoordinator.process(
|
SchemaManagementToolCoordinator.process(
|
||||||
metadata,
|
metadata,
|
||||||
serviceRegistry,
|
serviceRegistry,
|
||||||
|
@ -46,7 +46,7 @@ public class SchemaCreateHelper {
|
||||||
|
|
||||||
public static void createOnly(Metadata metadata, ServiceRegistry serviceRegistry) {
|
public static void createOnly(Metadata metadata, ServiceRegistry serviceRegistry) {
|
||||||
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
||||||
settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE_ONLY );
|
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE_ONLY );
|
||||||
SchemaManagementToolCoordinator.process(
|
SchemaManagementToolCoordinator.process(
|
||||||
metadata,
|
metadata,
|
||||||
serviceRegistry,
|
serviceRegistry,
|
||||||
|
@ -60,7 +60,7 @@ public class SchemaCreateHelper {
|
||||||
StandardServiceRegistry serviceRegistry,
|
StandardServiceRegistry serviceRegistry,
|
||||||
Connection connection) {
|
Connection connection) {
|
||||||
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
||||||
settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.CREATE );
|
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.CREATE );
|
||||||
settings.put( AvailableSettings.HBM2DDL_CONNECTION, connection );
|
settings.put( AvailableSettings.HBM2DDL_CONNECTION, connection );
|
||||||
SchemaManagementToolCoordinator.process(
|
SchemaManagementToolCoordinator.process(
|
||||||
metadata,
|
metadata,
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class SchemaDropHelper {
|
||||||
|
|
||||||
public static void drop(Metadata metadata, ServiceRegistry serviceRegistry) {
|
public static void drop(Metadata metadata, ServiceRegistry serviceRegistry) {
|
||||||
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
||||||
settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.DROP );
|
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.DROP );
|
||||||
SchemaManagementToolCoordinator.process(
|
SchemaManagementToolCoordinator.process(
|
||||||
metadata,
|
metadata,
|
||||||
serviceRegistry,
|
serviceRegistry,
|
||||||
|
@ -46,7 +46,7 @@ public class SchemaDropHelper {
|
||||||
StandardServiceRegistry serviceRegistry,
|
StandardServiceRegistry serviceRegistry,
|
||||||
Connection connection) {
|
Connection connection) {
|
||||||
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
||||||
settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.DROP );
|
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.DROP );
|
||||||
settings.put( AvailableSettings.HBM2DDL_CONNECTION, connection );
|
settings.put( AvailableSettings.HBM2DDL_CONNECTION, connection );
|
||||||
SchemaManagementToolCoordinator.process(
|
SchemaManagementToolCoordinator.process(
|
||||||
metadata,
|
metadata,
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class SchemaUpdateHelper {
|
||||||
|
|
||||||
public static void update(Metadata metadata, ServiceRegistry serviceRegistry) {
|
public static void update(Metadata metadata, ServiceRegistry serviceRegistry) {
|
||||||
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
final Map settings = serviceRegistry.getService( ConfigurationService.class ).getSettings();
|
||||||
settings.put( AvailableSettings.HBM2DDL_DATABASE_ACTION, Action.UPDATE );
|
settings.put( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, Action.UPDATE );
|
||||||
SchemaManagementToolCoordinator.process(
|
SchemaManagementToolCoordinator.process(
|
||||||
metadata,
|
metadata,
|
||||||
serviceRegistry,
|
serviceRegistry,
|
||||||
|
|
|
@ -243,7 +243,7 @@ public class SchemaExportTask extends MatchingTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( output.doExport() ) {
|
if ( output.doExport() ) {
|
||||||
ssrBuilder.applySetting( AvailableSettings.HBM2DDL_DATABASE_ACTION, exportType.getAction() );
|
ssrBuilder.applySetting( AvailableSettings.JAKARTA_HBM2DDL_DATABASE_ACTION, exportType.getAction() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue