Examples of PersistentMap


Examples of org.hibernate.collection.PersistentMap

  public PersistentCollection wrap(SessionImplementor session, Object collection) {
    if ( session.getEntityMode()==EntityMode.DOM4J ) {
      return new PersistentMapElementHolder( session, (Element) collection );
    }
    else {
      return new PersistentMap( session, (java.util.Map) collection );
    }
  }
View Full Code Here

Examples of org.hibernate.collection.PersistentMap

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

    Object old = children.put( child.getName(), child );
    assertTrue( old == child );
    assertFalse( children.isDirty() );

    old = children.remove( otherChild.getName() );
    assertNull( old );
    assertFalse( children.isDirty() );

    HashMap otherMap = new HashMap();
    otherMap.put( child.getName(), child );
    children.putAll( otherMap );
    assertFalse( children.isDirty() );

    otherMap = new HashMap();
    otherMap.put( otherChild.getName(), otherChild );
    children.putAll( otherMap );
    assertTrue( children.isDirty() );

    children.clearDirty();
    session.delete( child );
    children.clear();
    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.PersistentMap

  public MapType(TypeFactory.TypeScope typeScope, String role, String propertyRef) {
    super( typeScope, role, propertyRef );
  }

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

Examples of org.hibernate.collection.internal.PersistentMap

  public Iterator getElementsIterator(Object collection) {
    return ( (java.util.Map) collection ).values().iterator();
  }

  public PersistentCollection wrap(SessionImplementor session, Object collection) {
    return new PersistentMap( session, (java.util.Map) collection );
  }
View Full Code Here

Examples of org.hibernate.collection.internal.PersistentMap

  public MapType(TypeFactory.TypeScope typeScope, String role, String propertyRef, boolean isEmbeddedInXML) {
    super( typeScope, role, propertyRef, isEmbeddedInXML );
  }

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

Examples of org.hibernate.collection.internal.PersistentMap

  public Iterator getElementsIterator(Object collection) {
    return ( (java.util.Map) collection ).values().iterator();
  }

  public PersistentCollection wrap(SessionImplementor session, Object collection) {
    return new PersistentMap( session, (java.util.Map) collection );
  }
View Full Code Here

Examples of org.hibernate.collection.internal.PersistentMap

  public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) {
    if ( session.getEntityMode()==EntityMode.DOM4J ) {
      return new PersistentMapElementHolder(session, persister, key);
    }
    else {
      return new PersistentMap(session);
    }
  }
View Full Code Here

Examples of org.hibernate.collection.internal.PersistentMap

  public PersistentCollection wrap(SessionImplementor session, Object collection) {
    if ( session.getEntityMode()==EntityMode.DOM4J ) {
      return new PersistentMapElementHolder( session, (Element) collection );
    }
    else {
      return new PersistentMap( session, (java.util.Map) 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.