Package org.hibernate.cache.spi.access

Examples of org.hibernate.cache.spi.access.AccessType


          model.getHierarchyDetails().getCaching() != null &&
          model.getHierarchyDetails().getCaching().getAccessType() != null ) {
        final String cacheRegionName = cacheRegionPrefix + rootEntityBinding.getHierarchyDetails().getCaching().getRegion();
        accessStrategy = EntityRegionAccessStrategy.class.cast( entityAccessStrategies.get( cacheRegionName ) );
        if ( accessStrategy == null ) {
          final AccessType accessType = model.getHierarchyDetails().getCaching().getAccessType();
          if ( LOG.isTraceEnabled() ) {
            LOG.tracev( "Building cache for entity data [{0}]", model.getEntity().getName() );
          }
          EntityRegion entityRegion = settings.getRegionFactory().buildEntityRegion(
              cacheRegionName, properties, CacheDataDescriptionImpl.decode( model )
          );
          accessStrategy = entityRegion.buildAccessStrategy( accessType );
          entityAccessStrategies.put( cacheRegionName, accessStrategy );
          allCacheRegions.put( cacheRegionName, entityRegion );
        }
      }
      EntityPersister cp = serviceRegistry.getService( PersisterFactory.class ).createEntityPersister(
          model, accessStrategy, this, metadata
      );
      entityPersisters.put( model.getEntity().getName(), cp );
      classMeta.put( model.getEntity().getName(), cp.getClassMetadata() );
    }
    this.classMetadata = Collections.unmodifiableMap(classMeta);

    Map<String,Set<String>> tmpEntityToCollectionRoleMap = new HashMap<String,Set<String>>();
    collectionPersisters = new HashMap();
    for ( PluralAttributeBinding model : metadata.getCollectionBindings() ) {
      if ( model.getAttribute() == null ) {
        throw new IllegalStateException( "No attribute defined for a AbstractPluralAttributeBinding: " +  model );
      }
      if ( model.getAttribute().isSingular() ) {
        throw new IllegalStateException(
            "AbstractPluralAttributeBinding has a Singular attribute defined: " + model.getAttribute().getName()
        );
      }
      final String cacheRegionName = cacheRegionPrefix + model.getCaching().getRegion();
      final AccessType accessType = model.getCaching().getAccessType();
      CollectionRegionAccessStrategy accessStrategy = null;
      if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
        if ( LOG.isTraceEnabled() ) {
          LOG.tracev( "Building cache for collection data [{0}]", model.getAttribute().getRole() );
        }
View Full Code Here

TOP

Related Classes of org.hibernate.cache.spi.access.AccessType

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.