本文整理了Java中org.hibernate.event.spi.EventSource.getTenantIdentifier()
方法的一些代码示例,展示了EventSource.getTenantIdentifier()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EventSource.getTenantIdentifier()
方法的具体详情如下:
包路径:org.hibernate.event.spi.EventSource
类名称:EventSource
方法名:getTenantIdentifier
暂无
代码示例来源:origin: hibernate/hibernate-orm
private void evictCachedCollections(Type[] types, Serializable id, EventSource source)
throws HibernateException {
for ( Type type : types ) {
if ( type.isCollectionType() ) {
CollectionPersister collectionPersister = source.getFactory().getMetamodel().collectionPersister( ( (CollectionType) type ).getRole() );
if ( collectionPersister.hasCache() ) {
final CollectionDataAccess cache = collectionPersister.getCacheAccessStrategy();
final Object ck = cache.generateCacheKey(
id,
collectionPersister,
source.getFactory(),
source.getTenantIdentifier()
);
final SoftLock lock = cache.lockItem( source, ck, null );
cache.remove( source, ck );
source.getActionQueue().registerProcess( (success, session) -> cache.unlockItem( session, ck, lock ) );
}
}
else if ( type.isComponentType() ) {
CompositeType actype = (CompositeType) type;
evictCachedCollections( actype.getSubtypes(), id, source );
}
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
if ( cachingEnabled ) {
EntityDataAccess cache = persister.getCacheAccessStrategy();
ck = cache.generateCacheKey( entry.getId(), persister, source.getFactory(), source.getTenantIdentifier() );
lock = cache.lockItem( source, ck, entry.getVersion() );
代码示例来源:origin: hibernate/hibernate-orm
persister,
source.getFactory(),
source.getTenantIdentifier()
);
final SoftLock lock = cache.lockItem( source, ck, previousVersion );
代码示例来源:origin: hibernate/hibernate-search
private String tenantIdentifier(AbstractEvent event) {
EventSource session = event.getSession();
return session.getTenantIdentifier();
}
代码示例来源:origin: org.hibernate.orm/hibernate-core
@SuppressWarnings("unchecked")
private void evictCachedCollections(List<PersistentAttributeDescriptor> persistentAttributes, Object id, EventSource source)
throws HibernateException {
for ( PersistentAttributeDescriptor attribute : persistentAttributes ) {
if ( PluralPersistentAttribute.class.isInstance( attribute ) ) {
final PersistentCollectionDescriptor collectionDescriptor = ( (PluralPersistentAttribute) attribute ).getPersistentCollectionDescriptor();
if ( collectionDescriptor.hasCache() ) {
final CollectionDataAccess cache = collectionDescriptor.getCacheAccess();
final Object ck = cache.generateCacheKey(
id,
collectionDescriptor,
source.getFactory(),
source.getTenantIdentifier()
);
final SoftLock lock = cache.lockItem( source, ck, null );
source.getActionQueue().registerProcess( (success, session) -> cache.unlockItem( session, ck, lock ) );
cache.remove( source, ck );
}
}
else if ( EmbeddedValuedNavigable.class.isInstance( attribute ) ) {
EmbeddedValuedNavigable composite = (EmbeddedValuedNavigable) attribute;
evictCachedCollections( composite.getEmbeddedDescriptor().getPersistentAttributes(), id, source );
}
}
}
}
代码示例来源:origin: org.hibernate.orm/hibernate-core
entityDescriptor.getHierarchy(),
source.getFactory(),
source.getTenantIdentifier()
);
lock = entityDescriptor.getHierarchy().getEntityCacheAccess().lockItem( source, ck, entry.getVersion() );
代码示例来源:origin: org.hibernate.orm/hibernate-core
entityDescriptor.getHierarchy(),
source.getFactory(),
source.getTenantIdentifier()
);
final SoftLock lock = cacheAccess.lockItem( source, ck, previousVersion );
内容来源于网络,如有侵权,请联系作者删除!