Package org.hibernate.cache.spi.entry

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


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

    }

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

    if ( isCachePutEnabled( persister, session ) ) {
      final CacheEntry ce = persister.buildCacheEntry(
          instance,
          getState(),
          version,
          session
      );
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 ( 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, factory);
        if ( !cacheEntry.areLazyPropertiesUnfetched() ) {
          //note early exit here:
          return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
        }
      }
    }
View Full Code Here

    if ( session.getCacheMode().isGetEnabled() && 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

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

    CacheEntry entry = (CacheEntry) persister.getCacheEntryStructure().destructure( ce, factory );
    Object entity = convertCacheEntryToEntity( entry, event.getEntityId(), persister, event );
   
    if ( !persister.isInstance( entity ) ) {
      throw new WrongClassException(
          "loaded object was of wrong class " + entity.getClass(),
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

    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

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.