/** * @param qryEntity Query entity. * @return Cache configuration. */ protected CacheConfiguration cacheConfiguration(QueryEntity qryEntity) { CacheConfiguration<?, ?> cache = defaultCacheConfiguration(); cache.setCacheMode(cacheMode()); cache.setAtomicityMode(atomicityMode()); cache.setBackups(1); cache.setWriteSynchronizationMode(FULL_SYNC); cache.setQueryEntities(Collections.singletonList(qryEntity)); if (TRANSACTIONAL_SNAPSHOT.equals(atomicityMode())) cache.setNearConfiguration(null); return cache; }