Example usage for org.hibernate.cache.cfg.spi EntityDataCachingConfig getCachedTypes

List of usage examples for org.hibernate.cache.cfg.spi EntityDataCachingConfig getCachedTypes

Introduction

In this page you can find the example usage for org.hibernate.cache.cfg.spi EntityDataCachingConfig getCachedTypes.

Prototype

Set<NavigableRole> getCachedTypes();

Source Link

Document

The list of specific subclasses of the root that are actually written to cache.

Usage

From source file:org.infinispan.hibernate.cache.v53.impl.DomainDataRegionImpl.java

License:LGPL

private void prepareForVersionedEntries(CacheMode cacheMode) {
    if (strategy != null) {
        assert strategy == Strategy.VERSIONED_ENTRIES;
        return;//from www.  j av  a 2  s. c o  m
    }

    prepareCommon(cacheMode);
    filter = VersionedEntry.EXCLUDE_EMPTY_VERSIONED_ENTRY;

    for (EntityDataCachingConfig entityConfig : config.getEntityCaching()) {
        if (entityConfig.isVersioned()) {
            for (NavigableRole role : entityConfig.getCachedTypes()) {
                comparatorsByType.put(role.getNavigableName(), entityConfig.getVersionComparatorAccess().get());
            }
        }
    }
    for (CollectionDataCachingConfig collectionConfig : config.getCollectionCaching()) {
        if (collectionConfig.isVersioned()) {
            comparatorsByType.put(collectionConfig.getNavigableRole().getNavigableName(),
                    collectionConfig.getOwnerVersionComparator());
        }
    }

    strategy = Strategy.VERSIONED_ENTRIES;
}