Examples of PersistentBag


Examples of org.hibernate.collection.PersistentBag

    Session session = openSession();
    session.beginTransaction();
    session.save( parent );
    session.flush();
    // at this point, the list on parent has now been replaced with a PersistentBag...
    PersistentBag children = ( PersistentBag ) parent.getChildren();

    assertFalse( children.remove( otherChild ) );
    assertFalse( children.isDirty() );

    ArrayList otherCollection = new ArrayList();
    otherCollection.add( child );
    assertFalse( children.retainAll( otherCollection ) );
    assertFalse( children.isDirty() );

    otherCollection = new ArrayList();
    otherCollection.add( otherChild );
    assertFalse( children.removeAll( otherCollection ) );
    assertFalse( children.isDirty() );

    children.clear();
    session.delete( child );
    assertTrue( children.isDirty() );

    session.flush();

    children.clear();
    assertFalse( children.isDirty() );

    session.delete( parent );
    session.getTransaction().commit();
    session.close();
  }
View Full Code Here

Examples of org.hibernate.collection.internal.PersistentBag

    super( typeScope, role, propertyRef );
  }

  public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key)
  throws HibernateException {
    return new PersistentBag(session);
  }
View Full Code Here

Examples of org.hibernate.collection.internal.PersistentBag

  public Class getReturnedClass() {
    return java.util.Collection.class;
  }

  public PersistentCollection wrap(SessionImplementor session, Object collection) {
    return new PersistentBag( session, (Collection) collection );
  }
View Full Code Here

Examples of org.hibernate.collection.internal.PersistentBag

    super( typeScope, role, propertyRef, isEmbeddedInXML );
  }

  public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key)
  throws HibernateException {
    return new PersistentBag(session);
  }
View Full Code Here

Examples of org.hibernate.collection.internal.PersistentBag

  public Class getReturnedClass() {
    return java.util.Collection.class;
  }

  public PersistentCollection wrap(SessionImplementor session, Object collection) {
    return new PersistentBag( session, (Collection) collection );
  }
View Full Code Here

Examples of org.hibernate.collection.internal.PersistentBag

      initializeData( fulltextSessionBuilder );
      FullTextSession fullTextSession = fulltextSessionBuilder.openFullTextSession();
      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 ) {
          assertTrue( "catalogItems should have been initialized", catalogItems.wasInitialized() );
View Full Code Here

Examples of org.hibernate.collection.internal.PersistentBag

  throws HibernateException {
    if ( session.getEntityMode()==EntityMode.DOM4J ) {
      return new PersistentElementHolder(session, persister, key);
    }
    else {
      return new PersistentBag(session);
    }
  }
View Full Code Here

Examples of org.hibernate.collection.internal.PersistentBag

  public PersistentCollection wrap(SessionImplementor session, Object collection) {
    if ( session.getEntityMode()==EntityMode.DOM4J ) {
      return new PersistentElementHolder( session, (Element) collection );
    }
    else {
      return new PersistentBag( session, (Collection) collection );
    }
  }
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.