Package org.hibernate.cache.spi

Examples of org.hibernate.cache.spi.CollectionRegion


      final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName();
      final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() );
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
                LOG.trace("Building cache for collection data [" + model.getRole() + "]");
        CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl
            .decode( model ) );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
        entityAccessStrategies.put( cacheRegionName, accessStrategy );
        allCacheRegions.put( cacheRegionName, collectionRegion );
      }
      CollectionPersister persister = serviceRegistry.getService( PersisterFactory.class ).createCollectionPersister(
          cfg,
View Full Code Here


      final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() );
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
        // TODO: is model.locateAttribute().getName() the collection's role??? For now, assuming it is
                LOG.trace("Building cache for collection data [" + model.getAttribute().getName() + "]");
        CollectionRegion collectionRegion =
            settings.getRegionFactory()
                .buildCollectionRegion(
                    cacheRegionName, properties, CacheDataDescriptionImpl.decode( model )
                );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
        entityAccessStrategies.put( cacheRegionName, accessStrategy );
        allCacheRegions.put( cacheRegionName, collectionRegion );
      }
      CollectionPersister persister =
          serviceRegistry
View Full Code Here

      final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName();
      final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() );
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
                LOG.trace("Building cache for collection data [" + model.getRole() + "]");
        CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl
            .decode( model ) );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
        entityAccessStrategies.put( cacheRegionName, accessStrategy );
        allCacheRegions.put( cacheRegionName, collectionRegion );
      }
      CollectionPersister persister = serviceRegistry.getService( PersisterFactory.class ).createCollectionPersister(
          cfg,
View Full Code Here

      final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName();
      final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() );
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
        LOG.tracev( "Building shared cache region for collection data [{0}]", model.getRole() );
        CollectionRegion collectionRegion = regionFactory.buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl
            .decode( model ) );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
        entityAccessStrategies.put( cacheRegionName, accessStrategy );
        cacheAccess.addCacheRegion( cacheRegionName, collectionRegion );
      }
      CollectionPersister persister = persisterFactory.createCollectionPersister(
          cfg,
View Full Code Here

      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
        if ( traceEnabled ) {
          LOG.tracev( "Building cache for collection data [{0}]", model.getAttribute().getRole() );
        }
        CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion(
            cacheRegionName, properties, CacheDataDescriptionImpl.decode( model )
        );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
        entityAccessStrategies.put( cacheRegionName, accessStrategy );
        cacheAccess.addCacheRegioncacheRegionName, collectionRegion );
      }
      CollectionPersister persister = serviceRegistry
          .getService( PersisterFactory.class )
View Full Code Here

* @author Galder Zamarreño
*/
public class CollectionRegionImplTestCase extends AbstractEntityCollectionRegionTestCase {
   @Override
   protected void supportedAccessTypeTest(RegionFactory regionFactory, Properties properties) {
      CollectionRegion region = regionFactory.buildCollectionRegion("test", properties, null);
      assertNull("Got TRANSACTIONAL", region.buildAccessStrategy(AccessType.TRANSACTIONAL)
               .lockRegion());
      try {
         region.buildAccessStrategy(AccessType.NONSTRICT_READ_WRITE);
         fail("Incorrectly got NONSTRICT_READ_WRITE");
      } catch (CacheException good) {
      }

      try {
         region.buildAccessStrategy(AccessType.READ_WRITE);
         fail("Incorrectly got READ_WRITE");
      } catch (CacheException good) {
      }
   }
View Full Code Here

      final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName();
      final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() );
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
        LOG.tracev( "Building shared cache region for collection data [{0}]", model.getRole() );
        CollectionRegion collectionRegion = regionFactory.buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl
            .decode( model ) );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
        entityAccessStrategies.put( cacheRegionName, accessStrategy );
        cacheAccess.addCacheRegion( cacheRegionName, collectionRegion );
      }
      CollectionPersister persister = persisterFactory.createCollectionPersister(
          cfg,
View Full Code Here

      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
        if ( traceEnabled ) {
          LOG.tracev( "Building cache for collection data [{0}]", model.getAttribute().getRole() );
        }
        CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion(
            cacheRegionName, properties, CacheDataDescriptionImpl.decode( model )
        );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
        entityAccessStrategies.put( cacheRegionName, accessStrategy );
        cacheAccess.addCacheRegioncacheRegionName, collectionRegion );
      }
      CollectionPersister persister = serviceRegistry
          .getService( PersisterFactory.class )
View Full Code Here

      final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName();
      final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() );
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
                LOG.trace("Building cache for collection data [" + model.getRole() + "]");
        CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion( cacheRegionName, properties, CacheDataDescriptionImpl
            .decode( model ) );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
        entityAccessStrategies.put( cacheRegionName, accessStrategy );
        allCacheRegions.put( cacheRegionName, collectionRegion );
      }
      CollectionPersister persister = serviceRegistry.getService( PersisterFactory.class ).createCollectionPersister(
          cfg,
View Full Code Here

      final String cacheRegionName = cacheRegionPrefix + model.getCaching().getRegion();
      final AccessType accessType = model.getCaching().getAccessType();
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
                LOG.trace("Building cache for collection data [" + model.getAttribute().getRole() + "]");
        CollectionRegion collectionRegion = settings.getRegionFactory().buildCollectionRegion(
            cacheRegionName, properties, CacheDataDescriptionImpl.decode( model )
        );
        accessStrategy = collectionRegion.buildAccessStrategy( accessType );
        entityAccessStrategies.put( cacheRegionName, accessStrategy );
        allCacheRegions.put( cacheRegionName, collectionRegion );
      }
      CollectionPersister persister = serviceRegistry
          .getService( PersisterFactory.class )
View Full Code Here

TOP

Related Classes of org.hibernate.cache.spi.CollectionRegion

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.