当前位置: 首页>>代码示例>>Java>>正文


Java KRADUtils.coerceRequestParameterTypes方法代码示例

本文整理汇总了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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:MaintainableImpl.java

示例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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:33,代码来源:LookupableImpl.java


注:本文中的org.kuali.rice.krad.util.KRADUtils.coerceRequestParameterTypes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。