本文整理了Java中org.hibernate.SessionFactory.getReference()
方法的一些代码示例,展示了SessionFactory.getReference()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SessionFactory.getReference()
方法的具体详情如下:
包路径:org.hibernate.SessionFactory
类名称:SessionFactory
方法名:getReference
暂无
代码示例来源:origin: org.codehaus.griffon.plugins/griffon-hibernate4-core
@Override
public Reference getReference() throws NamingException {
return delegate.getReference();
}
}
代码示例来源:origin: picocontainer/picocontainer
/** {@inheritDoc} **/
public Reference getReference() throws NamingException {
return delegate.getReference();
}
代码示例来源:origin: picocontainer/picocontainer
/** {@inheritDoc} **/
public Reference getReference() throws NamingException {
return delegate.getReference();
}
代码示例来源:origin: org.codehaus.griffon.plugins/griffon-hibernate5-core
@Override
public Reference getReference() throws NamingException {
return delegate.getReference();
}
代码示例来源:origin: com.carbonfive/db-support
public Reference getReference() throws NamingException
{
return getSessionFactory().getReference();
}
代码示例来源:origin: org.jboss.ejb3/jboss-ejb3-jpa-int
public Reference getReference() throws NamingException
{
return getSessionFactory().getReference();
}
代码示例来源:origin: org.grails/grails-hibernate
public Reference getReference() throws NamingException {
return getCurrentSessionFactory().getReference();
}
代码示例来源:origin: hibernate/hibernate-ogm
@Test
public void testJNDIReference() throws Exception {
final EntityManagerFactory emf = Persistence.createEntityManagerFactory( "ogm", TestHelper.getDefaultTestSettings() );
SessionFactory factory = (SessionFactory) emf;
Reference reference = factory.getReference();
assertThat( reference.getClassName() ).isEqualTo( OgmSessionFactoryImpl.class.getName() );
assertThat( reference.getFactoryClassName() ).isEqualTo( ObjectFactoryImpl.class.getName() );
assertThat( reference.get( 0 ) ).isNotNull();
assertThat( reference.getFactoryClassLocation() ).isNull();
ObjectFactory objFactory = new ObjectFactoryImpl();
SessionFactory factoryFromRegistry = (SessionFactory) objFactory.getObjectInstance( reference, null, null, null );
assertThat( factoryFromRegistry.getClass() ).isEqualTo( OgmSessionFactoryImpl.class );
assertThat( factoryFromRegistry.getReference() ).isEqualTo( factory.getReference() );
emf.close();
}
代码示例来源:origin: hibernate/hibernate-ogm
@Test
public void testGetReferenceImplementation() throws Exception {
final Session session = openSession();
SessionFactory factory = session.getSessionFactory();
assertThat( factory.getClass() ).isEqualTo( OgmSessionFactoryImpl.class );
Reference reference = factory.getReference();
assertThat( reference.getClassName() ).isEqualTo( OgmSessionFactoryImpl.class.getName() );
assertThat( reference.getFactoryClassName() ).isEqualTo( ObjectFactoryImpl.class.getName() );
assertThat( reference.get( 0 ) ).isNotNull();
assertThat( reference.getFactoryClassLocation() ).isNull();
ObjectFactory objFactory = new ObjectFactoryImpl();
SessionFactory factoryFromRegistry = (SessionFactory) objFactory.getObjectInstance( reference, null, null, null );
assertThat( factoryFromRegistry.getClass() ).isEqualTo( OgmSessionFactoryImpl.class );
assertThat( factoryFromRegistry.getReference() ).isEqualTo( factory.getReference() );
session.close();
}
内容来源于网络,如有侵权,请联系作者删除!