private void evictCachedCollections(EntityPersister persister, Serializable id, EventSource source) { evictCachedCollections( persister.getPropertyTypes(), id, source ); }
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 ); } } } }
evictCachedCollections( persister, id, source );
private void evictCachedCollections(EntityTypeDescriptor entityDescriptor, Object id, EventSource source) { evictCachedCollections( entityDescriptor.getPersistentAttributes(), id, source ); }
private void evictCachedCollections(EntityPersister persister, Serializable id, SessionFactoryImplementor factory) { evictCachedCollections( persister.getPropertyTypes(), id, factory ); }
private void evictCachedCollections(EntityPersister persister, Serializable id, SessionFactoryImplementor factory) { evictCachedCollections( persister.getPropertyTypes(), id, factory ); }
private void evictCachedCollections(Type[] types, Serializable id, SessionFactoryImplementor factory) throws HibernateException { for ( Type type : types ) { if ( type.isCollectionType() ) { factory.getCache().evictCollection( ( (CollectionType) type ).getRole(), id ); } else if ( type.isComponentType() ) { CompositeType actype = (CompositeType) type; evictCachedCollections( actype.getSubtypes(), id, factory ); } } } }
private void evictCachedCollections(Type[] types, Serializable id, SessionFactoryImplementor factory) throws HibernateException { for ( Type type : types ) { if ( type.isCollectionType() ) { factory.getCache().evictCollection( ( (CollectionType) type ).getRole(), id ); } else if ( type.isComponentType() ) { CompositeType actype = (CompositeType) type; evictCachedCollections( actype.getSubtypes(), id, factory ); } } } }
@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 ); } } } }
evictCachedCollections( persister, id, source.getFactory() );
evictCachedCollections( persister, id, source.getFactory() );
evictCachedCollections( entityDescriptor, id, source );