Package org.hibernate.cache.spi

Examples of org.hibernate.cache.spi.NaturalIdCacheKey


    }

    if ( persister.hasNaturalIdCache() ) {
      final NaturalIdRegionAccessStrategy naturalIdCacheAccessStrategy = persister
          .getNaturalIdCacheAccessStrategy();
      final NaturalIdCacheKey naturalIdCacheKey = new NaturalIdCacheKey( naturalIdValues, persister, session() );
      naturalIdCacheAccessStrategy.evict( naturalIdCacheKey );

      if ( sessionCachedNaturalIdValues != null
          && !Arrays.equals( sessionCachedNaturalIdValues, naturalIdValues ) ) {
        final NaturalIdCacheKey sessionNaturalIdCacheKey = new NaturalIdCacheKey( sessionCachedNaturalIdValues, persister, session() );
        naturalIdCacheAccessStrategy.evict( sessionNaturalIdCacheKey );
      }
    }

    return sessionCachedNaturalIdValues;
View Full Code Here


    if ( !persister.hasNaturalIdCache() ) {
      return null;
    }

    // Try resolution from second-level cache
    final NaturalIdCacheKey naturalIdCacheKey = new NaturalIdCacheKey( naturalIdValues, persister, session() );

    final NaturalIdRegionAccessStrategy naturalIdCacheAccessStrategy = persister.getNaturalIdCacheAccessStrategy();
    pk = CacheHelper.fromSharedCache( session(), naturalIdCacheKey, naturalIdCacheAccessStrategy );

    // Found in second-level cache, store in session cache
View Full Code Here

    }

    if ( persister.hasNaturalIdCache() ) {
      final NaturalIdRegionAccessStrategy naturalIdCacheAccessStrategy = persister
          .getNaturalIdCacheAccessStrategy();
      final NaturalIdCacheKey naturalIdCacheKey = new NaturalIdCacheKey( naturalIdValues, persister, session() );
      naturalIdCacheAccessStrategy.evict( naturalIdCacheKey );

      if ( sessionCachedNaturalIdValues != null
          && !Arrays.equals( sessionCachedNaturalIdValues, naturalIdValues ) ) {
        final NaturalIdCacheKey sessionNaturalIdCacheKey = new NaturalIdCacheKey( sessionCachedNaturalIdValues, persister, session() );
        naturalIdCacheAccessStrategy.evict( sessionNaturalIdCacheKey );
      }
    }

    return sessionCachedNaturalIdValues;
View Full Code Here

    if ( !persister.hasNaturalIdCache() ) {
      return null;
    }

    // Try resolution from second-level cache
    final NaturalIdCacheKey naturalIdCacheKey = new NaturalIdCacheKey( naturalIdValues, persister, session() );

    final NaturalIdRegionAccessStrategy naturalIdCacheAccessStrategy = persister.getNaturalIdCacheAccessStrategy();
    pk = CacheHelper.fromSharedCache( session(), naturalIdCacheKey, naturalIdCacheAccessStrategy );

    // Found in second-level cache, store in session cache
View Full Code Here

    if ( !persister.hasNaturalIdCache() ) {
      return null;
    }
   
    // Try resolution from second-level cache
    final NaturalIdCacheKey naturalIdCacheKey = new NaturalIdCacheKey( naturalIdValues, persister, session );
   
    final NaturalIdRegionAccessStrategy naturalIdCacheAccessStrategy = persister.getNaturalIdCacheAccessStrategy();
    pk = (Serializable) naturalIdCacheAccessStrategy.get( naturalIdCacheKey, session.getTimestamp() );

    // Found in second-level cache, store in session cache
View Full Code Here

    entityNaturalIdResolutionCache.naturalIdToPkMap.put( localNaturalIdCacheKey, pk );

    //If second-level caching is enabled cache the resolution there as well
    if ( persister.hasNaturalIdCache() ) {
      final NaturalIdRegionAccessStrategy naturalIdCacheAccessStrategy = persister.getNaturalIdCacheAccessStrategy();
      final NaturalIdCacheKey naturalIdCacheKey = new NaturalIdCacheKey( naturalIdValues, persister, session );

      final SessionFactoryImplementor factory = getSession().getFactory();
     
      switch ( valueSource ) {
        case LOAD: {
View Full Code Here

      entityNaturalIdResolutionCache.naturalIdToPkMap.remove( localNaturalIdCacheKey );
    }

    if ( persister.hasNaturalIdCache() ) {
      final NaturalIdRegionAccessStrategy naturalIdCacheAccessStrategy = persister.getNaturalIdCacheAccessStrategy();
      final NaturalIdCacheKey naturalIdCacheKey = new NaturalIdCacheKey( naturalIdValues, persister, session );
      naturalIdCacheAccessStrategy.evict( naturalIdCacheKey );
    }
  }
View Full Code Here

    }

    if ( persister.hasNaturalIdCache() ) {
      final NaturalIdRegionAccessStrategy naturalIdCacheAccessStrategy = persister
          .getNaturalIdCacheAccessStrategy();
      final NaturalIdCacheKey naturalIdCacheKey = new NaturalIdCacheKey( naturalIdValues, persister, session() );
      naturalIdCacheAccessStrategy.evict( naturalIdCacheKey );

      if ( sessionCachedNaturalIdValues != null
          && !Arrays.equals( sessionCachedNaturalIdValues, naturalIdValues ) ) {
        final NaturalIdCacheKey sessionNaturalIdCacheKey = new NaturalIdCacheKey( sessionCachedNaturalIdValues, persister, session() );
        naturalIdCacheAccessStrategy.evict( sessionNaturalIdCacheKey );
      }
    }

    return sessionCachedNaturalIdValues;
View Full Code Here

    if ( !persister.hasNaturalIdCache() ) {
      return null;
    }

    // Try resolution from second-level cache
    final NaturalIdCacheKey naturalIdCacheKey = new NaturalIdCacheKey( naturalIdValues, persister, session() );

    final NaturalIdRegionAccessStrategy naturalIdCacheAccessStrategy = persister.getNaturalIdCacheAccessStrategy();
    pk = (Serializable) naturalIdCacheAccessStrategy.get( naturalIdCacheKey, session().getTimestamp() );

    // Found in second-level cache, store in session cache
View Full Code Here

    //    NOTE : the checks using 'justAddedToLocalCache' below protect only the stat journaling, not actually
    //    putting into the shared cache.  we still put into the shared cache because that might have locking
    //    semantics that we need to honor.
    if ( persister.hasNaturalIdCache() ) {
      final NaturalIdRegionAccessStrategy naturalIdCacheAccessStrategy = persister.getNaturalIdCacheAccessStrategy();
      final NaturalIdCacheKey naturalIdCacheKey = new NaturalIdCacheKey( naturalIdValues, persister, session() );

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

      switch ( valueSource ) {
        case LOAD: {
View Full Code Here

TOP

Related Classes of org.hibernate.cache.spi.NaturalIdCacheKey

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.