org.hibernate.cache.spi.CacheKeysFactory Java Examples

The following examples show how to use org.hibernate.cache.spi.CacheKeysFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractDomainDataRegion.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
public AbstractDomainDataRegion(
			DomainDataRegionConfig regionConfig,
			RegionFactory regionFactory,
			CacheKeysFactory defaultKeysFactory,
			DomainDataRegionBuildingContext buildingContext) {
//		super( regionFactory.qualify( regionConfig.getRegionName() ), regionFactory );
		super( regionConfig.getRegionName(), regionFactory );

		this.sessionFactory = buildingContext.getSessionFactory();

		if ( defaultKeysFactory == null ) {
			defaultKeysFactory = DefaultCacheKeysFactory.INSTANCE;
		}
		this.effectiveKeysFactory = buildingContext.getEnforcedCacheKeysFactory() != null
				? buildingContext.getEnforcedCacheKeysFactory()
				: defaultKeysFactory;
	}
 
Example #2
Source File: EntityReadWriteAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public EntityReadWriteAccess(
		DomainDataRegion domainDataRegion,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		EntityDataCachingConfig entityAccessConfig) {
	super( domainDataRegion, storageAccess );
	this.keysFactory = keysFactory;
	this.versionComparator = entityAccessConfig.getVersionComparatorAccess() == null
			? null
			: entityAccessConfig.getVersionComparatorAccess().get();
}
 
Example #3
Source File: StrategySelectorBuilder.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private void addCacheKeysFactories(StrategySelectorImpl strategySelector) {
	strategySelector.registerStrategyImplementor(
		CacheKeysFactory.class,
		DefaultCacheKeysFactory.SHORT_NAME,
		DefaultCacheKeysFactory.class
	);
	strategySelector.registerStrategyImplementor(
		CacheKeysFactory.class,
		SimpleCacheKeysFactory.SHORT_NAME,
		SimpleCacheKeysFactory.class
	);
}
 
Example #4
Source File: RedissonRegionFactory.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
protected void prepareForUse(SessionFactoryOptions settings, @SuppressWarnings("rawtypes") Map properties) throws CacheException {
    this.redisson = createRedissonClient(properties);
    
    StrategySelector selector = settings.getServiceRegistry().getService(StrategySelector.class);
    cacheKeysFactory = selector.resolveDefaultableStrategy(CacheKeysFactory.class, 
            properties.get(Environment.CACHE_KEYS_FACTORY), new RedissonCacheKeysFactory(redisson.getConfig().getCodec()));
}
 
Example #5
Source File: CollectionTransactionAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public CollectionTransactionAccess(
		DomainDataRegion region,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		CollectionDataCachingConfig config) {
	super( region, keysFactory, storageAccess, config );
}
 
Example #6
Source File: QuarkusStrategySelectorBuilder.java    From quarkus with Apache License 2.0 5 votes vote down vote up
private static void addCacheKeysFactories(StrategySelectorImpl strategySelector) {
    strategySelector.registerStrategyImplementor(
            CacheKeysFactory.class,
            DefaultCacheKeysFactory.SHORT_NAME,
            DefaultCacheKeysFactory.class);
    strategySelector.registerStrategyImplementor(
            CacheKeysFactory.class,
            SimpleCacheKeysFactory.SHORT_NAME,
            SimpleCacheKeysFactory.class);
}
 
Example #7
Source File: EntityNonStrictReadWriteAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public EntityNonStrictReadWriteAccess(
		DomainDataRegion domainDataRegion,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		EntityDataCachingConfig entityAccessConfig) {
	super( domainDataRegion, keysFactory, storageAccess );
}
 
Example #8
Source File: DomainDataRegionImpl.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("WeakerAccess")
public DomainDataRegionImpl(
		DomainDataRegionConfig regionConfig,
		RegionFactoryTemplate regionFactory,
		DomainDataStorageAccess domainDataStorageAccess,
		CacheKeysFactory defaultKeysFactory,
		DomainDataRegionBuildingContext buildingContext) {
	super(
			regionConfig,
			regionFactory,
			domainDataStorageAccess,
			defaultKeysFactory,
			buildingContext
	);
}
 
Example #9
Source File: NaturalIdNonStrictReadWriteAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public NaturalIdNonStrictReadWriteAccess(
		DomainDataRegion region,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		NaturalIdDataCachingConfig config) {
	super( region, keysFactory, storageAccess, config );
}
 
Example #10
Source File: AbstractCollectionDataAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public AbstractCollectionDataAccess(
		DomainDataRegion region,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		CollectionDataCachingConfig config) {
	super( region, storageAccess );
	this.keysFactory = keysFactory;
}
 
Example #11
Source File: CollectionReadWriteAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public CollectionReadWriteAccess(
		DomainDataRegion region,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		CollectionDataCachingConfig config) {
	super( region, storageAccess );
	this.keysFactory = keysFactory;
	this.collectionRole = config.getNavigableRole();
	this.versionComparator = config.getOwnerVersionComparator();
}
 
Example #12
Source File: EntityReadOnlyAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public EntityReadOnlyAccess(
		DomainDataRegion region,
		CacheKeysFactory cacheKeysFactory,
		DomainDataStorageAccess storageAccess,
		EntityDataCachingConfig config) {
	super( region, cacheKeysFactory, storageAccess );
	if ( config.isMutable() ) {
		SecondLevelCacheLogger.INSTANCE.readOnlyCachingMutableEntity( config.getNavigableRole() );
	}
}
 
Example #13
Source File: AbstractNaturalIdDataAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public AbstractNaturalIdDataAccess(
		DomainDataRegion region,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		NaturalIdDataCachingConfig config) {
	super( region, storageAccess );
	this.keysFactory = keysFactory;
}
 
Example #14
Source File: NaturalIdReadOnlyAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public NaturalIdReadOnlyAccess(
		DomainDataRegion region,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		NaturalIdDataCachingConfig config) {
	super( region, keysFactory, storageAccess, config );
	if ( config.isMutable() ) {
		SecondLevelCacheLogger.INSTANCE.readOnlyCachingMutableNaturalId( config.getNavigableRole() );
	}
}
 
Example #15
Source File: IgniteDomainDataRegion.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** */
public IgniteDomainDataRegion(DomainDataRegionConfig regionCfg,
    RegionFactory regionFactory,
    CacheKeysFactory defKeysFactory,
    DomainDataRegionBuildingContext buildingCtx,
    HibernateAccessStrategyFactory stgyFactory) {
    super(regionCfg, regionFactory, defKeysFactory, buildingCtx);

    this.stgyFactory = stgyFactory;

    cache = stgyFactory.regionCache(getName());

    completeInstantiation(regionCfg, buildingCtx);
}
 
Example #16
Source File: CollectionReadOnlyAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public CollectionReadOnlyAccess(
		DomainDataRegion region,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		CollectionDataCachingConfig config) {
	super( region, keysFactory, storageAccess, config );
}
 
Example #17
Source File: EntityTransactionalAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public EntityTransactionalAccess(
		DomainDataRegion region,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		EntityDataCachingConfig accessConfig) {
	super( region, keysFactory, storageAccess );
}
 
Example #18
Source File: NaturalIdReadWriteAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public NaturalIdReadWriteAccess(
		DomainDataRegion region,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		NaturalIdDataCachingConfig naturalIdDataCachingConfig) {
	super( region, storageAccess );
	this.keysFactory = keysFactory;
}
 
Example #19
Source File: AbstractEntityDataAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public AbstractEntityDataAccess(
		DomainDataRegion region,
		CacheKeysFactory cacheKeysFactory,
		DomainDataStorageAccess storageAccess) {
	super( region, storageAccess );
	this.cacheKeysFactory = cacheKeysFactory;
}
 
