本文整理汇总了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();
}
示例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();
}
示例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);
}