final AccessType accessType = AccessType.fromExternalName( collection.getCacheConcurrencyStrategy() ); if ( accessType != null ) { regionConfigBuilders.computeIfAbsent( collection.getCacheRegionName(), DomainDataRegionConfigImpl.Builder::new )
|| collection.getCacheConcurrencyStrategy() == null ) { continue;
@Override @SuppressWarnings("unchecked") public void registerCollectionDescriptor( PersistentCollectionDescriptor runtimeDescriptor, Collection bootDescriptor) { collectionRuntimeByBoot.put( bootDescriptor, runtimeDescriptor ); inFlightRuntimeModel.addCollectionDescriptor( runtimeDescriptor ); final AccessType accessType = AccessType.fromExternalName( bootDescriptor.getCacheConcurrencyStrategy() ); if ( accessType != null ) { addCollectionCachingConfig( runtimeDescriptor, bootDescriptor, accessType ); } }
Collection model = (Collection) collections.next(); CacheConcurrencyStrategy cache = CacheFactory.createCache( model.getCacheConcurrencyStrategy(), model.getCacheRegionName(), true,
Collection model = (Collection) collections.next(); CacheConcurrencyStrategy cache = CacheFactory.createCache( model.getCacheConcurrencyStrategy(), model.getCacheRegionName(), model.isMutable(),
Collection model = (Collection) collections.next(); final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName(); final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() ); CollectionRegionAccessStrategy accessStrategy = null; if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
Collection model = (Collection) collections.next(); final String cacheRegionName = cacheRegionPrefix + model.getCacheRegionName(); final AccessType accessType = AccessType.fromExternalName( model.getCacheConcurrencyStrategy() ); CollectionRegionAccessStrategy accessStrategy = null; if ( accessType != null && settings.isSecondLevelCacheEnabled() ) {
@Override protected void visitProperty(PersistentClass clazz, Property property, IssueCollector collector) { Value value = property.getValue(); if(value instanceof Collection) { Collection col = (Collection) value; if(col.getCacheConcurrencyStrategy()!=null) { // caching is enabled if (!col.getElement().isSimpleValue()) { String entityName = (String) col.getElement().accept( new EntityNameFromValueVisitor() ); if(entityName!=null) { PersistentClass classMapping = getMetadata().getEntityBinding(entityName); if(classMapping.getCacheConcurrencyStrategy()==null) { collector.reportIssue( new Issue("CACHE_COLLECTION_NONCACHABLE_TARGET", Issue.HIGH_PRIORITY, "Entity '" + classMapping.getEntityName() +"' is referenced from the cache-enabled collection '" + col.getRole() + "' without the entity being cachable")); } } } } } } }
@Override protected void visitProperty(PersistentClass clazz, Property property, IssueCollector collector) { Value value = property.getValue(); if(value instanceof Collection) { Collection col = (Collection) value; if(col.getCacheConcurrencyStrategy()!=null) { // caching is enabled if (!col.getElement().isSimpleValue()) { String entityName = (String) col.getElement().accept( new EntityNameFromValueVisitor() ); if(entityName!=null) { PersistentClass classMapping = getMetadata().getEntityBinding(entityName); if(classMapping.getCacheConcurrencyStrategy()==null) { collector.reportIssue( new Issue("CACHE_COLLECTION_NONCACHABLE_TARGET", Issue.HIGH_PRIORITY, "Entity '" + classMapping.getEntityName() +"' is referenced from the cache-enabled collection '" + col.getRole() + "' without the entity being cachable")); } } } } } } }