Package org.hibernate.cache.spi

Examples of org.hibernate.cache.spi.CacheKey


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

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

    if ( hasCache() ) {
      final CacheKey cacheKey = session.generateCacheKey( id, getIdentifierType(), getEntityName() );
      final Object ce = CacheHelper.fromSharedCache( session, cacheKey, getCacheAccessStrategy() );
      if ( ce != null ) {
        final 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() ) {
      final CacheKey ck = session.generateCacheKey( id, getIdentifierType(), getRootEntityName() );
      final Object ce = CacheHelper.fromSharedCache( session, ck, getCacheAccessStrategy() );
      if ( ce != null ) {
        return Boolean.FALSE;
      }
    }
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

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.