Package org.hibernate.cache.spi

Examples of org.hibernate.cache.spi.CacheKey


        new EvictVisitor( source ).process( object, persister );
      }
    }

    if ( persister.hasCache() ) {
      final CacheKey ck = source.generateCacheKey(
          id,
          persister.getIdentifierType(),
          persister.getRootEntityName()
      );
      persister.getCacheAccessStrategy().evict( ck );
View Full Code Here


    return ids; //we ran out of ids to try
  }

  private boolean isCached(EntityKey entityKey, EntityPersister persister) {
    if ( persister.hasCache() ) {
      final CacheKey key = context.getSession().generateCacheKey(
          entityKey.getIdentifier(),
          persister.getIdentifierType(),
          entityKey.getEntityName()
      );
      return CacheHelper.fromSharedCache( context.getSession(), key, persister.getCacheAccessStrategy() ) != null;
View Full Code Here

    return keys; //we ran out of keys to try
  }

  private boolean isCached(Serializable collectionKey, CollectionPersister persister) {
    if ( persister.hasCache() ) {
      CacheKey cacheKey = context.getSession().generateCacheKey(
          collectionKey,
          persister.getKeyType(),
          persister.getRole()
      );
      return CacheHelper.fromSharedCache( context.getSession(), cacheKey, persister.getCacheAccessStrategy() ) != null;
View Full Code Here

      final EntityPersister persister,
      final EntityKey keyToLoad,
      final LoadEventListener.LoadType options,
      final SessionImplementor source) {
    SoftLock lock = null;
    final CacheKey ck;
    if ( persister.hasCache() ) {
      ck = source.generateCacheKey(
          event.getEntityId(),
          persister.getIdentifierType(),
          persister.getRootEntityName()
View Full Code Here

      // we can't use cache here
      return null;
    }

    final SessionFactoryImplementor factory = source.getFactory();
    final CacheKey ck = source.generateCacheKey(
        event.getEntityId(),
        persister.getIdentifierType(),
        persister.getRootEntityName()
    );
View Full Code Here

            requestedLockMode
        );
      }

      final SoftLock lock;
      final CacheKey ck;
      if ( persister.hasCache() ) {
        ck = source.generateCacheKey( entry.getId(), persister.getIdentifierType(), persister.getRootEntityName() );
        lock = persister.getCacheAccessStrategy().lockItem( ck, entry.getVersion() );
      }
      else {
View Full Code Here

    return new EntityKey( id, persister );
  }

  @Override
  public CacheKey generateCacheKey(Serializable id, Type type, String entityOrRoleName) {
    return new CacheKey( id, type, entityOrRoleName, getTenantIdentifier(), getFactory() );
  }
View Full Code Here

    }
  }

  private void evict(Serializable id, CollectionPersister collectionPersister, EventSource session) {
    LOG.debug( "Evict CollectionRegion " + collectionPersister.getRole() + " for id " + id );
    CacheKey key = session.generateCacheKey( id, collectionPersister.getKeyType(), collectionPersister.getRole() );
    collectionPersister.getCacheAccessStrategy().evict( key );
  }
View Full Code Here

    else {
      version = null;
    }

    CollectionCacheEntry entry = new CollectionCacheEntry( lce.getCollection(), persister );
    CacheKey cacheKey = session.generateCacheKey( lce.getKey(), persister.getKeyType(), persister.getRole() );
    boolean put = persister.getCacheAccessStrategy().putFromLoad(
        cacheKey,
        persister.getCacheEntryStructure().structure(entry),
        session.getTimestamp(),
        version,
View Full Code Here

    if ( LOG.isTraceEnabled() ) {
      LOG.tracev( "Initializing lazy properties of: {0}, field access: {1}", MessageHelper.infoString( this, id, getFactory() ), fieldName );
    }

    if ( hasCache() ) {
      CacheKey cacheKey = session.generateCacheKey( id, getIdentifierType(), getEntityName() );
      Object ce = getCacheAccessStrategy().get( cacheKey, session.getTimestamp() );
      if (ce!=null) {
        CacheEntry cacheEntry = (CacheEntry) getCacheEntryStructure().destructure(ce, factory);
        if ( !cacheEntry.areLazyPropertiesUnfetched() ) {
          //note early exit here:
View Full Code Here

TOP

Related Classes of org.hibernate.cache.spi.CacheKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.