Package org.hibernate.cache.spi

Examples of org.hibernate.cache.spi.CacheKey


    return new EntityKey( id, persister );
  }

  @Override
  public CacheKey generateCacheKey(Serializable id, Type type, String entityOrRoleName) {
    return new CacheKey( id, type, entityOrRoleName, getTenantIdentifier(), getFactory() );
  }
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

        );
      }

      Object version = Versioning.getVersion(hydratedState, persister);
      CacheEntry entry = persister.buildCacheEntry( entity, hydratedState, version, session );
      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
      //     2) Session#clear + some form of load
View Full Code Here

        source.getCacheMode().isGetEnabled();

        if (!useCache) return false;

        final SessionFactoryImplementor factory = source.getFactory();
        final CacheKey ck = source.generateCacheKey( id, persister.getKeyType(), persister.getRole() );
    final Object ce = CacheHelper.fromSharedCache( source, ck, persister.getCacheAccessStrategy() );

    if ( factory.getStatistics().isStatisticsEnabled() ) {
      if (ce == null) {
        factory.getStatisticsImplementor()
View Full Code Here

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

    if ( persister.hasCache() ) {
      final CacheKey ck = source.generateCacheKey(
          id,
          persister.getIdentifierType(),
          persister.getRootEntityName()
      );
      persister.getCacheAccessStrategy().evict( ck );
View Full Code Here

      if ( LOG.isTraceEnabled() ) {
        LOG.tracev( "Locking {0} in mode: {1}", MessageHelper.infoString( persister, entry.getId(), source.getFactory() ), requestedLockMode );
      }

      final SoftLock lock;
      final CacheKey ck;
      if ( persister.hasCache() ) {
        ck = source.generateCacheKey( entry.getId(), persister.getIdentifierType(), persister.getRootEntityName() );
        lock = persister.getCacheAccessStrategy().lockItem( ck, entry.getVersion() );
      }
      else {
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

      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
        sessionFactory
View Full Code Here

        LOG.debugf(
            "Evicting second-level cache: %s",
            MessageHelper.collectionInfoString( p, ownerIdentifier, sessionFactory )
        );
      }
      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
        sessionFactory
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.