public static CacheConcurrencyStrategy fromAccessType(AccessType accessType) { final String name = accessType == null ? null : accessType.getName(); if ( AccessType.READ_ONLY.getName().equals( name ) ) { return READ_ONLY; } else if ( AccessType.READ_WRITE.getName().equals( name ) ) { return READ_WRITE; } else if ( AccessType.NONSTRICT_READ_WRITE.getName().equals( name ) ) { return NONSTRICT_READ_WRITE; } else if ( AccessType.TRANSACTIONAL.getName().equals( name ) ) { return TRANSACTIONAL; } else { return NONE; } }
public static CacheConcurrencyStrategy parse(String name) { if ( READ_ONLY.accessType.getName().equalsIgnoreCase( name ) ) { return READ_ONLY; } else if ( READ_WRITE.accessType.getName().equalsIgnoreCase( name ) ) { return READ_WRITE; } else if ( NONSTRICT_READ_WRITE.accessType.getName().equalsIgnoreCase( name ) ) { return NONSTRICT_READ_WRITE; } else if ( TRANSACTIONAL.accessType.getName().equalsIgnoreCase( name ) ) { return TRANSACTIONAL; } else if ( "none".equalsIgnoreCase( name ) ) { return NONE; } else { return null; } }
public static String getCacheConcurrencyStrategy(CacheConcurrencyStrategy strategy) { org.hibernate.cache.access.AccessType accessType = strategy.toAccessType(); return accessType == null ? null : accessType.getName(); }
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return optimistic ? new OptimisticReadOnlyAccess(this) : new ReadOnlyAccess(this); } if (AccessType.TRANSACTIONAL.equals(accessType)) { return optimistic ? new OptimisticTransactionalAccess(this) : new TransactionalAccess(this); } // todo : add support for READ_WRITE ( + NONSTRICT_READ_WRITE ??? ) throw new CacheException("unsupported access type [" + accessType.getName() + "]"); }
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return optimistic ? new OptimisticReadOnlyAccess(this) : new ReadOnlyAccess(this); } if (AccessType.TRANSACTIONAL.equals(accessType)) { return optimistic ? new OptimisticTransactionalAccess(this) : new TransactionalAccess(this); } // todo : add support for READ_WRITE ( + NONSTRICT_READ_WRITE ??? ) throw new CacheException("unsupported access type [" + accessType.getName() + "]"); }
/** * {@inheritDoc} */ public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return optimistic ? new OptimisticReadOnlyAccess(this) : new ReadOnlyAccess(this); } if (AccessType.TRANSACTIONAL.equals(accessType)) { return optimistic ? new OptimisticTransactionalAccess(this) : new TransactionalAccess(this); } // todo : add support for READ_WRITE ( + NONSTRICT_READ_WRITE ??? ) throw new CacheException("unsupported access type [" + accessType.getName() + "]"); }
/** * {@inheritDoc} */ public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException { if (AccessType.READ_ONLY.equals(accessType)) { return optimistic ? new OptimisticReadOnlyAccess(this) : new ReadOnlyAccess(this); } if (AccessType.TRANSACTIONAL.equals(accessType)) { return optimistic ? new OptimisticTransactionalAccess(this) : new TransactionalAccess(this); } // todo : add support for READ_WRITE ( + NONSTRICT_READ_WRITE ??? ) throw new CacheException("unsupported access type [" + accessType.getName() + "]"); }