use of org.hibernate.boot.internal.MetadataBuilderImpl.MetadataBuildingOptionsImpl in project jbosstools-hibernate by jbosstools.
the class ClassMetadataFacadeTest method setupFooBarPersister.
private ClassMetadata setupFooBarPersister() {
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
ssrb.applySetting(AvailableSettings.DIALECT, TestDialect.class.getName());
StandardServiceRegistry serviceRegistry = ssrb.build();
MetadataBuildingOptionsImpl metadataBuildingOptions = new MetadataBuildingOptionsImpl(serviceRegistry);
InFlightMetadataCollector inFlightMetadataCollector = new InFlightMetadataCollectorImpl(metadataBuildingOptions, new TypeResolver());
ClassLoaderService classLoaderService = metadataBuildingOptions.getServiceRegistry().getService(ClassLoaderService.class);
ClassLoaderAccess classLoaderAccess = new ClassLoaderAccessImpl(metadataBuildingOptions.getTempClassLoader(), classLoaderService);
MetadataBuildingContext metadataBuildingContext = new MetadataBuildingContextRootImpl(metadataBuildingOptions, classLoaderAccess, inFlightMetadataCollector);
MetadataImplementor metadataImplementor = (MetadataImplementor) new MetadataSources(serviceRegistry).buildMetadata();
return new TestEntityPersister(createPersistentClass(metadataBuildingContext, metadataImplementor), new TestCreationContext(metadataImplementor));
}
use of org.hibernate.boot.internal.MetadataBuilderImpl.MetadataBuildingOptionsImpl 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("JBoss Tools", bootstrapContext, metadataBuildingOptions, inFlightMetadataCollector);
AbstractEntityPersister result = new TestEntityPersister(createPersistentClass(metadataBuildingContext), createPersisterCreationContext(serviceRegistry, bootstrapContext));
return result;
}
use of org.hibernate.boot.internal.MetadataBuilderImpl.MetadataBuildingOptionsImpl in project jbosstools-hibernate by jbosstools.
the class EntityMetamodelFacadeTest method createFooBarModel.
private EntityMetamodel createFooBarModel() {
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);
PersistentClass persistentClass = createPersistentClass(metadataBuildingContext);
MetadataSources metadataSources = new MetadataSources(serviceRegistry);
SessionFactoryImplementor sessionFactoryImplementor = (SessionFactoryImplementor) metadataSources.buildMetadata().buildSessionFactory();
return new EntityMetamodel(persistentClass, null, sessionFactoryImplementor) {
private static final long serialVersionUID = 1L;
@Override
public EntityTuplizer getTuplizer() {
return (EntityTuplizer) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { EntityTuplizer.class }, new TestInvocationHandler());
}
@Override
public Integer getPropertyIndexOrNull(String id) {
methodName = "getPropertyIndexOrNull";
arguments = new Object[] { id };
return INDEX;
}
};
}
use of org.hibernate.boot.internal.MetadataBuilderImpl.MetadataBuildingOptionsImpl in project jbosstools-hibernate by jbosstools.
the class EntityMetamodelFacadeTest method createFooBarModel.
private EntityMetamodel createFooBarModel() {
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
ssrb.applySetting(AvailableSettings.DIALECT, TestDialect.class.getName());
StandardServiceRegistry serviceRegistry = ssrb.build();
MetadataBuildingOptionsImpl metadataBuildingOptions = new MetadataBuildingOptionsImpl(serviceRegistry);
InFlightMetadataCollector inFlightMetadataCollector = new InFlightMetadataCollectorImpl(metadataBuildingOptions, new TypeResolver());
ClassLoaderService classLoaderService = metadataBuildingOptions.getServiceRegistry().getService(ClassLoaderService.class);
ClassLoaderAccess classLoaderAccess = new ClassLoaderAccessImpl(metadataBuildingOptions.getTempClassLoader(), classLoaderService);
MetadataBuildingContext metadataBuildingContext = new MetadataBuildingContextRootImpl(metadataBuildingOptions, classLoaderAccess, inFlightMetadataCollector);
MetadataSources metadataSources = new MetadataSources(serviceRegistry);
PersistentClass persistentClass = createPersistentClass(metadataBuildingContext, (MetadataImplementor) metadataSources.buildMetadata());
SessionFactoryImplementor sessionFactoryImplementor = (SessionFactoryImplementor) metadataSources.buildMetadata().buildSessionFactory();
return new EntityMetamodel(persistentClass, null, sessionFactoryImplementor) {
private static final long serialVersionUID = 1L;
@Override
public EntityTuplizer getTuplizer() {
return (EntityTuplizer) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { EntityTuplizer.class }, new TestInvocationHandler());
}
@Override
public Integer getPropertyIndexOrNull(String id) {
methodName = "getPropertyIndexOrNull";
arguments = new Object[] { id };
return INDEX;
}
};
}
use of org.hibernate.boot.internal.MetadataBuilderImpl.MetadataBuildingOptionsImpl 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;
}
Aggregations