HHH-6827 correct testing 2L cache impl, mostly are copied from ehcache impl
This commit is contained in:
parent
6c6e9669c1
commit
15a46a9661
|
@ -0,0 +1,27 @@
|
|||
package org.hibernate.testing.cache;
|
||||
|
||||
import org.hibernate.cache.CacheException;
|
||||
import org.hibernate.cache.spi.CollectionRegion;
|
||||
import org.hibernate.cache.spi.access.SoftLock;
|
||||
|
||||
/**
|
||||
* @author Strong Liu <stliu@hibernate.org>
|
||||
*/
|
||||
class TransactionalCollectionRegionAccessStrategy extends BaseCollectionRegionAccessStrategy {
|
||||
TransactionalCollectionRegionAccessStrategy(CollectionRegionImpl region) {
|
||||
super( region );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void remove(Object key) throws CacheException {
|
||||
evict( key );
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package org.hibernate.testing.cache;
|
||||
|
||||
import org.hibernate.cache.CacheException;
|
||||
import org.hibernate.cache.spi.access.SoftLock;
|
||||
|
||||
/**
|
||||
* @author Strong Liu <stliu@hibernate.org>
|
||||
*/
|
||||
class TransactionalEntityRegionAccessStrategy extends BaseEntityRegionAccessStrategy {
|
||||
TransactionalEntityRegionAccessStrategy(EntityRegionImpl region) {
|
||||
super( region );
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public boolean afterInsert(Object key, Object value, Object version) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public void remove(Object key) throws CacheException {
|
||||
evict( key );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public boolean update(Object key, Object value, Object currentVersion,
|
||||
Object previousVersion) throws CacheException {
|
||||
return insert( key, value, currentVersion );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue