Package org.hibernate.cache.entry

Examples of org.hibernate.cache.entry.CacheEntry


      if ( persister.isCacheInvalidationRequired() || entry.getStatus()!=Status.MANAGED ) {
        persister.getCacheAccessStrategy().remove( ck );
      }
      else {
        //TODO: inefficient if that cache is just going to ignore the updated state!
        CacheEntry ce = new CacheEntry(
            state,
            persister,
            persister.hasUninitializedLazyProperties( instance, session.getEntityMode() ),
            nextVersion,
            getSession(),
View Full Code Here


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

    if ( isCachePutEnabled( persister, session ) ) {
     
      CacheEntry ce = new CacheEntry(
          state,
          persister,
          persister.hasUninitializedLazyProperties( instance, session.getEntityMode() ),
          version,
          session,
View Full Code Here

    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:
          return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
        }
      }
    }
View Full Code Here

        final Object existingValue = existingEntry != null ? existingEntry.getValue() : null;
        final Object mergingValue = mergingEntry.getValue();
        if (existingValue != null && existingValue instanceof CacheEntry
                && mergingValue != null && mergingValue instanceof CacheEntry) {

            final CacheEntry existingCacheEntry = (CacheEntry) existingValue;
            final CacheEntry mergingCacheEntry = (CacheEntry) mergingValue;
            final Object mergingVersionObject = mergingCacheEntry.getVersion();
            final Object existingVersionObject = existingCacheEntry.getVersion();
            if (mergingVersionObject != null && existingVersionObject != null
                    && mergingVersionObject instanceof Comparable && existingVersionObject instanceof Comparable) {

                final Comparable mergingVersion = (Comparable) mergingVersionObject;
View Full Code Here

            logger.warning("Cache lock could not be acquired!");
            return false;
        }
        if (versionComparator != null && currentVersion != null) {
            if (explicitVersionCheckEnabled && value instanceof CacheEntry) {
                final CacheEntry currentEntry = (CacheEntry) value;
                try {
                    if (map.tryLock(key, tryLockAndGetTimeout, TimeUnit.MILLISECONDS)) {
                        try {
                            final CacheEntry previousEntry = (CacheEntry) map.get(key);
                            if (previousEntry == null ||
                                    versionComparator.compare(currentEntry.getVersion(), previousEntry.getVersion()) > 0) {
                                map.set(key, value);
                                return true;
                            } else {
                                return false;
                            }
View Full Code Here

    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:
          return initializeLazyPropertiesFromCache( fieldName, entity, session, entry, cacheEntry );
        }
      }
    }
View Full Code Here

          );
        }
      }

      if ( ce != null ) {
        CacheEntry entry = (CacheEntry) persister.getCacheEntryStructure().destructure( ce, factory );

        // Entity was found in second-level cache...
        return assembleCacheEntry(
            entry,
            event.getEntityId(),
View Full Code Here

      if ( persister.isCacheInvalidationRequired() || entry.getStatus()!=Status.MANAGED ) {
        persister.getCacheAccessStrategy().remove( ck );
      }
      else {
        //TODO: inefficient if that cache is just going to ignore the updated state!
        CacheEntry ce = new CacheEntry(
            state,
            persister,
            persister.hasUninitializedLazyProperties( instance, session.getEntityMode() ),
            nextVersion,
            getSession(),
View Full Code Here

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

    if ( isCachePutEnabled( persister, session ) ) {
     
      CacheEntry ce = new CacheEntry(
          state,
          persister,
          persister.hasUninitializedLazyProperties( instance, session.getEntityMode() ),
          version,
          session,
View Full Code Here

            "adding entity to second-level cache: " +
            MessageHelper.infoString( persister, id, session.getFactory() )
          );

      Object version = Versioning.getVersion(hydratedState, persister);
      CacheEntry entry = new CacheEntry(
          hydratedState,
          persister,
          entityEntry.isLoadedWithLazyPropertiesUnfetched(),
          version,
          session,
View Full Code Here

TOP

Related Classes of org.hibernate.cache.entry.CacheEntry

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.