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

The following examples show how to use org.hibernate.cache.spi.access.AccessType#NONSTRICT_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: 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 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: 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 5
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 6
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 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: 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 9
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 10
Source File: Hibernate4MemcachedRegionFactory.java    From hibernate4-memcached with Apache License 2.0 4 votes vote down vote up
@Override
public AccessType getDefaultAccessType() {
    return AccessType.NONSTRICT_READ_WRITE;
}
 
Example 11
Source File: NaturalIdNonStrictReadWriteAccess.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public AccessType getAccessType() {
	return AccessType.NONSTRICT_READ_WRITE;
}
 
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: 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 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: 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 17
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 18
Source File: EntityNonStrictReadWriteAccess.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
@Override
public AccessType getAccessType() {
	return AccessType.NONSTRICT_READ_WRITE;
}