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

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

Introduction

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

Prototype

AccessType getAccessType();

Source Link

Document

The requested AccessType

Usage

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

License:LGPL

@Override
public EntityDataAccess getEntityDataAccess(NavigableRole rootEntityRole) {
    EntityDataCachingConfig entityConfig = findConfig(config.getEntityCaching(), rootEntityRole);
    AccessType accessType = entityConfig.getAccessType();
    AccessDelegate accessDelegate = createAccessDelegate(accessType,
            entityConfig.isVersioned() ? entityConfig.getVersionComparatorAccess().get() : null);
    if (accessType == AccessType.READ_ONLY || !entityConfig.isMutable()) {
        return new ReadOnlyEntityDataAccess(accessType, accessDelegate, this);
    } else {/*from  w  w  w.  j a v a 2  s.  c  o  m*/
        return new ReadWriteEntityDataAccess(accessType, accessDelegate, this);
    }
}