Package org.hibernate.cache.spi

Examples of org.hibernate.cache.spi.CacheKey


          ", field access: " + 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, getFactory() );
        if ( !cacheEntry.areLazyPropertiesUnfetched() ) {
          // note early exit here:
View Full Code Here


          ", field access: " + 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, getFactory() );
        if ( !cacheEntry.areLazyPropertiesUnfetched() ) {
          // note early exit here:
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

    else {
      version = null;
    }

    final CollectionCacheEntry entry = new CollectionCacheEntry( lce.getCollection(), persister );
    final CacheKey cacheKey = session.generateCacheKey( lce.getKey(), persister.getKeyType(), persister.getRole() );

    try {
      session.getEventListenerManager().cachePutStart();
      final boolean put = persister.getCacheAccessStrategy().putFromLoad(
          cacheKey,
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

      // we have issues with generated-version entities that may have
      // multiple actions queued during the same flush
      version = persister.getVersion( instance );
    }

    final CacheKey ck;
    if ( persister.hasCache() ) {
      ck = session.generateCacheKey( id, persister.getIdentifierType(), persister.getRootEntityName() );
      lock = persister.getCacheAccessStrategy().lockItem( ck, version );
    }
    else {
View Full Code Here

  }

  @Override
  public void doAfterTransactionCompletion(boolean success, SessionImplementor session) throws HibernateException {
    if ( getPersister().hasCache() ) {
      final CacheKey ck = getSession().generateCacheKey(
          getId(),
          getPersister().getIdentifierType(),
          getPersister().getRootEntityName()
      );
      getPersister().getCacheAccessStrategy().unlockItem( ck, lock );
View Full Code Here

  public final void beforeExecutions() throws CacheException {
    // we need to obtain the lock before any actions are executed, since this may be an inverse="true"
    // bidirectional association and it is one of the earlier entity actions which actually updates
    // the database (this action is responsible for second-level cache invalidation only)
    if ( persister.hasCache() ) {
      final CacheKey ck = session.generateCacheKey(
          key,
          persister.getKeyType(),
          persister.getRole()
      );
      final SoftLock lock = persister.getCacheAccessStrategy().lockItem( ck, null );
View Full Code Here

    return session;
  }

  protected final void evict() throws CacheException {
    if ( persister.hasCache() ) {
      final CacheKey ck = session.generateCacheKey(
          key,
          persister.getKeyType(),
          persister.getRole()
      );
      persister.getCacheAccessStrategy().remove( ck );
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.