本文整理汇总了Java中org.kuali.rice.krad.bo.PersistableBusinessObject.buildListOfDeletionAwareLists方法的典型用法代码示例。如果您正苦于以下问题:Java PersistableBusinessObject.buildListOfDeletionAwareLists方法的具体用法?Java PersistableBusinessObject.buildListOfDeletionAwareLists怎么用?Java PersistableBusinessObject.buildListOfDeletionAwareLists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.krad.bo.PersistableBusinessObject
的用法示例。
在下文中一共展示了PersistableBusinessObject.buildListOfDeletionAwareLists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processCollections
import org.kuali.rice.krad.bo.PersistableBusinessObject; //导入方法依赖的package包/类
/**
* 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.
*
* @param orig
* @param id
* @param template
*/
public void processCollections(OjbCollectionAware template, PersistableBusinessObject orig, PersistableBusinessObject copy) {
if (copy == null) {
return;
}
List<Collection<PersistableBusinessObject>> originalCollections = orig.buildListOfDeletionAwareLists();
if (originalCollections != null && !originalCollections.isEmpty()) {
/*
* Prior to being saved, the version in the database will not yet reflect any deleted collections. So, a freshly
* retrieved version will contain objects that need to be removed:
*/
try {
List<Collection<PersistableBusinessObject>> copyCollections = copy.buildListOfDeletionAwareLists();
int size = originalCollections.size();
if (copyCollections.size() != size) {
throw new RuntimeException("size mismatch while attempting to process list of Collections to manage");
}
for (int i = 0; i < size; i++) {
Collection<PersistableBusinessObject> origSource = originalCollections.get(i);
Collection<PersistableBusinessObject> copySource = copyCollections.get(i);
List<PersistableBusinessObject> list = findUnwantedElements(copySource, origSource);
cleanse(template, origSource, list);
}
}
catch (ObjectRetrievalFailureException orfe) {
// object wasn't found, must be pre-save
}
}
}
示例2: processCollections2
import org.kuali.rice.krad.bo.PersistableBusinessObject; //导入方法依赖的package包/类
/**
* 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.
*
* @param orig
* @param id
* @param template
*/
public void processCollections2(OjbCollectionAware template, PersistableBusinessObject orig, PersistableBusinessObject copy) {
// if copy is null this is the first time we are saving the object, don't have to worry about updating collections
if (copy == null) {
return;
}
List<Collection<PersistableBusinessObject>> originalCollections = orig.buildListOfDeletionAwareLists();
if (originalCollections != null && !originalCollections.isEmpty()) {
/*
* Prior to being saved, the version in the database will not yet reflect any deleted collections. So, a freshly
* retrieved version will contain objects that need to be removed:
*/
try {
List<Collection<PersistableBusinessObject>> copyCollections = copy.buildListOfDeletionAwareLists();
int size = originalCollections.size();
if (copyCollections.size() != size) {
throw new RuntimeException("size mismatch while attempting to process list of Collections to manage");
}
for (int i = 0; i < size; i++) {
Collection<PersistableBusinessObject> origSource = originalCollections.get(i);
Collection<PersistableBusinessObject> copySource = copyCollections.get(i);
List<PersistableBusinessObject> list = findUnwantedElements(copySource, origSource);
cleanse(template, origSource, list);
}
}
catch (ObjectRetrievalFailureException orfe) {
// object wasn't found, must be pre-save
}
}
}