Package org.hibernate.cache.spi

Examples of org.hibernate.cache.spi.CacheKey


    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


//          MessageHelper.infoString( persister, id, source.getFactory() )
//      );
//    }

    if ( persister.hasCache() ) {
      final CacheKey ck = generateCacheKey( id, persister.getIdentifierType(), persister.getRootEntityName() );
      persister.getCacheAccessStrategy().evict( ck );
    }

    String previousFetchProfile = this.getFetchProfile();
    Object result = null;
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

      return result;
    }

    // check to see if it is in the second-level cache
    if ( hasCache() ) {
      CacheKey ck = session.generateCacheKey( id, getIdentifierType(), getRootEntityName() );
      if ( getCacheAccessStrategy().get( ck, session.getTimestamp() ) != null ) {
        return Boolean.FALSE;
      }
    }
View Full Code Here

        p.getCacheAccessStrategy().evict( buildCacheKey( identifier, p ) );
      }
    }

    private CacheKey buildCacheKey(Serializable identifier, EntityPersister p) {
      return new CacheKey(
          identifier,
          p.getIdentifierType(),
          p.getRootEntityName(),
          null,             // have to assume non tenancy
          SessionFactoryImpl.this
View Full Code Here

      if ( p.hasCache() ) {
        if ( LOG.isDebugEnabled() ) {
          LOG.debugf( "Evicting second-level cache: %s",
              MessageHelper.collectionInfoString( p, ownerIdentifier, SessionFactoryImpl.this ) );
        }
        CacheKey cacheKey = buildCacheKey( ownerIdentifier, p );
        p.getCacheAccessStrategy().evict( cacheKey );
      }
    }
View Full Code Here

        p.getCacheAccessStrategy().evict( cacheKey );
      }
    }

    private CacheKey buildCacheKey(Serializable ownerIdentifier, CollectionPersister p) {
      return new CacheKey(
          ownerIdentifier,
          p.getKeyType(),
          p.getRole(),
          null,            // have to assume non tenancy
          SessionFactoryImpl.this
View Full Code Here

    return new EntityKey( id, persister, getTenantIdentifier() );
  }

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

          entityEntry.isLoadedWithLazyPropertiesUnfetched(),
          version,
          session,
          entity
      );
      CacheKey cacheKey = session.generateCacheKey( id, persister.getIdentifierType(), persister.getRootEntityName() );

      // explicit handling of caching for rows just inserted and then somehow forced to be read
      // from the database *within the same transaction*.  usually this is done by
      //     1) Session#refresh, or
      //     2) Session#clear + some form of load
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

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.