Package org.hibernate.collection.spi

Examples of org.hibernate.collection.spi.PersistentCollection.wasInitialized()


        throws IOException, JsonProcessingException
    {
        if (value instanceof PersistentCollection) {
            PersistentCollection coll = (PersistentCollection) value;
            // If lazy-loaded, not yet loaded, may serialize as null?
            if (!_forceLazyLoading && !coll.wasInitialized()) {
                provider.defaultSerializeNull(jgen);
                return;
            }
            value = coll.getValue();
            if (value == null) {
View Full Code Here


            TypeSerializer typeSer)
        throws IOException, JsonProcessingException
    {
        if (value instanceof PersistentCollection) {
            PersistentCollection coll = (PersistentCollection) value;
            if (!_forceLazyLoading && !coll.wasInitialized()) {
                provider.defaultSerializeNull(jgen);
                return;
            }
            value = coll.getValue();
            if (value == null) {
View Full Code Here

    PersistentCollection collection = event.getCollection();
    SessionImplementor source = event.getSession();

    CollectionEntry ce = source.getPersistenceContext().getCollectionEntry(collection);
    if (ce==null) throw new HibernateException("collection was evicted");
    if ( !collection.wasInitialized() ) {
      if ( LOG.isTraceEnabled() ) {
        LOG.tracev( "Initializing collection {0}",
            MessageHelper.collectionInfoString( ce.getLoadedPersister(), collection, ce.getLoadedKey(), source ) );
      }
View Full Code Here

    final PersistentCollection collection = getCollection();
    final boolean affectedByFilters = persister.isAffectedByEnabledFilters( session );

    preUpdate();

    if ( !collection.wasInitialized() ) {
      if ( !collection.hasQueuedOperations() ) {
        throw new AssertionFailure( "no queued adds" );
      }
      //do nothing - we only need to notify the cache...
    }
View Full Code Here

          // though we clear the queue on flush, it seems like a good idea to guard
          // against potentially null loadedKeys (which leads to various NPEs as demonstrated in HHH-7821).
          continue;
        }

        if ( collection.wasInitialized() ) {
          // should never happen
          LOG.warn( "Encountered initialized collection in BatchFetchQueue, this should not happen." );
          continue;
        }
View Full Code Here

    PersistentCollection collection = event.getCollection();
    SessionImplementor source = event.getSession();

    CollectionEntry ce = source.getPersistenceContext().getCollectionEntry(collection);
    if (ce==null) throw new HibernateException("collection was evicted");
    if ( !collection.wasInitialized() ) {
      final boolean traceEnabled = LOG.isTraceEnabled();
      if ( traceEnabled ) {
        LOG.tracev( "Initializing collection {0}",
            MessageHelper.collectionInfoString( ce.getLoadedPersister(), collection, ce.getLoadedKey(), source ) );
        LOG.trace( "Checking second-level cache" );
View Full Code Here

    for ( Map.Entry<PersistentCollection,CollectionEntry> me :
      IdentityMap.concurrentEntries( (Map<PersistentCollection,CollectionEntry>) context.getCollectionEntries() )) {

      CollectionEntry ce = me.getValue();
      PersistentCollection collection = me.getKey();
      if ( !collection.wasInitialized() && ce.getLoadedPersister() == collectionPersister ) {

        if ( checkForEnd && i == end ) {
          return keys; //the first key found after the given key
        }
View Full Code Here

    final LoadingCollectionEntry loadingCollectionEntry = loadContexts.locateLoadingCollectionEntry( collectionKey );
    if ( loadingCollectionEntry == null ) {
      // look for existing collection as part of the persistence context
      PersistentCollection collection = loadContexts.getPersistenceContext().getCollection( collectionKey );
      if ( collection != null ) {
        if ( collection.wasInitialized() ) {
          LOG.trace( "Collection already initialized; ignoring" );
          return null; // ignore this row of results! Note the early exit
        }
        LOG.trace( "Collection not yet initialized; initializing" );
      }
View Full Code Here

    final PersistentCollection collection = getCollection();
    boolean affectedByFilters = persister.isAffectedByEnabledFilters(session);

    preUpdate();

    if ( !collection.wasInitialized() ) {
      if ( !collection.hasQueuedOperations() ) throw new AssertionFailure( "no queued adds" );
      //do nothing - we only need to notify the cache...
    }
    else if ( !affectedByFilters && collection.empty() ) {
      if ( !emptySnapshot ) persister.remove( id, session );
View Full Code Here

    while ( iter.hasNext() ) {
      Map.Entry me = (Map.Entry) iter.next();

      CollectionEntry ce = (CollectionEntry) me.getValue();
      PersistentCollection collection = (PersistentCollection) me.getKey();
      if ( !collection.wasInitialized() && ce.getLoadedPersister() == collectionPersister ) {

        if ( checkForEnd && i == end ) {
          return keys; //the first key found after the given key
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.