diff --git a/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java b/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java index 9fd616c160..847bf9e318 100644 --- a/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java +++ b/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java @@ -780,6 +780,9 @@ public final class AnnotationBinder { SharedCacheMode mode = (SharedCacheMode) mappings.getConfigurationProperties().get( "javax.persistence.sharedCache.mode" ); + if ( mode == null ) { + mode = SharedCacheMode.UNSPECIFIED; + } switch ( mode ) { case ALL: { cacheAnn = buildCacheMock( clazzToProcess.getName(), mappings );