Search in sources :

Example 21 with IHQLQueryPlan

use of org.jboss.tools.hibernate.runtime.spi.IHQLQueryPlan in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewHQLQueryPlan.

@Test
public void testNewHQLQueryPlan() throws Exception {
    IConfiguration configuration = service.newDefaultConfiguration();
    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);
}
Also used : HQLQueryPlan(org.hibernate.engine.query.spi.HQLQueryPlan) IHQLQueryPlan(org.jboss.tools.hibernate.runtime.spi.IHQLQueryPlan) FileWriter(java.io.FileWriter) ISessionFactory(org.jboss.tools.hibernate.runtime.spi.ISessionFactory) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IHQLQueryPlan(org.jboss.tools.hibernate.runtime.spi.IHQLQueryPlan) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) File(java.io.File) Test(org.junit.Test)

Aggregations

IHQLQueryPlan (org.jboss.tools.hibernate.runtime.spi.IHQLQueryPlan)21 HQLQueryPlan (org.hibernate.engine.query.spi.HQLQueryPlan)16 Filter (org.hibernate.Filter)13 TableFilter (org.hibernate.cfg.reveng.TableFilter)13 ITableFilter (org.jboss.tools.hibernate.runtime.spi.ITableFilter)13 Test (org.junit.Test)12 SessionFactoryImpl (org.hibernate.internal.SessionFactoryImpl)10 Column (org.hibernate.mapping.Column)8 PrimaryKey (org.hibernate.mapping.PrimaryKey)8 RootClass (org.hibernate.mapping.RootClass)8 SimpleValue (org.hibernate.mapping.SimpleValue)8 Table (org.hibernate.mapping.Table)8 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)8 IColumn (org.jboss.tools.hibernate.runtime.spi.IColumn)8 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)8 IPrimaryKey (org.jboss.tools.hibernate.runtime.spi.IPrimaryKey)8 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)8 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)5 File (java.io.File)4 FileWriter (java.io.FileWriter)4