org.hibernate.event.spi.EventSource.getTenantIdentifier()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中org.hibernate.event.spi.EventSource.getTenantIdentifier()方法的一些代码示例,展示了EventSource.getTenantIdentifier()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EventSource.getTenantIdentifier()方法的具体详情如下:
包路径:org.hibernate.event.spi.EventSource
类名称:EventSource
方法名:getTenantIdentifier

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 );

相关文章