use of org.jboss.tools.hibernate.runtime.spi.ISessionFactory in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewHQLQueryPlan.
@Test
public void testNewHQLQueryPlan() throws Exception {
IConfiguration configuration = service.newDefaultConfiguration();
configuration.setProperty(AvailableSettings.DIALECT, TestDialect.class.getName());
File testFile = File.createTempFile("test", "tmp");
testFile.deleteOnExit();
FileWriter fileWriter = new FileWriter(testFile);
fileWriter.write(TEST_HBM_STRING);
fileWriter.close();
configuration.addFile(testFile);
ISessionFactory sfi = configuration.buildSessionFactory();
IHQLQueryPlan queryPlan = service.newHQLQueryPlan("from ServiceImplTest$Foo", true, sfi);
assertNotNull(queryPlan);
Object target = ((IFacade) queryPlan).getTarget();
assertNotNull(target);
assertTrue(target instanceof HQLQueryPlan);
}
use of org.jboss.tools.hibernate.runtime.spi.ISessionFactory in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeTest method testBuildSessionFactory.
@Test
public void testBuildSessionFactory() throws Throwable {
ISessionFactory sessionFactoryFacade = configurationFacade.buildSessionFactory();
assertNotNull(sessionFactoryFacade);
Object sessionFactory = ((IFacade) sessionFactoryFacade).getTarget();
assertNotNull(sessionFactory);
assertTrue(sessionFactory instanceof SessionFactory);
}
use of org.jboss.tools.hibernate.runtime.spi.ISessionFactory in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeTest method testBuildSessionFactory.
@Test
public void testBuildSessionFactory() throws Throwable {
ISessionFactory sessionFactoryFacade = configurationFacade.buildSessionFactory();
assertNotNull(sessionFactoryFacade);
Object sessionFactory = ((IFacade) sessionFactoryFacade).getTarget();
assertNotNull(sessionFactory);
assertTrue(sessionFactory instanceof SessionFactory);
}
use of org.jboss.tools.hibernate.runtime.spi.ISessionFactory in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeTest method testBuildSessionFactory.
@Test
public void testBuildSessionFactory() throws Throwable {
ISessionFactory sessionFactoryFacade = configurationFacade.buildSessionFactory();
assertNotNull(sessionFactoryFacade);
Object sessionFactory = ((IFacade) sessionFactoryFacade).getTarget();
assertNotNull(sessionFactory);
assertTrue(sessionFactory instanceof SessionFactory);
}
Aggregations