use of org.hibernate.boot.internal.BootstrapContextImpl in project jbosstools-hibernate by jbosstools.
the class DummyMetadataBuildingContext method createInstance.
private static MetadataBuildingContext createInstance() {
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
ssrb.applySetting(AvailableSettings.DIALECT, MockDialect.class.getName());
ssrb.applySetting(AvailableSettings.CONNECTION_PROVIDER, MockConnectionProvider.class.getName());
StandardServiceRegistry serviceRegistry = ssrb.build();
MetadataBuildingOptions metadataBuildingOptions = new MetadataBuilderImpl.MetadataBuildingOptionsImpl(serviceRegistry);
BootstrapContext bootstrapContext = new BootstrapContextImpl(serviceRegistry, metadataBuildingOptions);
InFlightMetadataCollector inflightMetadataCollector = new InFlightMetadataCollectorImpl(bootstrapContext, metadataBuildingOptions);
return new MetadataBuildingContextRootImpl(bootstrapContext, metadataBuildingOptions, inflightMetadataCollector);
}
use of org.hibernate.boot.internal.BootstrapContextImpl in project jbosstools-hibernate by jbosstools.
the class ClassMetadataFacadeTest method setupFooBarPersister.
private ClassMetadata setupFooBarPersister() {
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
builder.applySetting(AvailableSettings.DIALECT, MockDialect.class.getName());
builder.applySetting(AvailableSettings.CONNECTION_PROVIDER, MockConnectionProvider.class.getName());
StandardServiceRegistry serviceRegistry = builder.build();
MetadataBuildingOptionsImpl metadataBuildingOptions = new MetadataBuildingOptionsImpl(serviceRegistry);
BootstrapContextImpl bootstrapContext = new BootstrapContextImpl(serviceRegistry, metadataBuildingOptions);
metadataBuildingOptions.setBootstrapContext(bootstrapContext);
InFlightMetadataCollector inFlightMetadataCollector = new InFlightMetadataCollectorImpl(bootstrapContext, metadataBuildingOptions);
MetadataBuildingContext metadataBuildingContext = new MetadataBuildingContextRootImpl(bootstrapContext, metadataBuildingOptions, inFlightMetadataCollector);
AbstractEntityPersister result = new TestEntityPersister(createPersistentClass(metadataBuildingContext), createPersisterCreationContext(serviceRegistry, bootstrapContext));
return result;
}
use of org.hibernate.boot.internal.BootstrapContextImpl in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsComponentType.
@Test
public void testIsComponentType() {
IType typeFacade = null;
// first try type that is not a component type
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
assertFalse(typeFacade.isComponentType());
// next try a component type
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
ssrb.applySetting(AvailableSettings.DIALECT, MockDialect.class.getName());
ssrb.applySetting(AvailableSettings.CONNECTION_PROVIDER, MockConnectionProvider.class.getName());
StandardServiceRegistry ssr = ssrb.build();
MetadataBuildingOptions mdbo = new MetadataBuilderImpl.MetadataBuildingOptionsImpl(ssr);
BootstrapContext btc = new BootstrapContextImpl(ssr, mdbo);
InFlightMetadataCollector ifmdc = new InFlightMetadataCollectorImpl(btc, mdbo);
MetadataBuildingContext mdbc = new MetadataBuildingContextRootImpl(btc, mdbo, ifmdc);
ComponentType componentType = new ComponentType(null, new ComponentMetamodel(new Component(mdbc, new RootClass(null)), btc));
typeFacade = FACADE_FACTORY.createType(componentType);
assertTrue(typeFacade.isComponentType());
}
use of org.hibernate.boot.internal.BootstrapContextImpl in project jbosstools-hibernate by jbosstools.
the class DummyMetadataBuildingContext method createInstance.
private static MetadataBuildingContext createInstance() {
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
ssrb.applySetting(AvailableSettings.DIALECT, MockDialect.class.getName());
ssrb.applySetting(AvailableSettings.CONNECTION_PROVIDER, MockConnectionProvider.class.getName());
StandardServiceRegistry serviceRegistry = ssrb.build();
MetadataBuildingOptions metadataBuildingOptions = new MetadataBuilderImpl.MetadataBuildingOptionsImpl(serviceRegistry);
BootstrapContext bootstrapContext = new BootstrapContextImpl(serviceRegistry, metadataBuildingOptions);
((MetadataBuilderImpl.MetadataBuildingOptionsImpl) metadataBuildingOptions).setBootstrapContext(bootstrapContext);
InFlightMetadataCollector inflightMetadataCollector = new InFlightMetadataCollectorImpl(bootstrapContext, metadataBuildingOptions);
return new MetadataBuildingContextRootImpl("JBoss Tools", bootstrapContext, metadataBuildingOptions, inflightMetadataCollector);
}
use of org.hibernate.boot.internal.BootstrapContextImpl in project jbosstools-hibernate by jbosstools.
the class ClassMetadataFacadeTest method setupFooBarPersister.
private ClassMetadata setupFooBarPersister() {
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
builder.applySetting(AvailableSettings.DIALECT, MockDialect.class.getName());
StandardServiceRegistry serviceRegistry = builder.build();
MetadataBuildingOptionsImpl metadataBuildingOptions = new MetadataBuildingOptionsImpl(serviceRegistry);
BootstrapContextImpl bootstrapContext = new BootstrapContextImpl(serviceRegistry, metadataBuildingOptions);
metadataBuildingOptions.setBootstrapContext(bootstrapContext);
InFlightMetadataCollector inFlightMetadataCollector = new InFlightMetadataCollectorImpl(bootstrapContext, metadataBuildingOptions);
MetadataBuildingContext metadataBuildingContext = new MetadataBuildingContextRootImpl(bootstrapContext, metadataBuildingOptions, inFlightMetadataCollector);
AbstractEntityPersister result = new TestEntityPersister(createPersistentClass(metadataBuildingContext), createPersisterCreationContext(serviceRegistry, bootstrapContext));
return result;
}
Aggregations