本文整理汇总了Java中org.kuali.rice.krad.util.KRADUtils.coerceRequestParameterTypes方法的典型用法代码示例。如果您正苦于以下问题:Java KRADUtils.coerceRequestParameterTypes方法的具体用法?Java KRADUtils.coerceRequestParameterTypes怎么用?Java KRADUtils.coerceRequestParameterTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.krad.util.KRADUtils
的用法示例。
在下文中一共展示了KRADUtils.coerceRequestParameterTypes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: retrieveObjectForEditOrCopy
import org.kuali.rice.krad.util.KRADUtils; //导入方法依赖的package包/类
/**
* @see org.kuali.rice.krad.maintenance.Maintainable#retrieveObjectForEditOrCopy(MaintenanceDocument, java.util.Map)
*/
@Override
public Object retrieveObjectForEditOrCopy(MaintenanceDocument document, Map<String, String> dataObjectKeys) {
Object dataObject = null;
if ( getDataObjectService().supports(getDataObjectClass())) {
Map<String, Object> translatedValues = KRADUtils.coerceRequestParameterTypes(getDataObjectClass(), dataObjectKeys);
dataObject = getDataObjectService().find(getDataObjectClass(), new CompoundKey(translatedValues));
} else {
try {
dataObject = getLegacyDataAdapter().findObjectBySearch(getDataObjectClass(), dataObjectKeys);
} catch (Exception ex) {
if ( ex.getClass().equals( LegacyDataAdapter.CLASS_NOT_PERSISTABLE_OJB_EXCEPTION_CLASS )
&& !document.getOldMaintainableObject().isExternalBusinessObject()) {
throw new RuntimeException("Data Object Class: "
+ getDataObjectClass()
+ " is not persistable and is not externalizable - configuration error");
}
// otherwise, let fall through
}
}
return dataObject;
}
示例2: getSearchResultsForEBO
import org.kuali.rice.krad.util.KRADUtils; //导入方法依赖的package包/类
/**
* Performs a search against an {@link org.kuali.rice.krad.bo.ExternalizableBusinessObject} by invoking the
* module service
*
* @param searchCriteria map of criteria currently set
* @param unbounded indicates whether the complete result should be returned. When set to false the result is
* limited (if necessary) to the max search result limit configured.
* @return list of result objects, possibly bounded
*/
protected List<?> getSearchResultsForEBO(Map<String, String> searchCriteria, boolean unbounded) {
ModuleService eboModuleService = KRADServiceLocatorWeb.getKualiModuleService().getResponsibleModuleService(
getDataObjectClass());
BusinessObjectEntry ddEntry = eboModuleService.getExternalizableBusinessObjectDictionaryEntry(
getDataObjectClass());
Map<String, String> filteredFieldValues = new HashMap<String, String>();
for (String fieldName : searchCriteria.keySet()) {
if (ddEntry.getAttributeNames().contains(fieldName)) {
filteredFieldValues.put(fieldName, searchCriteria.get(fieldName));
}
}
Map<String, Object> translatedValues = KRADUtils.coerceRequestParameterTypes(
(Class<? extends ExternalizableBusinessObject>) getDataObjectClass(), filteredFieldValues);
List<?> searchResults = eboModuleService.getExternalizableBusinessObjectsListForLookup(
(Class<? extends ExternalizableBusinessObject>) getDataObjectClass(), (Map) translatedValues,
unbounded);
return searchResults;
}