Examples of wasInitialized()


Examples of org.hibernate.collection.PersistentBag.wasInitialized()

            return arrayList;
        }
        if (instance instanceof PersistentBag) {
            ArrayList<Object> arrayList = new ArrayList<Object>();
            PersistentBag persBag = (PersistentBag) instance;
            if (persBag.wasInitialized()) {
                arrayList.addAll(persBag);
            }
            return arrayList;
        }
        if (instance instanceof PersistentMap) {
View Full Code Here

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

    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
        }
        else {
          // initialize this collection
View Full Code Here

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

    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

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

    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.trace(
            "initializing collection " +
            MessageHelper.collectionInfoString( ce.getLoadedPersister(), ce.getLoadedKey(), source.getFactory() )
          );
View Full Code Here

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

    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

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

      removeCollection( persister, extractCollectionKeyFromOwner( persister ), session );
    }
    if ( collection != null && ( collection instanceof PersistentCollection ) ) {
      PersistentCollection wrapper = ( PersistentCollection ) collection;
      wrapper.setCurrentSession( session );
      if ( wrapper.wasInitialized() ) {
        session.getPersistenceContext().addNewCollection( persister, wrapper );
      }
      else {
        reattachCollection( wrapper, type );
      }
View Full Code Here

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

    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
        }
        else {
          // initialize this collection
View Full Code Here

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

    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

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

    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.trace(
            "initializing collection " +
            MessageHelper.collectionInfoString( ce.getLoadedPersister(), ce.getLoadedKey(), source.getFactory() )
          );
View Full Code Here

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

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