org.hibernate.cfg.Settings.getRegionFactory()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(107)

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

Settings.getRegionFactory介绍

暂无

代码示例

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

public StandardQueryCache(
    final Settings settings,
    final Properties props,
    final UpdateTimestampsCache updateTimestampsCache,
    String regionName) throws HibernateException {
  if ( regionName == null ) {
    regionName = StandardQueryCache.class.getName();
  }
  String prefix = settings.getCacheRegionPrefix();
  if ( prefix != null ) {
    regionName = prefix + '.' + regionName;
  }
  LOG.startingQueryCache( regionName );
  this.cacheRegion = settings.getRegionFactory().buildQueryResultsRegion( regionName, props );
  this.updateTimestampsCache = updateTimestampsCache;
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

public StandardQueryCache(
    final Settings settings,
    final Properties props,
    final UpdateTimestampsCache updateTimestampsCache,
    String regionName) throws HibernateException {
  if ( regionName == null ) {
    regionName = StandardQueryCache.class.getName();
  }
  String prefix = settings.getCacheRegionPrefix();
  if ( prefix != null ) {
    regionName = prefix + '.' + regionName;
  }
  LOG.startingQueryCache( regionName );
  this.cacheRegion = settings.getRegionFactory().buildQueryResultsRegion( regionName, props );
  this.updateTimestampsCache = updateTimestampsCache;
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

public UpdateTimestampsCache(Settings settings, Properties props, final SessionFactoryImplementor factory) throws HibernateException {
  this.factory = factory;
  String prefix = settings.getCacheRegionPrefix();
  String regionName = prefix == null ? REGION_NAME : prefix + '.' + REGION_NAME;
  LOG.startingUpdateTimestampsCache( regionName );
  this.region = settings.getRegionFactory().buildTimestampsRegion( regionName, props );
}
@SuppressWarnings({"UnusedDeclaration"})

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

public UpdateTimestampsCache(Settings settings, Properties props, final SessionFactoryImplementor factory) throws HibernateException {
  this.factory = factory;
  String prefix = settings.getCacheRegionPrefix();
  String regionName = prefix == null ? REGION_NAME : prefix + '.' + REGION_NAME;
  LOG.startingUpdateTimestampsCache( regionName );
  this.region = settings.getRegionFactory().buildTimestampsRegion( regionName, props );
}
@SuppressWarnings({"UnusedDeclaration"})

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

@Override
public Session openSession() {
  return new SessionImpl(
      connection,
      sessionFactory,
      getTransactionCoordinator(),
      autoJoinTransactions,
      sessionFactory.settings.getRegionFactory().nextTimestamp(),
      interceptor,
      flushBeforeCompletion,
      autoClose,
      connectionReleaseMode,
      tenantIdentifier
  );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

@Override
public Session openSession() {
  return new SessionImpl(
      connection,
      sessionFactory,
      getTransactionCoordinator(),
      autoJoinTransactions,
      sessionFactory.settings.getRegionFactory().nextTimestamp(),
      interceptor,
      flushBeforeCompletion,
      autoClose,
      connectionReleaseMode,
      tenantIdentifier
  );
}

代码示例来源:origin: com.hazelcast/hazelcast-hibernate4

/**
   * Tries to extract <code>HazelcastInstance</code> from <code>SessionFactoryImplementor</code>.
   *
   * @param sessionFactory Hibernate <code>SessionFactory</code> to extract settings from
   * @return currently used <code>HazelcastInstance</code> or null if an error occurs.
   */
  public static HazelcastInstance getHazelcastInstance(final SessionFactoryImplementor sessionFactory) {
    final Settings settings = sessionFactory.getSettings();
    final RegionFactory rf = settings.getRegionFactory();
    if (rf instanceof AbstractHazelcastCacheRegionFactory) {
      return ((AbstractHazelcastCacheRegionFactory) rf).getHazelcastInstance();
    } else {
      LOGGER.warning("Current 2nd level cache implementation is not HazelcastCacheRegionFactory!");
    }
    return null;
  }
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

settings.getRegionFactory().stop();

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

settings.getRegionFactory().stop();

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

settings.getRegionFactory().start( settings, properties );
this.queryPlanCache = new QueryPlanCache( this );
        LOG.tracev( "Building cache for entity data [{0}]", model.getEntityName() );
      EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
      accessStrategy = entityRegion.buildAccessStrategy( accessType );
      entityAccessStrategies.put( cacheRegionName, accessStrategy );
      final NaturalIdRegion naturalIdRegion = settings.getRegionFactory().buildNaturalIdRegion( naturalIdCacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
      naturalIdAccessStrategy = naturalIdRegion.buildAccessStrategy( settings.getRegionFactory().getDefaultAccessType() );
      entityAccessStrategies.put( naturalIdCacheRegionName, naturalIdAccessStrategy );
      allCacheRegions.put( naturalIdCacheRegionName, naturalIdRegion );
      LOG.tracev("Building cache for collection data [{0}]", model.getRole() );
    CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl
        .decode( model ) );
    accessStrategy = collectionRegion.buildAccessStrategy( accessType );

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

settings.getRegionFactory().start( settings, properties );
this.queryPlanCache = new QueryPlanCache( this );
        LOG.tracev( "Building cache for entity data [{0}]", model.getEntityName() );
      EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion( cacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
      accessStrategy = entityRegion.buildAccessStrategy( accessType );
      entityAccessStrategies.put( cacheRegionName, accessStrategy );
      final NaturalIdRegion naturalIdRegion = settings.getRegionFactory().buildNaturalIdRegion( naturalIdCacheRegionName, properties, CacheDataDescriptionImpl.decode( model ) );
      naturalIdAccessStrategy = naturalIdRegion.buildAccessStrategy( settings.getRegionFactory().getDefaultAccessType() );
      entityAccessStrategies.put( naturalIdCacheRegionName, naturalIdAccessStrategy );
      allCacheRegions.put( naturalIdCacheRegionName, naturalIdRegion );
      LOG.tracev("Building cache for collection data [{0}]", model.getRole() );
    CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl
        .decode( model ) );
    accessStrategy = collectionRegion.buildAccessStrategy( accessType );

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

settings.getRegionFactory().start( settings, properties );
this.queryPlanCache = new QueryPlanCache( this );
        LOG.tracev( "Building cache for entity data [{0}]", model.getEntity().getName() );
      EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion(
          cacheRegionName, properties, CacheDataDescriptionImpl.decode( model )
      );
      LOG.tracev( "Building cache for collection data [{0}]", model.getAttribute().getRole() );
    CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion(
        cacheRegionName, properties, CacheDataDescriptionImpl.decode( model )
    );

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

settings.getRegionFactory().start( settings, properties );
this.queryPlanCache = new QueryPlanCache( this );
        LOG.tracev( "Building cache for entity data [{0}]", model.getEntity().getName() );
      EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion(
          cacheRegionName, properties, CacheDataDescriptionImpl.decode( model )
      );
      LOG.tracev( "Building cache for collection data [{0}]", model.getAttribute().getRole() );
    CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion(
        cacheRegionName, properties, CacheDataDescriptionImpl.decode( model )
    );

代码示例来源:origin: org.infinispan/infinispan-hibernate-cache-commons

@Override
protected void startUp() {
 super.startUp();
 TestRegionFactory regionFactory = TestRegionFactoryProvider.load().wrap(sessionFactory().getSettings().getRegionFactory());
 TIMEOUT = regionFactory.getPendingPutsCacheConfiguration().expiration().maxIdle();
 region = TEST_SESSION_ACCESS.getRegion(sessionFactory(), Item.class.getName());
 entityCache = region.getCache();
}

代码示例来源:origin: org.infinispan/infinispan-hibernate-cache-commons

@Test
public void testRedeployment() throws Exception {
  addEntityCheckCache( sessionFactory() );
  bindToJndi = false;
  rebuildSessionFactory();
  addEntityCheckCache( sessionFactory() );
  TestRegionFactory regionFactory = TestRegionFactoryProvider.load().wrap(sessionFactory().getSettings().getRegionFactory());
  Cache cache = regionFactory.getCacheManager().getCache( Item.class.getName() );
  assertEquals( ComponentStatus.RUNNING, cache.getStatus() );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

Environment.USE_MINIMAL_PUTS, properties, settings.getRegionFactory().isMinimalPutsEnabledByDefault()
);
if ( debugEnabled ) {

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

Environment.USE_MINIMAL_PUTS, properties, settings.getRegionFactory().isMinimalPutsEnabledByDefault()
);
if ( debugEnabled ) {

相关文章

Settings类方法