下面列出了org.hibernate.cache.spi.access.AccessType#READ_ONLY 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@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);
}
@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);
}
@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);
}
@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);
}
@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);
}
@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);
}
@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);
}
@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);
}
@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);
}
@Override
public AccessType getAccessType() {
return AccessType.READ_ONLY;
}
@Override
public AccessType getAccessType() {
return AccessType.READ_ONLY;
}
@Override
public AccessType getAccessType() {
return AccessType.READ_ONLY;
}
/**
* @return Hibernate L2 cache access types to test.
*/
protected AccessType[] accessTypes() {
return new AccessType[]{AccessType.READ_ONLY, AccessType.NONSTRICT_READ_WRITE, AccessType.READ_WRITE};
}
/**
* @return Hibernate L2 cache access types to test.
*/
protected AccessType[] accessTypes() {
return new AccessType[]{AccessType.READ_ONLY, AccessType.NONSTRICT_READ_WRITE, AccessType.READ_WRITE};
}
/**
* @return Hibernate L2 cache access types to test.
*/
protected AccessType[] accessTypes() {
return new AccessType[]{AccessType.READ_ONLY, AccessType.NONSTRICT_READ_WRITE, AccessType.READ_WRITE};
}