use of org.hibernate.test.hbm.index.JournalingSchemaToolingTarget in project hibernate-orm by hibernate.
the class UniqueDelegateTest method testUniqueDelegateConsulted.
@Test
@TestForIssue(jiraKey = "HHH-10203")
public void testUniqueDelegateConsulted() {
final Metadata metadata = new MetadataSources(ssr).addResource("org/hibernate/test/hbm/uk/person_unique.hbm.xml").buildMetadata();
final JournalingSchemaToolingTarget target = new JournalingSchemaToolingTarget();
new SchemaCreatorImpl(ssr).doCreation(metadata, false, target);
assertThat(getAlterTableToAddUniqueKeyCommandCallCount, equalTo(1));
assertThat(getColumnDefinitionUniquenessFragmentCallCount, equalTo(1));
assertThat(getTableCreationUniqueConstraintsFragmentCallCount, equalTo(1));
new SchemaDropperImpl(ssr).doDrop(metadata, false, target);
// unique keys are not dropped explicitly
assertThat(getAlterTableToAddUniqueKeyCommandCallCount, equalTo(1));
assertThat(getColumnDefinitionUniquenessFragmentCallCount, equalTo(1));
assertThat(getTableCreationUniqueConstraintsFragmentCallCount, equalTo(1));
}
use of org.hibernate.test.hbm.index.JournalingSchemaToolingTarget in project hibernate-orm by hibernate.
the class CollectionPkTest method verifyPkNameUsed.
private void verifyPkNameUsed(String mappingResource, String expectedName) {
final Metadata metadata = new MetadataSources(ssr).addResource(mappingResource).buildMetadata();
final JournalingSchemaToolingTarget target = new JournalingSchemaToolingTarget();
new SchemaCreatorImpl(ssr).doCreation(metadata, false, target);
assertTrue("Expected foreign-key name [" + expectedName + "] not seen in schema creation output", target.containedText(expectedName));
}
use of org.hibernate.test.hbm.index.JournalingSchemaToolingTarget in project hibernate-orm by hibernate.
the class CollectionKeyFkNameTest method verifyFkNameUsed.
private void verifyFkNameUsed(String mappingResource, String expectedName) {
final Metadata metadata = new MetadataSources(ssr).addResource(mappingResource).buildMetadata();
final JournalingSchemaToolingTarget target = new JournalingSchemaToolingTarget();
new SchemaCreatorImpl(ssr).doCreation(metadata, ssr, ssr.getService(ConfigurationService.class).getSettings(), false, target);
assertTrue("Expected foreign-key name [" + expectedName + "] not seen in schema creation output", target.containedText(expectedName));
}
Aggregations