Java Code Examples for org.hibernate.cache.spi.access.AccessType#READ_WRITE

The following examples show how to use org.hibernate.cache.spi.access.AccessType#READ_WRITE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RedissonCollectionRegion.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Override
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    if (accessType == AccessType.READ_ONLY) {
        return new ReadOnlyCollectionRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.READ_WRITE) {
        return new ReadWriteCollectionRegionAccessStrategy(settings, this, mapCache);
    }
    if (accessType == AccessType.NONSTRICT_READ_WRITE) {
        return new NonStrictReadWriteCollectionRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.TRANSACTIONAL) {
        return new TransactionalCollectionRegionAccessStrategy(settings, this);
    }
    
    throw new CacheException("Unsupported access strategy: " + accessType);
}
 
Example 2
Source File: RedissonCollectionRegion.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Override
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    if (accessType == AccessType.READ_ONLY) {
        return new ReadOnlyCollectionRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.READ_WRITE) {
        return new ReadWriteCollectionRegionAccessStrategy(settings, this, mapCache);
    }
    if (accessType == AccessType.NONSTRICT_READ_WRITE) {
        return new NonStrictReadWriteCollectionRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.TRANSACTIONAL) {
        return new TransactionalCollectionRegionAccessStrategy(settings, this);
    }
    
    throw new CacheException("Unsupported access strategy: " + accessType);
}
 
Example 3
Source File: RedissonNaturalIdRegion.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Override
public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    if (accessType == AccessType.READ_ONLY) {
        return new ReadOnlyNaturalIdRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.READ_WRITE) {
        return new ReadWriteNaturalIdRegionAccessStrategy(settings, this, mapCache);
    }
    if (accessType == AccessType.NONSTRICT_READ_WRITE) {
        return new NonStrictReadWriteNaturalIdRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.TRANSACTIONAL) {
        return new TransactionalNaturalIdRegionAccessStrategy(settings, this);
    }
    
    throw new CacheException("Unsupported access strategy: " + accessType);
}
 
Example 4
Source File: RedissonNaturalIdRegion.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Override
public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    if (accessType == AccessType.READ_ONLY) {
        return new ReadOnlyNaturalIdRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.READ_WRITE) {
        return new ReadWriteNaturalIdRegionAccessStrategy(settings, this, mapCache);
    }
    if (accessType == AccessType.NONSTRICT_READ_WRITE) {
        return new NonStrictReadWriteNaturalIdRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.TRANSACTIONAL) {
        return new TransactionalNaturalIdRegionAccessStrategy(settings, this);
    }
    
    throw new CacheException("Unsupported access strategy: " + accessType);
}
 
Example 5
Source File: RedissonEntityRegion.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Override
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    if (accessType == AccessType.READ_ONLY) {
        return new ReadOnlyEntityRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.READ_WRITE) {
        return new ReadWriteEntityRegionAccessStrategy(settings, this, mapCache);
    }
    if (accessType == AccessType.NONSTRICT_READ_WRITE) {
        return new NonStrictReadWriteEntityRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.TRANSACTIONAL) {
        return new TransactionalEntityRegionAccessStrategy(settings, this);
    }
    
    throw new CacheException("Unsupported access strategy: " + accessType);
}
 
Example 6
Source File: RedissonEntityRegion.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Override
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    if (accessType == AccessType.READ_ONLY) {
        return new ReadOnlyEntityRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.READ_WRITE) {
        return new ReadWriteEntityRegionAccessStrategy(settings, this, mapCache);
    }
    if (accessType == AccessType.NONSTRICT_READ_WRITE) {
        return new NonStrictReadWriteEntityRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.TRANSACTIONAL) {
        return new TransactionalEntityRegionAccessStrategy(settings, this);
    }
    
    throw new CacheException("Unsupported access strategy: " + accessType);
}
 
