本文整理汇总了Java中org.hibernate.cache.spi.access.EntityRegionAccessStrategy类的典型用法代码示例。如果您正苦于以下问题:Java EntityRegionAccessStrategy类的具体用法?Java EntityRegionAccessStrategy怎么用?Java EntityRegionAccessStrategy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityRegionAccessStrategy类属于org.hibernate.cache.spi.access包,在下文中一共展示了EntityRegionAccessStrategy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: UnionSubclassEntityPersister
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
public UnionSubclassEntityPersister(
final EntityBinding entityBinding,
final EntityRegionAccessStrategy cacheAccessStrategy,
final NaturalIdRegionAccessStrategy naturalIdRegionAccessStrategy,
final SessionFactoryImplementor factory,
final Mapping mapping) throws HibernateException {
super(entityBinding, cacheAccessStrategy, naturalIdRegionAccessStrategy, factory );
// TODO: implement!!! initializing final fields to null to make compiler happy.
subquery = null;
tableName = null;
subclassClosure = null;
spaces = null;
subclassSpaces = null;
discriminatorValue = null;
discriminatorSQLValue = null;
constraintOrderedTableNames = null;
constraintOrderedKeyColumnNames = null;
}
示例2: buildAccessStrategy
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
@Override
public EntityRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException {
if (AccessType.READ_ONLY.equals(accessType)) {
return new EntityRegionAccessStrategyAdapter(
new ReadOnlyAccessDelegate<HazelcastEntityRegion>(this, props));
}
if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
return new EntityRegionAccessStrategyAdapter(
new NonStrictReadWriteAccessDelegate<HazelcastEntityRegion>(this, props));
}
if (AccessType.READ_WRITE.equals(accessType)) {
return new EntityRegionAccessStrategyAdapter(
new ReadWriteAccessDelegate<HazelcastEntityRegion>(this, props));
}
throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast.");
}
示例3: populateMappingModel
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
private static void populateMappingModel(MetadataImplementor mappingMetadata, ExplicitSqmDomainMetamodel domainMetamodel) {
// final PersisterFactory persisterFactory = getSessionFactory().getServiceRegistry().getService( PersisterFactory.class );
final PersisterFactory persisterFactory = domainMetamodel.getPersisterFactory();
for ( final PersistentClass model : mappingMetadata.getEntityBindings() ) {
// final EntityRegionAccessStrategy accessStrategy = getSessionFactory().getCache().determineEntityRegionAccessStrategy(
// model
// );
final EntityRegionAccessStrategy accessStrategy = null;
// final NaturalIdRegionAccessStrategy naturalIdAccessStrategy = getSessionFactory().getCache().determineNaturalIdRegionAccessStrategy(
// model
// );
final NaturalIdRegionAccessStrategy naturalIdAccessStrategy = null;
persisterFactory.createEntityPersister(
model,
accessStrategy,
naturalIdAccessStrategy,
domainMetamodel
);
}
persisterFactory.finishUp( domainMetamodel );
}
示例4: buildAccessStrategy
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
switch (accessType) {
case READ_ONLY:
if (metadata.isMutable()) {
log.warn("read-only cache configured for mutable entity [" + getName() + "]");
}
return new ReadOnlyMemcachedEntityRegionAccessStrategy(this, settings);
case READ_WRITE:
return new ReadWriteMemcachedEntityRegionAccessStrategy(this, settings);
case NONSTRICT_READ_WRITE:
return new NonStrictReadWriteMemcachedEntityRegionAccessStrategy(this, settings);
case TRANSACTIONAL:
return new TransactionalMemcachedEntityRegionAccessStrategy(this, cache, settings);
default:
throw new IllegalArgumentException("unrecognized access strategy type [" + accessType + "]");
}
}
示例5: buildAccessStrategy
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
@Override
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
switch ( accessType ) {
case READ_ONLY:
if ( getCacheDataDescription().isMutable() ) {
LOG.warnf( "read-only cache configured for mutable entity [ %s ]", getName() );
}
return new ReadOnlyEntityRegionAccessStrategy( this );
case READ_WRITE:
return new ReadWriteEntityRegionAccessStrategy( this );
case NONSTRICT_READ_WRITE:
return new NonstrictReadWriteEntityRegionAccessStrategy( this );
case TRANSACTIONAL:
// throw new UnsupportedOperationException( "doesn't support this access strategy" );
return new TransactionalEntityRegionAccessStrategy( this );
default:
throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );
}
}
示例6: createEntityPersister
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
@Override
@SuppressWarnings( {"unchecked"})
public EntityPersister createEntityPersister(
PersistentClass metadata,
EntityRegionAccessStrategy cacheAccessStrategy,
NaturalIdRegionAccessStrategy naturalIdRegionAccessStrategy,
SessionFactoryImplementor factory,
Mapping cfg) {
Class<? extends EntityPersister> persisterClass = metadata.getEntityPersisterClass();
if ( persisterClass == null ) {
persisterClass = serviceRegistry.getService( PersisterClassResolver.class ).getEntityPersisterClass( metadata );
}
return create( persisterClass, ENTITY_PERSISTER_CONSTRUCTOR_ARGS, metadata, cacheAccessStrategy, naturalIdRegionAccessStrategy, factory, cfg );
}
示例7: buildAccessStrategy
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
public EntityRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException {
if (AccessType.READ_ONLY.equals(accessType)) {
return new EntityRegionAccessStrategyAdapter(
new ReadOnlyAccessDelegate<HazelcastEntityRegion>(this, props));
}
if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
return new EntityRegionAccessStrategyAdapter(
new NonStrictReadWriteAccessDelegate<HazelcastEntityRegion>(this, props));
}
if (AccessType.READ_WRITE.equals(accessType)) {
return new EntityRegionAccessStrategyAdapter(
new ReadWriteAccessDelegate<HazelcastEntityRegion>(this, props));
}
throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast.");
}
示例8: buildEntityRegionAccessStrategy
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
public static EntityRegionAccessStrategy buildEntityRegionAccessStrategy(TayzGridEntityRegion region, AccessType accessType) {
switch (accessType) {
case READ_ONLY:
return new ReadOnlyTayzGridEntityRegionAccessStrategy(region);
case NONSTRICT_READ_WRITE:
return new NonStrictReadWriteTayzGridEntityRegionAccessStrategy(region);
case READ_WRITE:
return new ReadWriteTayzGridEntityRegionAccessStrategy(region);
case TRANSACTIONAL:
throw new IllegalArgumentException(accessType + " access strategy not supported.");
default:
throw new IllegalArgumentException(accessType + " is not recognized as valid access type.");
}
}
示例9: EntityPersisterImpl
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
public EntityPersisterImpl(
PersistentClass mappingDescriptor,
EntityRegionAccessStrategy entityCaching,
NaturalIdRegionAccessStrategy naturalIdCaching,
PersisterCreationContext creationContext) {
super( resolveEntityJavaTypeDescriptor( creationContext, mappingDescriptor), null, null );
this.entityName = mappingDescriptor.getEntityName();
this.jpaEntityName = mappingDescriptor.getJpaEntityName();
setTypeConfiguration( creationContext.getTypeConfiguration() );
}
示例10: buildAccessStrategy
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
if(AccessType.READ_ONLY.equals(accessType)) {
return new ReadOnlyMemcachedEntityRegionAccessStrategy(this, settings);
} else if(AccessType.READ_WRITE.equals(accessType)) {
return new ReadWriteMemcachedEntityRegionAccessStrategy(this, settings);
} else if(AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
return new NonStrictReadWriteMemcachedEntityRegionAccessStrategy(this, settings);
} else if(AccessType.TRANSACTIONAL.equals(accessType)) {
throw new CacheException("Transactional access is not supported by Memcached region factory");
} else {
throw new IllegalArgumentException("Unknown access strategy type - " + accessType);
}
}
示例11: buildAccessStrategy
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
@Override
public EntityRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
switch (accessType) {
case READ_ONLY:
return new ReadOnlyEntityRegionAccessStrategy(this);
case NONSTRICT_READ_WRITE:
return new NonstrictReadWriteEntityRegionAccessStrategy(this);
default:
throw new CacheException("Unsupported access strategy : " + accessType + ".");
}
}
示例12: getCacheAccessStrategy
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
public EntityRegionAccessStrategy getCacheAccessStrategy() {
return cacheAccessStrategy;
}
示例13: JoinedSubclassEntityPersister
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
public JoinedSubclassEntityPersister(
final EntityBinding entityBinding,
final EntityRegionAccessStrategy cacheAccessStrategy,
final NaturalIdRegionAccessStrategy naturalIdRegionAccessStrategy,
final SessionFactoryImplementor factory,
final Mapping mapping) throws HibernateException {
super( entityBinding, cacheAccessStrategy, naturalIdRegionAccessStrategy, factory );
// TODO: implement!!! initializing final fields to null to make compiler happy
tableSpan = -1;
tableNames = null;
naturalOrderTableNames = null;
tableKeyColumns = null;
tableKeyColumnReaders = null;
tableKeyColumnReaderTemplates = null;
naturalOrderTableKeyColumns = null;
naturalOrderTableKeyColumnReaders = null;
naturalOrderTableKeyColumnReaderTemplates = null;
naturalOrderCascadeDeleteEnabled = null;
spaces = null;
subclassClosure = null;
subclassTableNameClosure = null;
subclassTableKeyColumnClosure = null;
isClassOrSuperclassTable = null;
naturalOrderPropertyTableNumbers = null;
propertyTableNumbers = null;
subclassPropertyTableNumberClosure = null;
subclassColumnTableNumberClosure = null;
subclassFormulaTableNumberClosure = null;
subclassTableSequentialSelect = null;
subclassTableIsLazyClosure = null;
discriminatorValues = null;
notNullColumnNames = null;
notNullColumnTableNumbers = null;
constraintOrderedTableNames = null;
constraintOrderedKeyColumnNames = null;
discriminatorValue = null;
discriminatorSQLString = null;
discriminatorType = StandardBasicTypes.INTEGER;
explicitDiscriminatorColumnName = null;
discriminatorAlias = IMPLICIT_DISCRIMINATOR_ALIAS;
coreTableSpan = -1;
isNullableTable = null;
subclassNamesBySubclassTable = null;
}
示例14: EntityCleanup
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
private EntityCleanup(EntityRegionAccessStrategy cacheAccess) {
this.cacheAccess = cacheAccess;
this.cacheLock = cacheAccess.lockRegion();
cacheAccess.removeAll();
}
示例15: getCacheAccessStrategy
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy; //导入依赖的package包/类
@Override
public EntityRegionAccessStrategy getCacheAccessStrategy() {
// TODO Auto-generated method stub
return null;
}