use of org.jboss.tools.hibernate.runtime.spi.IEntityMetamodel in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateEntityMetamodel.
@Test
public void testCreateEntityMetamodel() {
Configuration configuration = new Configuration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
builder.applySettings(configuration.getProperties());
ServiceRegistry serviceRegistry = builder.build();
SessionFactoryImplementor sfi = (SessionFactoryImplementor) configuration.buildSessionFactory(serviceRegistry);
RootClass rc = new RootClass(null);
MetadataImplementor m = (MetadataImplementor) MetadataHelper.getMetadata(configuration);
SimpleValue sv = new SimpleValue(m);
sv.setNullValue("null");
sv.setTypeName(Integer.class.getName());
rc.setIdentifier(sv);
EntityMetamodel entityMetamodel = new EntityMetamodel(rc, null, sfi);
IEntityMetamodel facade = facadeFactory.createEntityMetamodel(entityMetamodel);
Assert.assertSame(entityMetamodel, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IEntityMetamodel in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateEntityMetamodel.
@Test
public void testCreateEntityMetamodel() {
Configuration configuration = new Configuration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder();
builder.applySettings(configuration.getProperties());
ServiceRegistry serviceRegistry = builder.build();
SessionFactoryImplementor sfi = (SessionFactoryImplementor) configuration.buildSessionFactory(serviceRegistry);
RootClass rc = new RootClass();
Mappings m = configuration.createMappings();
SimpleValue sv = new SimpleValue(m);
sv.setNullValue("null");
sv.setTypeName(Integer.class.getName());
rc.setIdentifier(sv);
EntityMetamodel entityMetamodel = new EntityMetamodel(rc, null, sfi);
IEntityMetamodel facade = facadeFactory.createEntityMetamodel(entityMetamodel);
Assert.assertSame(entityMetamodel, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IEntityMetamodel in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateEntityMetamodel.
@Test
public void testCreateEntityMetamodel() {
Configuration configuration = new Configuration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
ServiceRegistryBuilder builder = new ServiceRegistryBuilder();
builder.applySettings(configuration.getProperties());
ServiceRegistry serviceRegistry = builder.buildServiceRegistry();
SessionFactoryImplementor sfi = (SessionFactoryImplementor) configuration.buildSessionFactory(serviceRegistry);
RootClass rc = new RootClass();
Mappings m = configuration.createMappings();
SimpleValue sv = new SimpleValue(m);
sv.setNullValue("null");
sv.setTypeName(Integer.class.getName());
rc.setIdentifier(sv);
EntityMetamodel entityMetamodel = new EntityMetamodel(rc, sfi);
IEntityMetamodel facade = facadeFactory.createEntityMetamodel(entityMetamodel);
Assert.assertSame(entityMetamodel, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IEntityMetamodel in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateEntityMetamodel.
@Test
public void testCreateEntityMetamodel() {
Configuration configuration = new Configuration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
SessionFactoryImplementor sfi = new SessionFactoryImpl(configuration, null, configuration.buildSettings(), null, null);
RootClass rc = new RootClass();
SimpleValue sv = new SimpleValue();
sv.setNullValue("null");
sv.setTypeName(Integer.class.getName());
rc.setIdentifier(sv);
EntityMetamodel entityMetamodel = new EntityMetamodel(rc, sfi);
IEntityMetamodel facade = facadeFactory.createEntityMetamodel(entityMetamodel);
Assert.assertSame(entityMetamodel, ((IFacade) facade).getTarget());
}
use of org.jboss.tools.hibernate.runtime.spi.IEntityMetamodel in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreateEntityMetamodel.
@Test
public void testCreateEntityMetamodel() {
Configuration configuration = new Configuration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
SessionFactoryImplementor sfi = new SessionFactoryImpl(configuration, null, configuration.buildSettings(), null, null);
RootClass rc = new RootClass();
Mappings m = configuration.createMappings();
SimpleValue sv = new SimpleValue(m);
sv.setNullValue("null");
sv.setTypeName(Integer.class.getName());
rc.setIdentifier(sv);
EntityMetamodel entityMetamodel = new EntityMetamodel(rc, sfi);
IEntityMetamodel facade = facadeFactory.createEntityMetamodel(entityMetamodel);
Assert.assertSame(entityMetamodel, ((IFacade) facade).getTarget());
}
Aggregations