Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection In directory sc8-pr-cvs1:/tmp/cvs-serv24981/collection Modified Files: ArrayHolder.java Bag.java CollectionPersister.java List.java Map.java Set.java SortedMap.java SortedSet.java Log Message: fixed problem where <parent> was not being set after retrieval from cache Index: ArrayHolder.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/ArrayHolder.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ArrayHolder.java 9 Feb 2003 06:28:14 -0000 1.7 --- ArrayHolder.java 9 Feb 2003 07:41:15 -0000 1.8 *************** *** 172,176 **** ! public ArrayHolder(SessionImplementor session, CollectionPersister persister, Serializable disassembled) throws HibernateException, SQLException { super(session); --- 172,176 ---- ! public ArrayHolder(SessionImplementor session, CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException, SQLException { super(session); *************** *** 180,184 **** for ( int i=0; i<cached.length; i++ ) { ! Array.set(array, i, persister.getElementType().assemble(cached[i], session, null) ); } --- 180,184 ---- for ( int i=0; i<cached.length; i++ ) { ! Array.set(array, i, persister.getElementType().assemble(cached[i], session, owner) ); } Index: Bag.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/Bag.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Bag.java 9 Feb 2003 06:28:14 -0000 1.6 --- Bag.java 9 Feb 2003 07:41:15 -0000 1.7 *************** *** 159,163 **** * @see net.sf.hibernate.collections.PersistentCollection#assemble(CollectionPersister, SessionImplementor) */ ! public Bag(SessionImplementor session, CollectionPersister persister, Serializable disassembled) throws HibernateException, SQLException { super(session); --- 159,163 ---- * @see net.sf.hibernate.collections.PersistentCollection#assemble(CollectionPersister, SessionImplementor) */ ! public Bag(SessionImplementor session, CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException, SQLException { super(session); *************** *** 165,169 **** Serializable[] array = (Serializable[]) disassembled; for ( int i=0; i<array.length; i++ ) { ! bag.add( persister.getElementType().assemble( array[i], session, null ) ); //TODO: fix the null!!! } initialized=true; --- 165,169 ---- Serializable[] array = (Serializable[]) disassembled; for ( int i=0; i<array.length; i++ ) { ! bag.add( persister.getElementType().assemble( array[i], session, owner ) ); } initialized=true; Index: CollectionPersister.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/CollectionPersister.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CollectionPersister.java 9 Feb 2003 06:28:14 -0000 1.9 --- CollectionPersister.java 9 Feb 2003 07:41:15 -0000 1.10 *************** *** 214,218 **** } ! public PersistentCollection getCachedCollection(Serializable id, SessionImplementor s) throws HibernateException, SQLException { if (cache==null) { return null; --- 214,218 ---- } ! public PersistentCollection getCachedCollection(Serializable id, Object owner, SessionImplementor s) throws HibernateException, SQLException { if (cache==null) { return null; *************** *** 224,228 **** } else { ! return collectionType.assembleCachedCollection(s, this, cached); } } --- 224,228 ---- } else { ! return collectionType.assembleCachedCollection(s, this, cached, owner); } } Index: List.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/List.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** List.java 9 Feb 2003 06:28:14 -0000 1.7 --- List.java 9 Feb 2003 07:41:15 -0000 1.8 *************** *** 316,320 **** } ! public List(SessionImplementor session, CollectionPersister persister, Serializable disassembled) throws HibernateException, SQLException { super(session); --- 316,320 ---- } ! public List(SessionImplementor session, CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException, SQLException { super(session); *************** *** 322,326 **** Serializable[] array = (Serializable[]) disassembled; for ( int i=0; i<array.length; i++ ) { ! list.add( persister.getElementType().assemble( array[i], session, null ) ); //TODO: fix the null!!! } initialized=true; --- 322,326 ---- Serializable[] array = (Serializable[]) disassembled; for ( int i=0; i<array.length; i++ ) { ! list.add( persister.getElementType().assemble( array[i], session, owner ) ); } initialized=true; Index: Map.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/Map.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Map.java 9 Feb 2003 06:28:14 -0000 1.7 --- Map.java 9 Feb 2003 07:41:15 -0000 1.8 *************** *** 308,312 **** } ! public Map(SessionImplementor session, CollectionPersister persister, Serializable disassembled) throws HibernateException, SQLException { super(session); --- 308,312 ---- } ! public Map(SessionImplementor session, CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException, SQLException { super(session); *************** *** 314,319 **** Serializable[] array = (Serializable[]) disassembled; for (int i=0; i<array.length; i+=2 ) map.put( ! persister.getIndexType().assemble( array[i], session, null ), ! persister.getElementType().assemble( array[i+1], session, null ) //TODO: fix the null!!!! ); initialized = true; --- 314,319 ---- Serializable[] array = (Serializable[]) disassembled; for (int i=0; i<array.length; i+=2 ) map.put( ! persister.getIndexType().assemble( array[i], session, owner ), ! persister.getElementType().assemble( array[i+1], session, owner ) //TODO: fix the null!!!! ); initialized = true; Index: Set.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/Set.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Set.java 9 Feb 2003 06:28:14 -0000 1.6 --- Set.java 9 Feb 2003 07:41:15 -0000 1.7 *************** *** 78,87 **** initialized = true; } ! public Set(SessionImplementor session, CollectionPersister persister, Serializable disassembled) throws HibernateException, SQLException { super(session); beforeInitialize(persister); Serializable[] array = (Serializable[]) disassembled; for (int i=0; i<array.length; i++ ) set.add( ! persister.getElementType().assemble( array[i], session, null ) //TODO: fix the null!!!! ); initialized = true; --- 78,87 ---- initialized = true; } ! public Set(SessionImplementor session, CollectionPersister persister, Serializable disassembled, Object owner) throws HibernateException, SQLException { super(session); beforeInitialize(persister); Serializable[] array = (Serializable[]) disassembled; for (int i=0; i<array.length; i++ ) set.add( ! persister.getElementType().assemble( array[i], session, owner ) ); initialized = true; Index: SortedMap.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/SortedMap.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SortedMap.java 9 Feb 2003 06:28:14 -0000 1.5 --- SortedMap.java 9 Feb 2003 07:41:15 -0000 1.6 *************** *** 38,42 **** } ! public SortedMap(SessionImplementor session, CollectionPersister persister, Comparator comparator, Serializable disassembled) throws HibernateException, SQLException { super(session); --- 38,42 ---- } ! public SortedMap(SessionImplementor session, CollectionPersister persister, Comparator comparator, Serializable disassembled, Object owner) throws HibernateException, SQLException { super(session); *************** *** 45,50 **** Serializable[] array = (Serializable[]) disassembled; for (int i=0; i<array.length; i+=2 ) map.put( ! persister.getIndexType().assemble( array[i], session, null ), ! persister.getElementType().assemble( array[i+1], session, null ) //TODO: fix the null!!!! ); initialized = true; --- 45,50 ---- Serializable[] array = (Serializable[]) disassembled; for (int i=0; i<array.length; i+=2 ) map.put( ! persister.getIndexType().assemble( array[i], session, owner ), ! persister.getElementType().assemble( array[i+1], session, owner ) ); initialized = true; Index: SortedSet.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/collection/SortedSet.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SortedSet.java 9 Feb 2003 06:28:14 -0000 1.5 --- SortedSet.java 9 Feb 2003 07:41:15 -0000 1.6 *************** *** 136,140 **** CollectionPersister persister, Comparator comparator, ! Serializable disassembled) throws HibernateException, SQLException { --- 136,141 ---- CollectionPersister persister, Comparator comparator, ! Serializable disassembled, ! Object owner) throws HibernateException, SQLException { *************** *** 144,148 **** Serializable[] array = (Serializable[]) disassembled; for (int i=0; i<array.length; i++ ) set.add( ! persister.getElementType().assemble( array[i], session, null ) //TODO: fix the null!!!! ); initialized = true; --- 145,149 ---- Serializable[] array = (Serializable[]) disassembled; for (int i=0; i<array.length; i++ ) set.add( ! persister.getElementType().assemble( array[i], session, owner ) ); initialized = true; |