HHH-18041 With SharedCacheMode.DISABLE_SELECTIVE entities with cacheable false should not be cached
This commit is contained in:
parent
b894a8d228
commit
7b10051a75
|
@ -586,26 +586,28 @@ public class ManagedTypeProcessor {
|
||||||
JaxbEntityImpl jaxbEntity,
|
JaxbEntityImpl jaxbEntity,
|
||||||
MutableClassDetails classDetails,
|
MutableClassDetails classDetails,
|
||||||
XmlDocumentContext xmlDocumentContext) {
|
XmlDocumentContext xmlDocumentContext) {
|
||||||
if ( jaxbEntity.isCacheable() == Boolean.TRUE ) {
|
if ( jaxbEntity.isCacheable() != null ) {
|
||||||
final MutableAnnotationUsage<Cacheable> cacheableUsage = classDetails.applyAnnotationUsage(
|
final MutableAnnotationUsage<Cacheable> cacheableUsage = classDetails.applyAnnotationUsage(
|
||||||
JpaAnnotations.CACHEABLE,
|
JpaAnnotations.CACHEABLE,
|
||||||
xmlDocumentContext.getModelBuildingContext()
|
xmlDocumentContext.getModelBuildingContext()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
cacheableUsage.setAttributeValue( "value", jaxbEntity.isCacheable() );
|
||||||
classDetails.addAnnotationUsage( cacheableUsage );
|
classDetails.addAnnotationUsage( cacheableUsage );
|
||||||
}
|
}
|
||||||
|
|
||||||
final JaxbCachingImpl jaxbCaching = jaxbEntity.getCaching();
|
final JaxbCachingImpl jaxbCaching = jaxbEntity.getCaching();
|
||||||
if ( jaxbCaching != null ) {
|
if ( jaxbCaching != null ) {
|
||||||
final MutableAnnotationUsage<Cache> cacheableUsage = classDetails.applyAnnotationUsage(
|
final MutableAnnotationUsage<Cache> cacheUsage = classDetails.applyAnnotationUsage(
|
||||||
HibernateAnnotations.CACHE,
|
HibernateAnnotations.CACHE,
|
||||||
xmlDocumentContext.getModelBuildingContext()
|
xmlDocumentContext.getModelBuildingContext()
|
||||||
);
|
);
|
||||||
classDetails.addAnnotationUsage( cacheableUsage );
|
classDetails.addAnnotationUsage( cacheUsage );
|
||||||
XmlProcessingHelper.applyAttributeIfSpecified( "region", jaxbCaching.getRegion(), cacheableUsage );
|
XmlProcessingHelper.applyAttributeIfSpecified( "region", jaxbCaching.getRegion(), cacheUsage );
|
||||||
XmlProcessingHelper.applyAttributeIfSpecified(
|
XmlProcessingHelper.applyAttributeIfSpecified(
|
||||||
"usage",
|
"usage",
|
||||||
convertCacheAccessType( jaxbCaching.getAccess() ),
|
convertCacheAccessType( jaxbCaching.getAccess() ),
|
||||||
cacheableUsage
|
cacheUsage
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue