org.hibernate.cache.internal.DefaultCacheKeysFactory Java Examples

The following examples show how to use org.hibernate.cache.internal.DefaultCacheKeysFactory. 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: 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 #3
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 #4
Source File: NonStrictReadWriteJ2CacheEntityRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object getCacheKeyId(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetEntityId( cacheKey );
}
 
Example #5
Source File: NonStrictReadWriteJ2CacheEntityRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object generateCacheKey(Object id, EntityPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) {
    return DefaultCacheKeysFactory.staticCreateEntityKey( id, persister, factory, tenantIdentifier );
}
 
Example #6
Source File: NonStrictReadWriteJ2CacheNaturalIdRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object generateCacheKey(Object[] naturalIdValues, EntityPersister persister, SharedSessionContractImplementor session) {
    return DefaultCacheKeysFactory.staticCreateNaturalIdKey(naturalIdValues, persister, session);
}
 
Example #7
Source File: NonStrictReadWriteJ2CacheNaturalIdRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object[] getNaturalIdValues(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetNaturalIdValues( cacheKey );
}
 
Example #8
Source File: ReadWriteJ2CacheEntityRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object generateCacheKey(Object id, EntityPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) {
    return DefaultCacheKeysFactory.staticCreateEntityKey(id, persister, factory, tenantIdentifier);
}
 
Example #9
Source File: ReadWriteJ2CacheEntityRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object getCacheKeyId(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetEntityId(cacheKey);
}
 
Example #10
Source File: ReadWriteJ2CacheNaturalIdRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object generateCacheKey(Object[] naturalIdValues, EntityPersister persister, SharedSessionContractImplementor session) {
    return DefaultCacheKeysFactory.staticCreateNaturalIdKey(naturalIdValues, persister, session);
}
 
Example #11
Source File: ReadWriteJ2CacheNaturalIdRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object[] getNaturalIdValues(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetNaturalIdValues(cacheKey);
}
 
Example #12
Source File: NonStrictReadWriteJ2CacheCollectionRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object generateCacheKey(Object id, CollectionPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) {
    return DefaultCacheKeysFactory.staticCreateCollectionKey( id, persister, factory, tenantIdentifier );
}
 
Example #13
Source File: NonStrictReadWriteJ2CacheCollectionRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object getCacheKeyId(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetCollectionId( cacheKey );
}
 
Example #14
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 #15
Source File: HibernateNaturalIdRegion.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public Object generateCacheKey(Object[] naturalIdValues, EntityPersister persister, SessionImplementor ses) {
    return DefaultCacheKeysFactory.staticCreateNaturalIdKey(naturalIdValues, persister, ses);
}
 
Example #16
Source File: HibernateNaturalIdRegion.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public Object[] getNaturalIdValues(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetNaturalIdValues(cacheKey);
}
 
Example #17
Source File: IgniteNaturalIdDataAccess.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public Object generateCacheKey(Object[] naturalIdValues, EntityPersister persister, SharedSessionContractImplementor ses) {
    return DefaultCacheKeysFactory.staticCreateNaturalIdKey(naturalIdValues, persister, ses);
}
 
Example #18
Source File: IgniteNaturalIdDataAccess.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override public Object[] getNaturalIdValues(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetNaturalIdValues(cacheKey);
}
 
Example #19
Source File: ReadWriteCacheConcurrencyStrategyWithLockTimeoutTest.java    From high-performance-java-persistence with Apache License 2.0 4 votes vote down vote up
private Object cacheKey(Serializable identifier, EntityPersister p) {
    return DefaultCacheKeysFactory.INSTANCE.createEntityKey(
            identifier, p, (SessionFactoryImplementor) sessionFactory(), null
    );
}
 
Example #20
Source File: MemcachedRegionFactory.java    From hibernate-l2-memcached with Apache License 2.0 4 votes vote down vote up
public MemcachedRegionFactory() {
    this(DefaultCacheKeysFactory.INSTANCE);
}
 
Example #21
Source File: TransactionalJ2CacheCollectionRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object generateCacheKey(Object id, CollectionPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) {
    return DefaultCacheKeysFactory.staticCreateCollectionKey( id, persister, factory, tenantIdentifier );
}
 
Example #22
Source File: NonstopAwareNaturalIdRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object[] getNaturalIdValues(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetNaturalIdValues(cacheKey);
}
 
Example #23
Source File: NonstopAwareCollectionRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object generateCacheKey(Object id, CollectionPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) {
    return DefaultCacheKeysFactory.staticCreateCollectionKey( id, persister, factory, tenantIdentifier );
}
 
Example #24
Source File: NonstopAwareCollectionRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object getCacheKeyId(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetCollectionId(cacheKey);
}
 
Example #25
Source File: NonstopAwareEntityRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object generateCacheKey(Object id, EntityPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) {
    return DefaultCacheKeysFactory.staticCreateEntityKey( id, persister, factory, tenantIdentifier );
}
 
Example #26
Source File: NonstopAwareEntityRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object getCacheKeyId(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetEntityId(cacheKey);
}
 
Example #27
Source File: ReadOnlyJ2CacheEntityRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object generateCacheKey(Object id, EntityPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) {
    return DefaultCacheKeysFactory.staticCreateEntityKey( id, persister, factory, tenantIdentifier );
}
 
Example #28
Source File: ReadOnlyJ2CacheEntityRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object getCacheKeyId(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetEntityId(cacheKey);
}
 
Example #29
Source File: ReadWriteJ2CacheCollectionRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object generateCacheKey(Object id, CollectionPersister persister, SessionFactoryImplementor factory, String tenantIdentifier) {
    return DefaultCacheKeysFactory.staticCreateCollectionKey( id, persister, factory, tenantIdentifier );
}
 
Example #30
Source File: ReadWriteJ2CacheCollectionRegionAccessStrategy.java    From J2Cache with Apache License 2.0 4 votes vote down vote up
@Override
public Object getCacheKeyId(Object cacheKey) {
    return DefaultCacheKeysFactory.staticGetCollectionId(cacheKey);
}