use of org.jboss.tools.hibernate.runtime.common.IFacade in project jbosstools-hibernate by jbosstools.
the class ConfigurationFacadeTest method testBuildSessionFactory.
@Test
public void testBuildSessionFactory() throws Throwable {
ISessionFactory sessionFactoryFacade = configurationFacade.buildSessionFactory();
Assert.assertNotNull(sessionFactoryFacade);
Object sessionFactory = ((IFacade) sessionFactoryFacade).getTarget();
Assert.assertNotNull(sessionFactory);
Assert.assertTrue(sessionFactory instanceof SessionFactory);
}
use of org.jboss.tools.hibernate.runtime.common.IFacade in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewSet.
@Test
public void testNewSet() {
IPersistentClass persistentClass = service.newRootClass();
IValue set = service.newSet(persistentClass);
Assert.assertNotNull(set);
Object target = ((IFacade) set).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof Set);
}
use of org.jboss.tools.hibernate.runtime.common.IFacade in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewHQLQueryPlan.
@Test
public void testNewHQLQueryPlan() throws Exception {
IConfiguration configuration = service.newDefaultConfiguration();
configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
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);
Assert.assertNotNull(queryPlan);
Object target = ((IFacade) queryPlan).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof HQLQueryPlan);
}
use of org.jboss.tools.hibernate.runtime.common.IFacade in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewSpecialRootClass.
@Test
public void testNewSpecialRootClass() {
IProperty property = service.newProperty();
IPersistentClass pc = service.newRootClass();
property.setPersistentClass(pc);
IPersistentClass specialRootClass = service.newSpecialRootClass(property);
Assert.assertNotNull(specialRootClass);
Object target = ((IFacade) specialRootClass).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof RootClass);
Assert.assertSame(property, specialRootClass.getProperty());
}
use of org.jboss.tools.hibernate.runtime.common.IFacade in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewAnnotationConfiguration.
@Test
public void testNewAnnotationConfiguration() {
IConfiguration configuration = service.newAnnotationConfiguration();
Assert.assertNotNull(configuration);
Object target = ((IFacade) configuration).getTarget();
Assert.assertNotNull(target);
Assert.assertTrue(target instanceof Configuration);
}
Aggregations