Package org.hibernate.cache.entry

Examples of org.hibernate.cache.entry.CollectionCacheEntry


    }
    else {
      version = null;
    }

    CollectionCacheEntry entry = new CollectionCacheEntry( lce.getCollection(), persister );
    CacheKey cacheKey = new CacheKey(
        lce.getKey(),
        persister.getKeyType(),
        persister.getRole(),
        session.getEntityMode(),
View Full Code Here


      if (ce==null) {
        return false;
      }
      else {

        CollectionCacheEntry cacheEntry = (CollectionCacheEntry) persister.getCacheEntryStructure()
            .destructure(ce, factory);
     
        final PersistenceContext persistenceContext = source.getPersistenceContext();
        cacheEntry.assemble(
            collection,
            persister, 
            persistenceContext.getCollectionOwner(id, persister)
          );
        persistenceContext.getCollectionEntry(collection).postInitialize(collection);
View Full Code Here

    }
    else {
      version = null;
    }

    CollectionCacheEntry entry = new CollectionCacheEntry( lce.getCollection(), persister );
    CacheKey cacheKey = new CacheKey(
        lce.getKey(),
        persister.getKeyType(),
        persister.getRole(),
        session.getEntityMode(),
View Full Code Here

      if (ce==null) {
        return false;
      }
      else {

        CollectionCacheEntry cacheEntry = (CollectionCacheEntry) persister.getCacheEntryStructure()
            .destructure(ce, factory);
     
        final PersistenceContext persistenceContext = source.getPersistenceContext();
        cacheEntry.assemble(
            collection,
            persister, 
            persistenceContext.getCollectionOwner(id, persister)
          );
        persistenceContext.getCollectionEntry(collection).postInitialize(collection);
View Full Code Here

      if (ce==null) {
        return false;
      }
      else {

        CollectionCacheEntry cacheEntry = (CollectionCacheEntry) persister.getCacheEntryStructure()
            .destructure(ce, factory);
     
        final PersistenceContext persistenceContext = source.getPersistenceContext();
        cacheEntry.assemble(
            collection,
            persister, 
            persistenceContext.getCollectionOwner(id, persister)
          );
        persistenceContext.getCollectionEntry(collection).postInitialize(collection);
View Full Code Here

    else {
      version = null;
      versionComparator = null;
    }

    CollectionCacheEntry entry = new CollectionCacheEntry( lce.getCollection(), persister );
    CacheKey cacheKey = new CacheKey(
        lce.getKey(),
        persister.getKeyType(),
        persister.getRole(),
        session.getEntityMode(),
View Full Code Here

    }
    else {
      version = null;
    }

    CollectionCacheEntry entry = new CollectionCacheEntry( lce.getCollection(), persister );
    CacheKey cacheKey = new CacheKey(
        lce.getKey(),
        persister.getKeyType(),
        persister.getRole(),
        session.getEntityMode(),
View Full Code Here

      if (ce==null) {
        return false;
      }
      else {

        CollectionCacheEntry cacheEntry = (CollectionCacheEntry) persister.getCacheEntryStructure()
            .destructure(ce, factory);
     
        final PersistenceContext persistenceContext = source.getPersistenceContext();
        cacheEntry.assemble(
            collection,
            persister, 
            persistenceContext.getCollectionOwner(id, persister)
          );
        persistenceContext.getCollectionEntry(collection).postInitialize(collection);
View Full Code Here

    }
    else {
      version = null;
    }

    CollectionCacheEntry entry = new CollectionCacheEntry( lce.getCollection(), persister );
    CacheKey cacheKey = new CacheKey(
        lce.getKey(),
        persister.getKeyType(),
        persister.getRole(),
        session.getEntityMode(),
View Full Code Here

    Salesperson sp = ( Salesperson ) session.load( Salesperson.class, testData.steveId );
    Hibernate.initialize( sp.getOrders() );
    CollectionPersister persister = ( ( SessionFactoryImpl ) getSessions() )
            .getCollectionPersister( Salesperson.class.getName() + ".orders" );
    assertTrue( "No cache for collection", persister.hasCache() );
    CollectionCacheEntry cachedData = ( CollectionCacheEntry ) persister.getCache().getCache()
            .read( new CacheKey( testData.steveId, persister.getKeyType(), persister.getRole(), EntityMode.POJO, sfi() ) );
    assertNotNull( "collection was not in cache", cachedData );

    session.close();

    session = openSession();
    ts = ( ( SessionImplementor ) session ).getTimestamp();
    session.enableFilter( "fulfilledOrders" ).setParameter( "asOfDate", testData.lastMonth.getTime() );
    sp = ( Salesperson ) session.createQuery( "from Salesperson as s where s.id = :id" )
            .setLong( "id", testData.steveId.longValue() )
            .uniqueResult();
    assertEquals( "Filtered-collection not bypassing 2L-cache", 1, sp.getOrders().size() );

    CollectionCacheEntry cachedData2 = ( CollectionCacheEntry ) persister.getCache().getCache()
            .read( new CacheKey( testData.steveId, persister.getKeyType(), persister.getRole(), EntityMode.POJO, sfi() ) );
    assertNotNull( "collection no longer in cache!", cachedData2 );
    assertSame( "Different cache values!", cachedData, cachedData2 );

    session.close();
View Full Code Here

TOP

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

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.