Package org.hibernate.cache.spi

Examples of org.hibernate.cache.spi.CacheKey


      return result;
    }

    // check to see if it is in the second-level cache
    if ( hasCache() ) {
      CacheKey ck = session.generateCacheKey( id, getIdentifierType(), getRootEntityName() );
      if ( getCacheAccessStrategy().get( ck, session.getTimestamp() ) != 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

      // we have issues with generated-version entities that may have
      // multiple actions queued during the same flush
      previousVersion = persister.getVersion( instance );
    }
   
    final CacheKey ck;
    if ( persister.hasCache() ) {
      ck = session.generateCacheKey(
          id,
          persister.getIdentifierType(),
          persister.getRootEntityName()
View Full Code Here

  @Override
  public void doAfterTransactionCompletion(boolean success, SessionImplementor session) throws CacheException {
    EntityPersister persister = getPersister();
    if ( persister.hasCache() ) {
     
      final CacheKey ck = getSession().generateCacheKey(
          getId(),
          persister.getIdentifierType(),
          persister.getRootEntityName()
        );
     
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

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

          session,
          instance
        );
     
      cacheEntry = persister.getCacheEntryStructure().structure(ce);
      final CacheKey ck = session.generateCacheKey( id, persister.getIdentifierType(), persister.getRootEntityName() );
      boolean put = persister.getCacheAccessStrategy().insert( ck, cacheEntry, version );
     
      if ( put && factory.getStatistics().isStatisticsEnabled() ) {
        factory.getStatisticsImplementor().secondLevelCachePut( getPersister().getCacheAccessStrategy().getRegion().getName() );
      }
View Full Code Here

  @Override
  public void doAfterTransactionCompletion(boolean success, SessionImplementor session) throws HibernateException {
    EntityPersister persister = getPersister();
    if ( success && isCachePutEnabled( persister, getSession() ) ) {
      final CacheKey ck = getSession().generateCacheKey( getId(), persister.getIdentifierType(), persister.getRootEntityName() );
      boolean put = persister.getCacheAccessStrategy().afterInsert( ck, cacheEntry, version );
     
      if ( put && getSession().getFactory().getStatistics().isStatisticsEnabled() ) {
        getSession().getFactory().getStatisticsImplementor()
            .secondLevelCachePut( getPersister().getCacheAccessStrategy().getRegion().getName() );
View Full Code Here

        if (!useCache) return false;

        final SessionFactoryImplementor factory = source.getFactory();

        final CacheKey ck = source.generateCacheKey( id, persister.getKeyType(), persister.getRole() );
        Object ce = persister.getCacheAccessStrategy().get(ck, source.getTimestamp());

    if ( factory.getStatistics().isStatisticsEnabled() ) {
            if (ce == null) {
                factory.getStatisticsImplementor()
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.