classDescriptor.getCachePolicy().setDatabaseChangeNotificationType(DatabaseChangeNotificationType.NONE); } else if (m_databaseChangeNotificationType.equals(DatabaseChangeNotificationType.INVALIDATE.name())) { classDescriptor.getCachePolicy().setDatabaseChangeNotificationType(DatabaseChangeNotificationType.INVALIDATE);
/** * INTERNAL: * Allow the inheritance properties of the descriptor to be initialized. * The descriptor's parent must first be initialized. */ public void initializeFromParent(CachePolicy parentPolicy, ClassDescriptor descriptor, ClassDescriptor descriptorDescriptor, AbstractSession session) throws DescriptorException { // If the parent is isolated, then the child must also be isolated. if (!parentPolicy.isSharedIsolation()) { // Do not override cache isolation when explicitly enabled by @Cacheable(true) annotation in current class. boolean copyParrent = cacheable == null || cacheable == false; if (!isIsolated() && (getCacheIsolation() != parentPolicy.getCacheIsolation()) && copyParrent) { session.log(SessionLog.WARNING, SessionLog.METADATA, "overriding_cache_isolation", new Object[]{descriptorDescriptor.getAlias(), parentPolicy.getCacheIsolation(), descriptor.getAlias(), getCacheIsolation()}); setCacheIsolation(parentPolicy.getCacheIsolation()); } } // Child must maintain the same indexes as the parent. for (CacheIndex index : parentPolicy.getCacheIndexes().values()) { addCacheIndex(index); } if ((getDatabaseChangeNotificationType() == null) && (parentPolicy.getDatabaseChangeNotificationType() != null)) { setDatabaseChangeNotificationType(parentPolicy.getDatabaseChangeNotificationType()); } if ((getCacheSynchronizationType() == UNDEFINED_OBJECT_CHANGE_BEHAVIOR) && (parentPolicy.getCacheSynchronizationType() != UNDEFINED_OBJECT_CHANGE_BEHAVIOR)) { setCacheSynchronizationType(parentPolicy.getCacheSynchronizationType()); } }
/** * INTERNAL: * Allow the inheritance properties of the descriptor to be initialized. * The descriptor's parent must first be initialized. */ public void initializeFromParent(CachePolicy parentPolicy, ClassDescriptor descriptor, ClassDescriptor descriptorDescriptor, AbstractSession session) throws DescriptorException { // If the parent is isolated, then the child must also be isolated. if (!parentPolicy.isSharedIsolation()) { // Do not override cache isolation when explicitly enabled by @Cacheable(true) annotation in current class. boolean copyParrent = cacheable == null || cacheable == false; if (!isIsolated() && (getCacheIsolation() != parentPolicy.getCacheIsolation()) && copyParrent) { session.log(SessionLog.WARNING, SessionLog.METADATA, "overriding_cache_isolation", new Object[]{descriptorDescriptor.getAlias(), parentPolicy.getCacheIsolation(), descriptor.getAlias(), getCacheIsolation()}); setCacheIsolation(parentPolicy.getCacheIsolation()); } } // Child must maintain the same indexes as the parent. for (CacheIndex index : parentPolicy.getCacheIndexes().values()) { addCacheIndex(index); } if ((getDatabaseChangeNotificationType() == null) && (parentPolicy.getDatabaseChangeNotificationType() != null)) { setDatabaseChangeNotificationType(parentPolicy.getDatabaseChangeNotificationType()); } if ((getCacheSynchronizationType() == UNDEFINED_OBJECT_CHANGE_BEHAVIOR) && (parentPolicy.getCacheSynchronizationType() != UNDEFINED_OBJECT_CHANGE_BEHAVIOR)) { setCacheSynchronizationType(parentPolicy.getCacheSynchronizationType()); } }