Examples of wasInitialized()


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()

      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 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.PersistentList.wasInitialized()

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

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

            return arrayList;
        }
        if (instance instanceof PersistentMap) {
            HashMap<Object, Object> hashMap = new HashMap<Object, Object>();
            PersistentMap persMap = (PersistentMap) instance;
            if (persMap.wasInitialized()) {
                hashMap.putAll(persMap);
            }
            return hashMap;
        }
        if (instance.getClass().getName().contains("CGLIB")) {
View Full Code Here

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

        }

        if (instance instanceof PersistentSet) {
            HashSet<Object> hashSet = new HashSet<Object>();
            PersistentSet persSet = (PersistentSet) instance;
            if (persSet.wasInitialized()) {
                hashSet.addAll(persSet);
            }
            return hashSet;
        }
        if (instance instanceof PersistentList) {
View Full Code Here

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

      try {
        Catalog catalog = (Catalog) fullTextSession.get( Catalog.class, 1L );
        PersistentSet catalogItems = (PersistentSet) catalog.getCatalogItems();
        PersistentBag consumers = (PersistentBag) catalog.getConsumers();

        assertFalse( "consumers should not be initialized", consumers.wasInitialized() );
        assertFalse( "catalogItems should not be initialized", consumers.wasInitialized() );

        updateCatalogsCollection( fullTextSession, catalog );

        if ( ( withClassBridgeOnItem || withClassBridgeOnCatalog ) && depth > 1 ) {
View Full Code Here

Examples of org.hibernate.collection.internal.PersistentSet.wasInitialized()

        assertFalse( "catalogItems should not be initialized", consumers.wasInitialized() );

        updateCatalogsCollection( fullTextSession, catalog );

        if ( ( withClassBridgeOnItem || withClassBridgeOnCatalog ) && depth > 1 ) {
          assertTrue( "catalogItems should have been initialized", catalogItems.wasInitialized() );
        }
        else {
          assertFalse( "catalogItems should not be initialized", catalogItems.wasInitialized() );
        }
      }
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.