Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/engine
In directory sc8-pr-cvs1:/tmp/cvs-serv9038/hibernate/engine
Modified Files:
Cascades.java
Log Message:
added cascade to PostgreSQL drop table
applied Max Andersen exception message patch
applied J Russel Smyth patch to allow setMaxResults() to sort of work on SAPDB
fixed a bug where readonly bags did not always cascade save-update
Index: Cascades.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/engine/Cascades.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Cascades.java 14 Nov 2002 11:28:55 -0000 1.7
--- Cascades.java 24 Dec 2002 13:45:37 -0000 1.8
***************
*** 222,228 ****
CollectionPersister persister = session.getFactory().getCollectionPersister( pctype.getRole() );
Type elemType = persister.getElementType();
if ( action.shouldCascadeCollection(child) ) {
if ( log.isTraceEnabled() ) log.trace( "cascading to collection: " + pctype.getRole() );
! Iterator iter = pctype.getElementsIterator(child);
while ( iter.hasNext() ) cascade( session, iter.next(), elemType, action, cascadeVia );
}
--- 222,246 ----
CollectionPersister persister = session.getFactory().getCollectionPersister( pctype.getRole() );
Type elemType = persister.getElementType();
+ Iterator iter;
if ( action.shouldCascadeCollection(child) ) {
if ( log.isTraceEnabled() ) log.trace( "cascading to collection: " + pctype.getRole() );
! iter = pctype.getElementsIterator(child);
!
! }
! else {
! if (child instanceof PersistentCollection ) {
! PersistentCollection pc = (PersistentCollection) child;
! if ( pc.hasQueuedAdds() ) {
! iter = pc.queuedAddsIterator();
! }
! else {
! iter = null;
! }
! }
! else {
! iter = null;
! }
! }
! if (iter!=null) {
while ( iter.hasNext() ) cascade( session, iter.next(), elemType, action, cascadeVia );
}
|