collection.setCacheConcurrencyStrategy( caching.getAccessType().getExternalName() ); collection.setCacheConcurrencyStrategy( mappingDocument.getBuildingOptions().getImplicitCacheAccessType().getExternalName() );
collectionBinding.setCacheConcurrencyStrategy( getCacheConcurrencyStrategy() );
collectionBinding.setCacheConcurrencyStrategy( cacheRegionDefinition.getUsage() );
collection.setCacheConcurrencyStrategy( cacheConcurrencyStrategy ); collection.setCacheRegionName( cacheRegionName );
collection.setCacheConcurrencyStrategy( cacheConcurrencyStrategy ); collection.setCacheRegionName( cacheRegionName );
void setCollectionCacheConcurrencyStrategy(String collectionRole, String concurrencyStrategy, String region) throws MappingException { Collection collection = getCollectionMapping( collectionRole ); if (collection == null) throw new MappingException("Cannot cache an unknown collection: " + collectionRole); collection.setCacheConcurrencyStrategy( concurrencyStrategy ); collection.setCacheRegionName( region ); }
private void applyCollectionCacheConcurrencyStrategy(CacheHolder holder) { Collection collection = getCollectionMapping( holder.role ); if ( collection == null ) { throw new MappingException( "Cannot cache an unknown collection: " + holder.role ); } collection.setCacheConcurrencyStrategy( holder.usage ); collection.setCacheRegionName( holder.region ); }
private void applyCollectionCacheConcurrencyStrategy(CacheHolder holder) { Collection collection = getCollectionMapping( holder.role ); if ( collection == null ) { throw new MappingException( "Cannot cache an unknown collection: " + holder.role ); } collection.setCacheConcurrencyStrategy( holder.usage ); collection.setCacheRegionName( holder.region ); }
collection.setCacheConcurrencyStrategy( caching.getAccessType().getExternalName() ); collection.setCacheConcurrencyStrategy( mappingDocument.getBuildingOptions().getImplicitCacheAccessType().getExternalName() );
collection.setCacheConcurrencyStrategy( subnode.attributeValue( "usage" ) ); collection.setCacheRegionName( subnode.attributeValue( "region" ) );
collection.setCacheConcurrencyStrategy( subnode.attributeValue( "usage" ) ); collection.setCacheRegionName( subnode.attributeValue( "region" ) );
collection.setCacheConcurrencyStrategy( subnode.attributeValue( "usage" ) ); collection.setCacheRegionName( subnode.attributeValue( "region" ) );
private static Metadata buildMetadata(StandardServiceRegistry registry) { final String cacheStrategy = "transactional"; MetadataSources metadataSources = new MetadataSources( registry ); for ( Class entityClass : getAnnotatedClasses() ) { metadataSources.addAnnotatedClass( entityClass ); } Metadata metadata = metadataSources.buildMetadata(); for ( PersistentClass entityBinding : metadata.getEntityBindings() ) { if (!entityBinding.isInherited()) { ( (RootClass) entityBinding ).setCacheConcurrencyStrategy( cacheStrategy); } } for ( Collection collectionBinding : metadata.getCollectionBindings() ) { collectionBinding.setCacheConcurrencyStrategy( cacheStrategy ); } return metadata; }
private Metadata buildMetadata(StandardServiceRegistry registry) { MetadataSources metadataSources = new MetadataSources( registry ); for ( Class entityClass : getAnnotatedClasses() ) { metadataSources.addAnnotatedClass( entityClass ); } Metadata metadata = metadataSources.buildMetadata(); for ( PersistentClass entityBinding : metadata.getEntityBindings() ) { if (!entityBinding.isInherited()) { ( (RootClass) entityBinding ).setCacheConcurrencyStrategy( accessType.getExternalName() ); } } // Collections don't have integrated version, these piggyback on parent's owner version (for DB). // However, this version number isn't extractable and is not passed to cache methods. AccessType collectionAccessType = accessType == AccessType.NONSTRICT_READ_WRITE ? AccessType.READ_WRITE : accessType; for ( Collection collectionBinding : metadata.getCollectionBindings() ) { collectionBinding.setCacheConcurrencyStrategy( collectionAccessType.getExternalName() ); } return metadata; }
collectionBinding.setCacheConcurrencyStrategy( cacheRegionDefinition.getUsage() );
CacheConfig cacheConfig = propConfig.getCache(); if (cacheConfig != null) { collection.setCacheConcurrencyStrategy(cacheConfig.getUsage());
collectionBinding.setCacheConcurrencyStrategy( "transactional" );
CacheConfig cacheConfig = propConfig.getCache(); if (cacheConfig != null) { collection.setCacheConcurrencyStrategy(cacheConfig.getUsage());
collection.setCacheConcurrencyStrategy( cacheConcurrencyStrategy ); collection.setCacheRegionName( cacheRegionName );
collectionBinding.setCacheConcurrencyStrategy( "transactional" );