本文整理汇总了Java中org.hibernate.cache.spi.access.CollectionRegionAccessStrategy类的典型用法代码示例。如果您正苦于以下问题:Java CollectionRegionAccessStrategy类的具体用法?Java CollectionRegionAccessStrategy怎么用?Java CollectionRegionAccessStrategy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CollectionRegionAccessStrategy类属于org.hibernate.cache.spi.access包,在下文中一共展示了CollectionRegionAccessStrategy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildAccessStrategy
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
@Override
public CollectionRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException {
if (AccessType.READ_ONLY.equals(accessType)) {
return new CollectionRegionAccessStrategyAdapter(
new ReadOnlyAccessDelegate<HazelcastCollectionRegion>(this, props));
}
if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
return new CollectionRegionAccessStrategyAdapter(
new NonStrictReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props));
}
if (AccessType.READ_WRITE.equals(accessType)) {
return new CollectionRegionAccessStrategyAdapter(
new ReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props));
}
throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast.");
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate5,代码行数:17,代码来源:HazelcastCollectionRegion.java
示例2: buildPluralAttribute
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
public OrmAttribute buildPluralAttribute(
PersisterCreationContext creationContext,
Collection collectionBinding,
OrmNavigableSource source,
String propertyName) {
// todo : resolve cache access
final CollectionRegionAccessStrategy cachingAccess = null;
// need PersisterCreationContext - we should always have access to that when building persisters, through finalized initialization
final CollectionPersister collectionPersister = creationContext.getPersisterFactory().createCollectionPersister(
collectionBinding,
(ManagedTypeImplementor) source,
propertyName,
cachingAccess,
creationContext
);
creationContext.registerCollectionPersister( collectionPersister );
return collectionPersister;
}
开发者ID:hibernate,项目名称:hibernate-semantic-query,代码行数:20,代码来源:PersisterHelper.java
示例3: buildAccessStrategy
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
public CollectionRegionAccessStrategy 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 ReadOnlyMemcachedCollectionRegionAccessStrategy(this, settings);
case READ_WRITE:
return new ReadWriteMemcachedCollectionRegionAccessStrategy(this, settings);
case NONSTRICT_READ_WRITE:
return new NonStrictReadWriteMemcachedCollectionRegionAccessStrategy(this, settings);
case TRANSACTIONAL:
return new TransactionalMemcachedCollectionRegionAccessStrategy(this, settings);
default:
throw new IllegalArgumentException("unrecognized access strategy type [" + accessType + "]");
}
}
开发者ID:mihaicostin,项目名称:hibernate-l2-memcached,代码行数:19,代码来源:MemcachedCollectionRegion.java
示例4: buildAccessStrategy
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
@Override
public CollectionRegionAccessStrategy 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 ReadOnlyCollectionRegionAccessStrategy( this );
case READ_WRITE:
return new ReadWriteCollectionRegionAccessStrategy( this );
case NONSTRICT_READ_WRITE:
return new NonstrictReadWriteCollectionRegionAccessStrategy( this );
case TRANSACTIONAL:
return new TransactionalCollectionRegionAccessStrategy( this );
// throw new UnsupportedOperationException( "doesn't support this access strategy" );
default:
throw new IllegalArgumentException( "unrecognized access strategy type [" + accessType + "]" );
}
}
开发者ID:kwon37xi,项目名称:hibernate4-memcached,代码行数:20,代码来源:CollectionRegionImpl.java
示例5: createCollectionPersister
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
@Override
@SuppressWarnings( {"unchecked"})
public CollectionPersister createCollectionPersister(
Configuration cfg,
Collection collectionMetadata,
CollectionRegionAccessStrategy cacheAccessStrategy,
SessionFactoryImplementor factory) throws HibernateException {
Class<? extends CollectionPersister> persisterClass = collectionMetadata.getCollectionPersisterClass();
if ( persisterClass == null ) {
persisterClass = serviceRegistry.getService( PersisterClassResolver.class ).getCollectionPersisterClass( collectionMetadata );
}
return create( persisterClass, COLLECTION_PERSISTER_CONSTRUCTOR_ARGS, cfg, collectionMetadata, cacheAccessStrategy, factory );
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:PersisterFactoryImpl.java
示例6: BasicCollectionPersister
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
public BasicCollectionPersister(
Collection collection,
CollectionRegionAccessStrategy cacheAccessStrategy,
Configuration cfg,
SessionFactoryImplementor factory) throws MappingException, CacheException {
super( collection, cacheAccessStrategy, cfg, factory );
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:BasicCollectionPersister.java
示例7: OneToManyPersister
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
public OneToManyPersister(
Collection collection,
CollectionRegionAccessStrategy cacheAccessStrategy,
Configuration cfg,
SessionFactoryImplementor factory) throws MappingException, CacheException {
super( collection, cacheAccessStrategy, cfg, factory );
cascadeDeleteEnabled = collection.getKey().isCascadeDeleteEnabled() &&
factory.getDialect().supportsCascadeDelete();
keyIsNullable = collection.getKey().isNullable();
keyIsUpdateable = collection.getKey().isUpdateable();
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:OneToManyPersister.java
示例8: buildAccessStrategy
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
public CollectionRegionAccessStrategy buildAccessStrategy(final AccessType accessType) throws CacheException {
if (AccessType.READ_ONLY.equals(accessType)) {
return new CollectionRegionAccessStrategyAdapter(
new ReadOnlyAccessDelegate<HazelcastCollectionRegion>(this, props));
}
if (AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
return new CollectionRegionAccessStrategyAdapter(
new NonStrictReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props));
}
if (AccessType.READ_WRITE.equals(accessType)) {
return new CollectionRegionAccessStrategyAdapter(
new ReadWriteAccessDelegate<HazelcastCollectionRegion>(this, props));
}
throw new CacheException("AccessType \"" + accessType + "\" is not currently supported by Hazelcast.");
}
开发者ID:hazelcast,项目名称:hazelcast-hibernate,代码行数:16,代码来源:HazelcastCollectionRegion.java
示例9: buildCollectionRegionAccessStrategy
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
public static CollectionRegionAccessStrategy buildCollectionRegionAccessStrategy(TayzGridCollectionRegion region, AccessType accessType) {
switch (accessType) {
case READ_ONLY:
return new ReadOnlyTayzGridCollectionRegionAccessStrategy(region);
case NONSTRICT_READ_WRITE:
return new NonStrictReadWriteTayzGridCollectionRegionAccessStrategy(region);
case READ_WRITE:
return new ReadWriteTayzGridCollectionRegionAccessStrategy(region);
case TRANSACTIONAL:
throw new IllegalArgumentException(accessType + " access strategy not supported.");
default:
throw new IllegalArgumentException(accessType + " is not recognized as valid access type.");
}
}
开发者ID:Alachisoft,项目名称:TayzGrid,代码行数:15,代码来源:TayzGridStrategyBuilder.java
示例10: createCollectionPersister
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
@Override
@SuppressWarnings( {"unchecked"})
public CollectionPersister createCollectionPersister(
Collection collectionBinding,
ManagedTypeImplementor source,
String propertyName,
CollectionRegionAccessStrategy cacheAccessStrategy,
PersisterCreationContext creationContext) throws HibernateException {
// // If the metadata for the collection specified an explicit persister class, use it
// Class<? extends CollectionPersister> persisterClass = collectionBinding.getCollectionPersisterClass();
// if ( persisterClass == null ) {
// // Otherwise, use the persister class indicated by the PersisterClassResolver service
// persisterClass = serviceRegistry.getService( PersisterClassResolver.class )
// .getCollectionPersisterClass( collectionBinding );
// }
// return createCollectionPersister( persisterClass, collectionBinding, source, propertyName, cacheAccessStrategy, creationContext );
// todo : ^^ we need to make this fit the published ctor contract (as much as possible)
// for now just create a simpl testing stub
return new CollectionPersisterImpl(
collectionBinding,
source,
propertyName,
null,
creationContext
);
}
开发者ID:hibernate,项目名称:hibernate-semantic-query,代码行数:28,代码来源:PersisterFactoryImpl.java
示例11: CollectionPersisterImpl
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
public CollectionPersisterImpl(
Collection collectionBinding,
ManagedTypeImplementor source,
String localName,
CollectionRegionAccessStrategy collectionCaching,
PersisterCreationContext creationContext) {
super( source, localName, PropertyAccess.DUMMY );
this.source = source;
this.localName = localName;
this.role = source.getNavigableName() + '.' + this.localName;
this.collectionClassification = PersisterHelper.interpretCollectionClassification( collectionBinding );
this.foreignKeyDescriptor = new CollectionKey( this );
this.typeConfiguration = creationContext.getTypeConfiguration();
this.collectionType = new CollectionTypeImpl(
role,
resolveCollectionJtd( creationContext, collectionClassification ),
null,
null
);
if ( collectionBinding instanceof IndexedCollection ) {
final Value indexValueMapping = ( (IndexedCollection) collectionBinding ).getIndex();
if ( indexValueMapping instanceof SimpleValue ) {
final SimpleValue simpleIndexValueMapping = (SimpleValue) indexValueMapping;
// indexAttributeConverter = simpleIndexValueMapping.getAttributeConverterDescriptor().getAttributeConverter();
}
}
final Value elementValueMapping = collectionBinding.getElement();
if ( elementValueMapping instanceof SimpleValue ) {
final SimpleValue simpleElementValueMapping = (SimpleValue) elementValueMapping;
// elementAttributeConverter = simpleElementValueMapping.getAttributeConverterDescriptor().getAttributeConverter();
}
}
开发者ID:hibernate,项目名称:hibernate-semantic-query,代码行数:37,代码来源:CollectionPersisterImpl.java
示例12: buildAccessStrategy
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
if(AccessType.READ_ONLY.equals(accessType)) {
return new ReadOnlyMemcachedCollectionRegionAccessStrategy(this, settings);
} else if(AccessType.READ_WRITE.equals(accessType)) {
return new ReadWriteMemcachedCollectionRegionAccessStrategy(this, settings);
} else if(AccessType.NONSTRICT_READ_WRITE.equals(accessType)) {
return new NonStrictReadWriteMemcachedCollectionRegionAccessStrategy(this, settings);
} else if(AccessType.TRANSACTIONAL.equals(accessType)) {
throw new CacheException("Transactional access is not supported by Memcached region factory");
} else {
throw new UnsupportedOperationException("Uknown access strategy type - " + accessType);
}
}
开发者ID:4data,项目名称:hibernate-memcached,代码行数:14,代码来源:MemcachedCollectionRegion.java
示例13: buildAccessStrategy
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
@Override
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
switch (accessType) {
case READ_ONLY:
return new ReadOnlyCollectionRegionAccessStrategy(this);
case NONSTRICT_READ_WRITE:
return new NonstrictReadWriteCollectionRegionAccessStrategy(this);
default:
throw new CacheException("Unsupported access strategy : " + accessType + ".");
}
}
开发者ID:kwon37xi,项目名称:hibernate4-memcached,代码行数:12,代码来源:CollectionMemcachedRegion.java
示例14: getCacheAccessStrategy
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
@Override
public CollectionRegionAccessStrategy getCacheAccessStrategy() {
return cacheAccessStrategy;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:AbstractCollectionPersister.java
示例15: CollectionCleanup
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
private CollectionCleanup(CollectionRegionAccessStrategy cacheAccess) {
this.cacheAccess = cacheAccess;
this.cacheLock = cacheAccess.lockRegion();
cacheAccess.removeAll();
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:BulkOperationCleanupAction.java
示例16: CustomOneToManyPersister
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
public CustomOneToManyPersister(Collection collection, CollectionRegionAccessStrategy cacheAccessStrategy, Configuration cfg, SessionFactoryImplementor factory) throws MappingException, CacheException {
super(collection, cacheAccessStrategy, cfg, factory);
}
开发者ID:jicahoo,项目名称:try-hibernate,代码行数:4,代码来源:CustomOneToManyPersister.java
示例17: CustomCollectionPersister
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
public CustomCollectionPersister(Collection collection, CollectionRegionAccessStrategy cacheAccessStrategy, Configuration cfg, SessionFactoryImplementor factory) throws MappingException, CacheException {
super(collection, cacheAccessStrategy, cfg, factory);
}
开发者ID:jicahoo,项目名称:try-hibernate,代码行数:4,代码来源:CustomCollectionPersister.java
示例18: buildAccessStrategy
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
/** {@inheritDoc} */
@Override public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
return new AccessStrategy(createAccessStrategy(accessType));
}
开发者ID:apache,项目名称:ignite,代码行数:5,代码来源:HibernateCollectionRegion.java
示例19: buildAccessStrategy
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
@Override
public CollectionRegionAccessStrategy buildAccessStrategy(AccessType accessType) throws CacheException {
throw new UnsupportedOperationException();
}
开发者ID:bedatadriven,项目名称:appengine-hibernate,代码行数:5,代码来源:MemcacheCollectionRegion.java
示例20: createCollectionPersister
import org.hibernate.cache.spi.access.CollectionRegionAccessStrategy; //导入依赖的package包/类
/**
* Create a collection persister instance.
*
* @param collectionBinding The mapping information describing the collection
* @param cacheAccessStrategy The cache access strategy for the collection region
* @param creationContext Access to additional information needed to create a persister
*
* @return An appropriate collection persister instance.
*
* @throws HibernateException Indicates a problem building the persister.
*/
CollectionPersister createCollectionPersister(
Collection collectionBinding,
ManagedTypeImplementor source,
String propertyName,
CollectionRegionAccessStrategy cacheAccessStrategy,
PersisterCreationContext creationContext) throws HibernateException;
开发者ID:hibernate,项目名称:hibernate-semantic-query,代码行数:18,代码来源:PersisterFactory.java
注:本文中的org.hibernate.cache.spi.access.CollectionRegionAccessStrategy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论