Example 7
Source File: RedissonNaturalIdRegion.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Override
public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    if (accessType == AccessType.READ_ONLY) {
        return new ReadOnlyNaturalIdRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.READ_WRITE) {
        return new ReadWriteNaturalIdRegionAccessStrategy(settings, this, mapCache);
    }
    if (accessType == AccessType.NONSTRICT_READ_WRITE) {
        return new NonStrictReadWriteNaturalIdRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.TRANSACTIONAL) {
        return new TransactionalNaturalIdRegionAccessStrategy(settings, this);
    }
    
    throw new CacheException("Unsupported access strategy: " + accessType);
}
 
Example 8
Source File: RedissonEntityRegion.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Override
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
    if (accessType == AccessType.READ_ONLY) {
        return new ReadOnlyEntityRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.READ_WRITE) {
        return new ReadWriteEntityRegionAccessStrategy(settings, this, mapCache);
    }
    if (accessType == AccessType.NONSTRICT_READ_WRITE) {
        return new NonStrictReadWriteEntityRegionAccessStrategy(settings, this);
    }
    if (accessType == AccessType.TRANSACTIONAL) {
        return new TransactionalEntityRegionAccessStrategy(settings, this);
    }
    
    throw new CacheException("Unsupported access strategy: " + accessType);
}
 
Example 9
Source File: CachingRegionFactory.java    From hibernate4-memcached with Apache License 2.0 5 votes vote down vote up
@Override
public AccessType getDefaultAccessType() {
	if (properties != null && properties.get(DEFAULT_ACCESSTYPE) != null) {
		return AccessType.fromExternalName(properties.getProperty(DEFAULT_ACCESSTYPE));
	}
	return AccessType.READ_WRITE;
}
 
Example 10
Source File: HibernateL2CacheSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @return Hibernate L2 cache access types to test.
 */
protected AccessType[] accessTypes() {
    return new AccessType[]{AccessType.READ_ONLY, AccessType.NONSTRICT_READ_WRITE, AccessType.READ_WRITE};
}
 
Example 11
Source File: HibernateL2CacheStrategySelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@Test
public void testEntityCacheReadWrite() throws Exception {
    for (AccessType accessType : new AccessType[]{AccessType.READ_WRITE, AccessType.NONSTRICT_READ_WRITE})
        testEntityCacheReadWrite(accessType);
}
 
Example 12
Source File: HibernateL2CacheSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @return Hibernate L2 cache access types to test.
 */
protected AccessType[] accessTypes() {
    return new AccessType[]{AccessType.READ_ONLY, AccessType.NONSTRICT_READ_WRITE, AccessType.READ_WRITE};
}
 
Example 13
Source File: HibernateL2CacheStrategySelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@Test
public void testEntityCacheReadWrite() throws Exception {
    for (AccessType accessType : new AccessType[]{AccessType.READ_WRITE, AccessType.NONSTRICT_READ_WRITE})
        testEntityCacheReadWrite(accessType);
}
 
Example 14
Source File: AbstractJ2CacheRegionFactory.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
public AccessType getDefaultAccessType() {
    return AccessType.READ_WRITE;
}
 
Example 15
Source File: HibernateL2CacheStrategySelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/**
 * @throws Exception If failed.
 */
@Test
public void testEntityCacheReadWrite() throws Exception {
    for (AccessType accessType : new AccessType[]{AccessType.READ_WRITE, AccessType.NONSTRICT_READ_WRITE})
        testEntityCacheReadWrite(accessType);
}
 
Example 16
Source File: HibernateEhCacheRegionFactory.java    From yes-cart with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public AccessType getDefaultAccessType() {
    return AccessType.READ_WRITE;
}
 
Example 17
Source File: _HazelcastCacheRegionFactory.java    From jhipster-ribbon-hystrix with GNU General Public License v3.0 4 votes vote down vote up
public AccessType getDefaultAccessType() {
    return AccessType.READ_WRITE;
}
 
Example 18
Source File: AbstractRegionFactory.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public AccessType getDefaultAccessType() {
	return AccessType.READ_WRITE;
}
 
Example 19
Source File: EntityReadWriteAccess.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public AccessType getAccessType() {
	return AccessType.READ_WRITE;
}
 
Example 20
Source File: AbstractJ2CacheRegionFactory.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public AccessType getDefaultAccessType() {
    return AccessType.READ_WRITE;
}