Package org.hibernate.cache.spi.entry

Examples of org.hibernate.cache.spi.entry.CacheEntry


    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, getFactory() );
        if ( !cacheEntry.areLazyPropertiesUnfetched() ) {
          // note early exit here:
          return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
        }
      }
    }
View Full Code Here


    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, getFactory() );
        if ( !cacheEntry.areLazyPropertiesUnfetched() ) {
          // note early exit here:
          return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
        }
      }
    }
View Full Code Here

              key.getEntityName()
          ),
          persister.getCacheAccessStrategy()
      );
      if ( cachedEntry != null ) {
        CacheEntry entry = (CacheEntry) persister.getCacheEntryStructure().destructure( cachedEntry, factory );
        return ( (ReferenceCacheEntryImpl) entry ).getReference();
      }
    }

    final Object object;
View Full Code Here

    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:
          return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
        }
      }
    }
View Full Code Here

    }

    final SessionFactoryImplementor factory = getSession().getFactory();

    if ( isCachePutEnabled( persister, session ) ) {
      final CacheEntry ce = persister.buildCacheEntry(
          instance,
          getState(),
          version,
          session
      );
View Full Code Here

      if ( persister.isCacheInvalidationRequired() || entry.getStatus()!= Status.MANAGED ) {
        persister.getCacheAccessStrategy().remove( ck );
      }
      else {
        //TODO: inefficient if that cache is just going to ignore the updated state!
        final CacheEntry ce = persister.buildCacheEntry( instance,state, nextVersion, getSession() );
        cacheEntry = persister.getCacheEntryStructure().structure( ce );

        final boolean put = cacheUpdate( persister, previousVersion, ck );
        if ( put && factory.getStatistics().isStatisticsEnabled() ) {
          factory.getStatisticsImplementor().secondLevelCachePut( getPersister().getCacheAccessStrategy().getRegion().getName() );
View Full Code Here

            MessageHelper.infoString( persister, id, session.getFactory() )
        );
      }

      final Object version = Versioning.getVersion( hydratedState, persister );
      final CacheEntry entry = persister.buildCacheEntry( entity, hydratedState, version, session );
      final 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
View Full Code Here

    if ( ce == null ) {
      // nothing was found in cache
      return null;
    }

    CacheEntry entry = (CacheEntry) persister.getCacheEntryStructure().destructure( ce, factory );
    return convertCacheEntryToEntity( entry, event.getEntityId(), persister, event );
  }
View Full Code Here

    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:
          return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
        }
      }
    }
View Full Code Here

      if ( persister.isCacheInvalidationRequired() || entry.getStatus()!= Status.MANAGED ) {
        persister.getCacheAccessStrategy().remove( ck );
      }
      else {
        //TODO: inefficient if that cache is just going to ignore the updated state!
        CacheEntry ce = new CacheEntry(
            state,
            persister,
            persister.hasUninitializedLazyProperties( instance ),
            nextVersion,
            getSession(),
View Full Code Here

TOP

Related Classes of org.hibernate.cache.spi.entry.CacheEntry

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.