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


Java StateQueryResults类代码示例

本文整理汇总了Java中org.kuali.rice.location.api.state.StateQueryResults的典型用法代码示例。如果您正苦于以下问题:Java StateQueryResults类的具体用法?Java StateQueryResults怎么用?Java StateQueryResults使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StateQueryResults类属于org.kuali.rice.location.api.state包,在下文中一共展示了StateQueryResults类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findStates

import org.kuali.rice.location.api.state.StateQueryResults; //导入依赖的package包/类
@Override
public StateQueryResults findStates(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException {
    incomingParamCheck(queryByCriteria, "queryByCriteria");

    QueryResults<StateBo> results = getDataObjectService().findMatching(StateBo.class, queryByCriteria);

    StateQueryResults.Builder builder = StateQueryResults.Builder.create();
    builder.setMoreResultsAvailable(results.isMoreResultsAvailable());
    builder.setTotalRowCount(results.getTotalRowCount());

    final List<State.Builder> ims = new ArrayList<State.Builder>();
    for (StateBo bo : results.getResults()) {
        ims.add(State.Builder.create(bo));
    }

    builder.setResults(ims);
    return builder.build();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:StateServiceImpl.java

示例2: findStates

import org.kuali.rice.location.api.state.StateQueryResults; //导入依赖的package包/类
@Override
public StateQueryResults findStates(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException {
    incomingParamCheck(queryByCriteria, "queryByCriteria");

    GenericQueryResults<StateBo> results = criteriaLookupService.lookup(StateBo.class, queryByCriteria);

    StateQueryResults.Builder builder = StateQueryResults.Builder.create();
    builder.setMoreResultsAvailable(results.isMoreResultsAvailable());
    builder.setTotalRowCount(results.getTotalRowCount());

    final List<State.Builder> ims = new ArrayList<State.Builder>();
    for (StateBo bo : results.getResults()) {
        ims.add(State.Builder.create(bo));
    }

    builder.setResults(ims);
    return builder.build();
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:19,代码来源:StateServiceImpl.java

示例3: testStateServiceImplJPA

import org.kuali.rice.location.api.state.StateQueryResults; //导入依赖的package包/类
@Test
public void testStateServiceImplJPA() throws Exception {
    State state = LocationApiServiceLocator.getStateService().getState("US", "IN");
    assertTrue("getState retrieved correctly", state != null && StringUtils.equals("IN", state.getCode()));
    List<State> stateList = LocationApiServiceLocator.getStateService().findAllStatesInCountry("US");
    assertTrue("findAllStatesInCountry retrieved correctly", stateList != null && stateList.size() == 1);
    stateList = LocationApiServiceLocator.getStateService().findAllStatesInCountryByAltCode("USA");
    assertTrue("findAllStatesInCountryByAltCode retrieved correctly", stateList != null && stateList.size() == 1);
    StateQueryResults results = LocationApiServiceLocator.getStateService().findStates(
            QueryByCriteria.Builder.forAttribute("code", "IN").build());
    assertTrue("findStates retrieved correctly", results != null && results.getResults().size() == 1);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:LocationDataJPATest.java


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