org.hibernate.SessionFactory.getReference()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(110)

本文整理了Java中org.hibernate.SessionFactory.getReference()方法的一些代码示例,展示了SessionFactory.getReference()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SessionFactory.getReference()方法的具体详情如下:
包路径:org.hibernate.SessionFactory
类名称:SessionFactory
方法名:getReference

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();
}

相关文章