Search in sources :

Example 26 with ISession

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

the class FacadeFactoryTest method testCreateSession.

@Test
public void testCreateSession() {
    Session session = (Session) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { Session.class }, new TestInvocationHandler());
    ISession facade = facadeFactory.createSession(session);
    Assert.assertSame(session, ((IFacade) facade).getTarget());
}
Also used : ISession(org.jboss.tools.hibernate.runtime.spi.ISession) PersistentClass(org.hibernate.mapping.PersistentClass) IPOJOClass(org.jboss.tools.hibernate.runtime.spi.IPOJOClass) RootClass(org.hibernate.mapping.RootClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) POJOClass(org.hibernate.tool.hbm2x.pojo.POJOClass) ISession(org.jboss.tools.hibernate.runtime.spi.ISession) Session(org.hibernate.Session) Test(org.junit.Test)

Example 27 with ISession

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

the class FacadeFactoryTest method testCreateSession.

@Test
public void testCreateSession() {
    Session session = (Session) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { Session.class }, new TestInvocationHandler());
    ISession facade = facadeFactory.createSession(session);
    Assert.assertSame(session, ((IFacade) facade).getTarget());
}
Also used : ISession(org.jboss.tools.hibernate.runtime.spi.ISession) PersistentClass(org.hibernate.mapping.PersistentClass) IPOJOClass(org.jboss.tools.hibernate.runtime.spi.IPOJOClass) RootClass(org.hibernate.mapping.RootClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) POJOClass(org.hibernate.tool.hbm2x.pojo.POJOClass) ISession(org.jboss.tools.hibernate.runtime.spi.ISession) Session(org.hibernate.Session) Test(org.junit.Test)

Aggregations

ISession (org.jboss.tools.hibernate.runtime.spi.ISession)27 Test (org.junit.Test)24 Session (org.hibernate.Session)16 PersistentClass (org.hibernate.mapping.PersistentClass)16 RootClass (org.hibernate.mapping.RootClass)16 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)9 InvocationHandler (java.lang.reflect.InvocationHandler)8 Method (java.lang.reflect.Method)8 SessionFactory (org.hibernate.SessionFactory)8 Configuration (org.hibernate.cfg.Configuration)8 POJOClass (org.hibernate.tool.hbm2x.pojo.POJOClass)8 IPOJOClass (org.jboss.tools.hibernate.runtime.spi.IPOJOClass)8 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)8 ISessionFactory (org.jboss.tools.hibernate.runtime.spi.ISessionFactory)8 SessionImplementor (org.hibernate.engine.spi.SessionImplementor)6 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)5 QueryPage (org.hibernate.console.QueryPage)2 Command (org.hibernate.console.execution.ExecutionContext.Command)2 SessionImplementor (org.hibernate.engine.SessionImplementor)2 ServiceRegistry (org.hibernate.service.ServiceRegistry)1