use of org.hibernate.boot.Metadata in project hibernate-orm by hibernate.
the class TestAutoFlushBeforeQueryExecution method prepareBootstrapRegistryBuilder.
@Override
protected void prepareBootstrapRegistryBuilder(BootstrapServiceRegistryBuilder builder) {
super.prepareBootstrapRegistryBuilder(builder);
builder.applyIntegrator(new Integrator() {
@Override
public void integrate(Metadata metadata, SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
integrate(serviceRegistry);
}
private void integrate(SessionFactoryServiceRegistry serviceRegistry) {
serviceRegistry.getService(EventListenerRegistry.class).getEventListenerGroup(EventType.PRE_UPDATE).appendListener(InitializingPreUpdateEventListener.INSTANCE);
}
@Override
public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) {
}
});
}
use of org.hibernate.boot.Metadata 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.boot.Metadata in project hibernate-orm by hibernate.
the class ExtendsTest method testAllSeparateInOne.
@Test
public void testAllSeparateInOne() {
Metadata metadata = new MetadataSources(serviceRegistry).addResource(getBaseForMappings() + "extendshbm/allseparateinone.hbm.xml").buildMetadata();
assertNotNull(metadata.getEntityBinding("org.hibernate.test.extendshbm.Customer"));
assertNotNull(metadata.getEntityBinding("org.hibernate.test.extendshbm.Person"));
assertNotNull(metadata.getEntityBinding("org.hibernate.test.extendshbm.Employee"));
}
use of org.hibernate.boot.Metadata in project hibernate-orm by hibernate.
the class ExtendsTest method testOutOfOrder.
@Test
public void testOutOfOrder() {
Metadata metadata = new MetadataSources(serviceRegistry).addResource(getBaseForMappings() + "extendshbm/Customer.hbm.xml").addResource(getBaseForMappings() + "extendshbm/Person.hbm.xml").addResource(getBaseForMappings() + "extendshbm/Employee.hbm.xml").buildMetadata();
assertNotNull(metadata.getEntityBinding("org.hibernate.test.extendshbm.Customer"));
assertNotNull(metadata.getEntityBinding("org.hibernate.test.extendshbm.Person"));
assertNotNull(metadata.getEntityBinding("org.hibernate.test.extendshbm.Employee"));
}
use of org.hibernate.boot.Metadata in project hibernate-orm by hibernate.
the class ExtendsTest method testAllInOne.
@Test
public void testAllInOne() {
Metadata metadata = new MetadataSources(serviceRegistry).addResource(getBaseForMappings() + "extendshbm/allinone.hbm.xml").buildMetadata();
assertNotNull(metadata.getEntityBinding("org.hibernate.test.extendshbm.Customer"));
assertNotNull(metadata.getEntityBinding("org.hibernate.test.extendshbm.Person"));
assertNotNull(metadata.getEntityBinding("org.hibernate.test.extendshbm.Employee"));
}
Aggregations