Package org.hibernate.cache

Examples of org.hibernate.cache.CacheKey


      source.getPersistenceContext().removeEntity(key);
      if ( persister.hasCollections() ) new EvictVisitor( source ).process(object, persister);
    }

    if ( persister.hasCache() ) {
      final CacheKey ck = new CacheKey(
          id,
          persister.getIdentifierType(),
          persister.getRootEntityName(),
          source.getEntityMode(),
          source.getFactory()
View Full Code Here


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

    if ( persister.hasCache() ) {
      final CacheKey ck = new CacheKey(
          id,
              persister.getIdentifierType(),
              persister.getRootEntityName(),
              this.getEntityMode(),
              this.getFactory()
View Full Code Here

            " in mode: " +
            requestedLockMode
        );

      final SoftLock lock;
      final CacheKey ck;
      if ( persister.hasCache() ) {
        ck = new CacheKey(
            entry.getId(),
            persister.getIdentifierType(),
            persister.getRootEntityName(),
            source.getEntityMode(),
            source.getFactory()
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 = new CacheKey(
          event.getEntityId(),
          persister.getIdentifierType(),
          persister.getRootEntityName(),
          source.getEntityMode(),
          source.getFactory()
View Full Code Here

    if ( useCache ) {

      final SessionFactoryImplementor factory = source.getFactory();

      final CacheKey ck = new CacheKey(
          event.getEntityId(),
          persister.getIdentifierType(),
          persister.getRootEntityName(),
          source.getEntityMode(),
          source.getFactory()
View Full Code Here

          ", field access: " + fieldName
        );
    }

    if ( hasCache() ) {
      CacheKey cacheKey = new CacheKey(id, getIdentifierType(), getEntityName(), session.getEntityMode(), getFactory() );
      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 = new CacheKey(
          id,
          getIdentifierType(),
          getRootEntityName(),
          session.getEntityMode(),
          session.getFactory()
View Full Code Here

    EntityPersister p = getEntityPersister( entityName );
    if ( p.hasCache() ) {
      if ( log.isDebugEnabled() ) {
        log.debug( "evicting second-level cache: " + MessageHelper.infoString(p, id, this) );
      }
      CacheKey cacheKey = new CacheKey( id, p.getIdentifierType(), p.getRootEntityName(), EntityMode.POJO, this );
      p.getCacheAccessStrategy().evict( cacheKey );
    }
  }
View Full Code Here

    EntityPersister p = getEntityPersister( persistentClass.getName() );
    if ( p.hasCache() ) {
      if ( log.isDebugEnabled() ) {
        log.debug( "evicting second-level cache: " + MessageHelper.infoString(p, id, this) );
      }
      CacheKey cacheKey = new CacheKey( id, p.getIdentifierType(), p.getRootEntityName(), EntityMode.POJO, this );
      p.getCacheAccessStrategy().evict( cacheKey );
    }
  }
View Full Code Here

    CollectionPersister p = getCollectionPersister( roleName );
    if ( p.hasCache() ) {
      if ( log.isDebugEnabled() ) {
        log.debug( "evicting second-level cache: " + MessageHelper.collectionInfoString(p, id, this) );
      }
      CacheKey cacheKey = new CacheKey( id, p.getKeyType(), p.getRole(), EntityMode.POJO, this );
      p.getCacheAccessStrategy().evict( cacheKey );
    }
  }
View Full Code Here

TOP

Related Classes of org.hibernate.cache.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.