org.kuali.rice.krad.util
Class OjbCollectionHelper

java.lang.Object
  extended by org.kuali.rice.krad.util.OjbCollectionHelper

public class OjbCollectionHelper
extends Object

Helper object to deal with persisting collections.


Field Summary
private static org.apache.log4j.Logger LOG
           
 
Constructor Summary
OjbCollectionHelper()
           
 
Method Summary
private  void cleanse(OjbCollectionAware template, Collection<PersistableBusinessObject> origSource, List<PersistableBusinessObject> unwantedItems)
          This method deletes unwanted objects from the database as well as from the given input List
private  List<PersistableBusinessObject> findUnwantedElements(Collection<PersistableBusinessObject> fromList, Collection<PersistableBusinessObject> controlList)
          This method identifies items in the first List that are not contained in the second List.
 void processCollections(OjbCollectionAware template, PersistableBusinessObject orig, PersistableBusinessObject copy)
          OJB RemovalAwareLists do not survive through the response/request lifecycle.
 void processCollections2(OjbCollectionAware template, PersistableBusinessObject orig, PersistableBusinessObject copy)
          OJB RemovalAwareLists do not survive through the response/request lifecycle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final org.apache.log4j.Logger LOG
Constructor Detail

OjbCollectionHelper

public OjbCollectionHelper()
Method Detail

processCollections

public void processCollections(OjbCollectionAware template,
                               PersistableBusinessObject orig,
                               PersistableBusinessObject copy)
OJB RemovalAwareLists do not survive through the response/request lifecycle. This method is a work-around to forcibly remove business objects that are found in Collections stored in the database but not in memory.

Parameters:
orig -
id -
template -

processCollections2

public void processCollections2(OjbCollectionAware template,
                                PersistableBusinessObject orig,
                                PersistableBusinessObject copy)
OJB RemovalAwareLists do not survive through the response/request lifecycle. This method is a work-around to forcibly remove business objects that are found in Collections stored in the database but not in memory.

Parameters:
orig -
id -
template -

cleanse

private void cleanse(OjbCollectionAware template,
                     Collection<PersistableBusinessObject> origSource,
                     List<PersistableBusinessObject> unwantedItems)
This method deletes unwanted objects from the database as well as from the given input List

Parameters:
origSource - - list containing unwanted business objects
unwantedItems - - business objects to be permanently removed
template -

findUnwantedElements

private List<PersistableBusinessObject> findUnwantedElements(Collection<PersistableBusinessObject> fromList,
                                                             Collection<PersistableBusinessObject> controlList)
This method identifies items in the first List that are not contained in the second List. It is similar to the (optional) java.util.List retainAll method.

Parameters:
fromList -
controlList -
Returns:
true iff one or more items were removed


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.