1 package org.hibernate.event.def; 3 4 import org.hibernate.HibernateException; 5 import org.hibernate.collection.PersistentCollection; 6 import org.hibernate.engine.Collections; 7 import org.hibernate.event.EventSource; 8 import org.hibernate.type.CollectionType; 9 10 17 public class FlushVisitor extends AbstractVisitor { 18 19 private Object owner; 20 21 Object processCollection(Object collection, CollectionType type) 22 throws HibernateException { 23 24 if (collection==CollectionType.UNFETCHED_COLLECTION) { 25 return null; 26 } 27 28 if (collection!=null) { 29 final PersistentCollection coll; 30 if ( type.hasHolder( getSession().getEntityMode() ) ) { 31 coll = getSession().getPersistenceContext().getCollectionHolder(collection); 32 } 33 else { 34 coll = (PersistentCollection) collection; 35 } 36 37 Collections.processReachableCollection( coll, type, owner, getSession() ); 38 } 39 40 return null; 41 42 } 43 44 FlushVisitor(EventSource session, Object owner) { 45 super(session); 46 this.owner = owner; 47 } 48 49 } 50 | Popular Tags |