本文整理汇总了Java中org.kuali.rice.location.api.postalcode.PostalCodeQueryResults类的典型用法代码示例。如果您正苦于以下问题:Java PostalCodeQueryResults类的具体用法?Java PostalCodeQueryResults怎么用?Java PostalCodeQueryResults使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PostalCodeQueryResults类属于org.kuali.rice.location.api.postalcode包,在下文中一共展示了PostalCodeQueryResults类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findPostalCodes
import org.kuali.rice.location.api.postalcode.PostalCodeQueryResults; //导入依赖的package包/类
@Override
public PostalCodeQueryResults findPostalCodes(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException {
incomingParamCheck(queryByCriteria, "queryByCriteria");
QueryResults<PostalCodeBo> results = getDataObjectService().findMatching(PostalCodeBo.class, queryByCriteria);
PostalCodeQueryResults.Builder builder = PostalCodeQueryResults.Builder.create();
builder.setMoreResultsAvailable(results.isMoreResultsAvailable());
builder.setTotalRowCount(results.getTotalRowCount());
final List<PostalCode.Builder> ims = new ArrayList<PostalCode.Builder>();
for (PostalCodeBo bo : results.getResults()) {
ims.add(PostalCode.Builder.create(bo));
}
builder.setResults(ims);
return builder.build();
}
示例2: findPostalCodes
import org.kuali.rice.location.api.postalcode.PostalCodeQueryResults; //导入依赖的package包/类
@Override
public PostalCodeQueryResults findPostalCodes(QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException {
incomingParamCheck(queryByCriteria, "queryByCriteria");
GenericQueryResults<PostalCodeBo> results = criteriaLookupService.lookup(PostalCodeBo.class, queryByCriteria);
PostalCodeQueryResults.Builder builder = PostalCodeQueryResults.Builder.create();
builder.setMoreResultsAvailable(results.isMoreResultsAvailable());
builder.setTotalRowCount(results.getTotalRowCount());
final List<PostalCode.Builder> ims = new ArrayList<PostalCode.Builder>();
for (PostalCodeBo bo : results.getResults()) {
ims.add(PostalCode.Builder.create(bo));
}
builder.setResults(ims);
return builder.build();
}
示例3: testPostalCodeServiceImplJPA
import org.kuali.rice.location.api.postalcode.PostalCodeQueryResults; //导入依赖的package包/类
@Test
public void testPostalCodeServiceImplJPA() throws Exception {
PostalCode postalCode = LocationApiServiceLocator.getPostalCodeService().getPostalCode("US", "47203");
assertTrue("getPostalCode retrieved correctly", postalCode != null && StringUtils.equals(postalCode.getCode(),
"47203"));
List<PostalCode> postalCodeList = LocationApiServiceLocator.getPostalCodeService().
findAllPostalCodesInCountry("US");
assertTrue("findAllPostalCodesInCountry retrieved correctly",
postalCodeList != null && postalCodeList.size() == 1);
PostalCodeQueryResults results = LocationApiServiceLocator.getPostalCodeService().
findPostalCodes(QueryByCriteria.Builder.forAttribute("code", "47203").build());
assertTrue("findPostalCodes retrieved correctly", results != null && results.getResults().size() == 1);
}