org.hibernate.cache.spi.access.NaturalIdRegionAccessStrategy Java Examples
The following examples show how to use
org.hibernate.cache.spi.access.NaturalIdRegionAccessStrategy.
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: J2CacheAccessStrategyFactoryImpl.java From J2Cache with Apache License 2.0 | 6 votes |
@Override public NaturalIdRegionAccessStrategy createNaturalIdRegionAccessStrategy(J2CacheNaturalIdRegion naturalIdRegion, AccessType accessType) { switch (accessType) { case READ_ONLY: if (naturalIdRegion.getCacheDataDescription().isMutable()) { LOG.readOnlyCacheConfiguredForMutableEntity(naturalIdRegion.getName()); } return new ReadOnlyJ2CacheNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getSettings()); case READ_WRITE: return new ReadWriteJ2CacheNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getSettings()); case NONSTRICT_READ_WRITE: return new NonStrictReadWriteJ2CacheNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getSettings()); case TRANSACTIONAL: return new TransactionalJ2CacheNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getJ2Cache(), naturalIdRegion.getSettings()); default: throw new IllegalArgumentException("unrecognized access strategy type [" + accessType + "]"); } }
Example #2
Source File: NaturalIdRegionImpl.java From hibernate4-memcached with Apache License 2.0 | 6 votes |
@Override public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException { switch ( accessType ) { case READ_ONLY: if ( getCacheDataDescription().isMutable() ) { LOG.warnf( "read-only cache configured for mutable collection [ %s ]", getName() ); } return new ReadOnlyNaturalIdRegionAccessStrategy( this ); case READ_WRITE: return new ReadWriteNaturalIdRegionAccessStrategy( this ); case NONSTRICT_READ_WRITE: return new NonstrictReadWriteNaturalIdRegionAccessStrategy( this ); case TRANSACTIONAL: return new TransactionalNaturalIdRegionAccessStrategy( this ); // throw new UnsupportedOperationException( "doesn't support this access strategy" ); default: throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" ); } }
Example #3
Source File: RedissonNaturalIdRegion.java From redisson with Apache License 2.0 | 6 votes |
@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 |
@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: RedissonNaturalIdRegion.java From redisson with Apache License 2.0 | 6 votes |
@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 #6
Source File: J2CacheAccessStrategyFactoryImpl.java From J2Cache with Apache License 2.0 | 6 votes |
@Override public NaturalIdRegionAccessStrategy createNaturalIdRegionAccessStrategy(J2CacheNaturalIdRegion naturalIdRegion, AccessType accessType) { switch (accessType) { case READ_ONLY: if (naturalIdRegion.getCacheDataDescription().isMutable()) { LOG.readOnlyCacheConfiguredForMutableEntity(naturalIdRegion.getName()); } return new ReadOnlyJ2CacheNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getSettings()); case READ_WRITE: return new ReadWriteJ2CacheNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getSettings()); case NONSTRICT_READ_WRITE: return new NonStrictReadWriteJ2CacheNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getSettings()); case TRANSACTIONAL: return new TransactionalJ2CacheNaturalIdRegionAccessStrategy(naturalIdRegion, naturalIdRegion.getJ2Cache(), naturalIdRegion.getSettings()); default: throw new IllegalArgumentException("unrecognized access strategy type [" + accessType + "]"); } }
Example #7
Source File: NaturalIdMemcachedRegion.java From hibernate4-memcached with Apache License 2.0 | 5 votes |
@Override public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException { switch (accessType) { case READ_ONLY: return new ReadOnlyNaturalIdRegionAccessStrategy(this); case NONSTRICT_READ_WRITE: return new NonstrictReadWriteNaturalIdRegionAccessStrategy(this); default: throw new CacheException("Unsupported access strategy : " + accessType + "."); } }
Example #8
Source File: NonstopAccessStrategyFactory.java From J2Cache with Apache License 2.0 | 4 votes |
@Override public NaturalIdRegionAccessStrategy createNaturalIdRegionAccessStrategy(J2CacheNaturalIdRegion naturalIdRegion, AccessType accessType) { return new NonstopAwareNaturalIdRegionAccessStrategy(this.actualFactory.createNaturalIdRegionAccessStrategy(naturalIdRegion, accessType), HibernateNonstopCacheExceptionHandler.getInstance()); }
Example #9
Source File: HibernateNaturalIdRegion.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException { return new AccessStrategy(createAccessStrategy(accessType)); }
Example #10
Source File: HibernateNaturalIdRegion.java From ignite with Apache License 2.0 | 4 votes |
/** {@inheritDoc} */ @Override public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException { return new AccessStrategy(createAccessStrategy(accessType)); }
Example #11
Source File: NonstopAwareNaturalIdRegionAccessStrategy.java From J2Cache with Apache License 2.0 | 4 votes |
public NonstopAwareNaturalIdRegionAccessStrategy(NaturalIdRegionAccessStrategy actualStrategy, HibernateNonstopCacheExceptionHandler hibernateNonstopExceptionHandler) { this.actualStrategy = actualStrategy; this.hibernateNonstopExceptionHandler = hibernateNonstopExceptionHandler; }
Example #12
Source File: J2CacheNaturalIdRegion.java From J2Cache with Apache License 2.0 | 4 votes |
@Override public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException { return getAccessStrategyFactory().createNaturalIdRegionAccessStrategy(this, accessType); }
Example #13
Source File: NonstopAwareNaturalIdRegionAccessStrategy.java From J2Cache with Apache License 2.0 | 4 votes |
public NonstopAwareNaturalIdRegionAccessStrategy(NaturalIdRegionAccessStrategy actualStrategy, HibernateNonstopCacheExceptionHandler hibernateNonstopExceptionHandler) { this.actualStrategy = actualStrategy; this.hibernateNonstopExceptionHandler = hibernateNonstopExceptionHandler; }
Example #14
Source File: NonstopAccessStrategyFactory.java From J2Cache with Apache License 2.0 | 4 votes |
@Override public NaturalIdRegionAccessStrategy createNaturalIdRegionAccessStrategy(J2CacheNaturalIdRegion naturalIdRegion, AccessType accessType) { return new NonstopAwareNaturalIdRegionAccessStrategy(actualFactory.createNaturalIdRegionAccessStrategy(naturalIdRegion, accessType), HibernateNonstopCacheExceptionHandler.getInstance()); }
Example #15
Source File: J2CacheNaturalIdRegion.java From J2Cache with Apache License 2.0 | 4 votes |
@Override public NaturalIdRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException { return getAccessStrategyFactory().createNaturalIdRegionAccessStrategy(this, accessType); }
Example #16
Source File: J2CacheAccessStrategyFactory.java From J2Cache with Apache License 2.0 | votes |
NaturalIdRegionAccessStrategy createNaturalIdRegionAccessStrategy(J2CacheNaturalIdRegion naturalIdRegion, AccessType accessType);
Example #17
Source File: J2CacheAccessStrategyFactory.java From J2Cache with Apache License 2.0 | votes |
NaturalIdRegionAccessStrategy createNaturalIdRegionAccessStrategy(J2CacheNaturalIdRegion naturalIdRegion, AccessType accessType);