Example #20
Source File: CollectionNonStrictReadWriteAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public CollectionNonStrictReadWriteAccess(
		DomainDataRegion region,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		CollectionDataCachingConfig config) {
	super( region, keysFactory, storageAccess, config );
}
 
Example #21
Source File: NaturalIdTransactionalAccess.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public NaturalIdTransactionalAccess(
		DomainDataRegion region,
		CacheKeysFactory keysFactory,
		DomainDataStorageAccess storageAccess,
		NaturalIdDataCachingConfig config) {
	super( region, keysFactory, storageAccess, config );
}
 
Example #22
Source File: DomainDataRegionTemplate.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public DomainDataRegionTemplate(
		DomainDataRegionConfig regionConfig,
		RegionFactory regionFactory,
		DomainDataStorageAccess storageAccess,
		CacheKeysFactory defaultKeysFactory,
		DomainDataRegionBuildingContext buildingContext) {
	super( regionConfig, regionFactory, defaultKeysFactory, buildingContext );
	this.storageAccess = storageAccess;

	// now the super-type calls will have access to the `DomainDataStorageAccess` reference
	completeInstantiation( regionConfig, buildingContext );
}
 
Example #23
Source File: RedissonNaturalIdRegion.java    From redisson with Apache License 2.0 4 votes vote down vote up
public RedissonNaturalIdRegion(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, RegionFactory regionFactory,
                               CacheDataDescription metadata, Settings settings, Properties properties, String defaultKey, CacheKeysFactory cacheKeysFactory) {
    super(mapCache, connectionManager, regionFactory, metadata, properties, defaultKey);
    this.settings = settings;
    this.cacheKeysFactory = cacheKeysFactory;
}
 
Example #24
Source File: RedissonEntityRegion.java    From redisson with Apache License 2.0 4 votes vote down vote up
public CacheKeysFactory getCacheKeysFactory() {
    return cacheKeysFactory;
}
 
Example #25
Source File: RedissonRegionFactory.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
protected CacheKeysFactory getImplicitCacheKeysFactory() {
    return cacheKeysFactory;
}
 
Example #26
Source File: RegionFactoryTemplate.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
protected CacheKeysFactory getImplicitCacheKeysFactory() {
	return DefaultCacheKeysFactory.INSTANCE;
}
 
Example #27
Source File: RedissonNaturalIdRegion.java    From redisson with Apache License 2.0 4 votes vote down vote up
public CacheKeysFactory getCacheKeysFactory() {
    return cacheKeysFactory;
}
 
Example #28
Source File: RedissonCollectionRegion.java    From redisson with Apache License 2.0 4 votes vote down vote up
public RedissonCollectionRegion(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, RegionFactory regionFactory,
                                CacheDataDescription metadata, Settings settings, Properties properties, String defaultKey, CacheKeysFactory cacheKeysFactory) {
    super(mapCache, connectionManager, regionFactory, metadata, properties, defaultKey);
    this.settings = settings;
    this.cacheKeysFactory = cacheKeysFactory;
}
 
Example #29
Source File: RedissonCollectionRegion.java    From redisson with Apache License 2.0 4 votes vote down vote up
public CacheKeysFactory getCacheKeysFactory() {
    return cacheKeysFactory;
}
 
Example #30
Source File: RedissonEntityRegion.java    From redisson with Apache License 2.0 4 votes vote down vote up
public RedissonEntityRegion(RMapCache<Object, Object> mapCache, ConnectionManager connectionManager, RegionFactory regionFactory,
                            CacheDataDescription metadata, Settings settings, Properties properties, String defaultKey, CacheKeysFactory cacheKeysFactory) {
    super(mapCache, connectionManager, regionFactory, metadata, properties, defaultKey);
    this.settings = settings;
    this.cacheKeysFactory = cacheKeysFactory;
}