}
this.customPersister = entityPersisterClass;
}
private Caching determineCachingSettings() {
final AnnotationInstance hibernateCacheAnnotation = JandexHelper.getSingleAnnotation(
getClassInfo(), HibernateDotNames.CACHE
);
if ( hibernateCacheAnnotation != null ) {
final org.hibernate.cache.spi.access.AccessType accessType = hibernateCacheAnnotation.value( "usage" ) == null
? getLocalBindingContext().getMappingDefaults().getCacheAccessType()
: CacheConcurrencyStrategy.parse( hibernateCacheAnnotation.value( "usage" ).asEnum() )
.toAccessType();
return new Caching(
hibernateCacheAnnotation.value( "region" ) == null
? getName()
: hibernateCacheAnnotation.value( "region" ).asString(),
accessType,
hibernateCacheAnnotation.value( "include" ) != null
&& "all".equals( hibernateCacheAnnotation.value( "include" ).asString() )
);
}
final AnnotationInstance jpaCacheableAnnotation = JandexHelper.getSingleAnnotation(
getClassInfo(), JPADotNames.CACHEABLE
);
boolean cacheable = true; // true is the default
if ( jpaCacheableAnnotation != null && jpaCacheableAnnotation.value() != null ) {
cacheable = jpaCacheableAnnotation.value().asBoolean();
}
final boolean doCaching;
switch ( getLocalBindingContext().getMetadataImplementor().getOptions().getSharedCacheMode() ) {
case ALL: {