本文整理汇总了Java中org.restexpress.query.QueryRanges.parseFrom方法的典型用法代码示例。如果您正苦于以下问题:Java QueryRanges.parseFrom方法的具体用法?Java QueryRanges.parseFrom怎么用?Java QueryRanges.parseFrom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.restexpress.query.QueryRanges
的用法示例。
在下文中一共展示了QueryRanges.parseFrom方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readAll
import org.restexpress.query.QueryRanges; //导入方法依赖的package包/类
public List<User> readAll(Request request, Response response) {
QueryFilter filter = QueryFilters.parseFrom(request);
QueryOrder order = QueryOrders.parseFrom(request);
QueryRange range = QueryRanges.parseFrom(request, 20);
Page<User> entities = userBo.readAll(filter, range, order);
response.setCollectionResponse(range, entities.getList().size(), entities.getRowCount());
HyperExpressBindHelper.bindPaginationTokens(range, entities.getRowCount());
addTokenBinder();
return entities.getList();
}
示例2: readAll
import org.restexpress.query.QueryRanges; //导入方法依赖的package包/类
@Transactional
public List<UserAuthorization> readAll(Request request, Response response) {
String uuid = request.getHeader(Constants.Url.USER_UUID, "No User UUID supplied");
QueryFilter filter = QueryFilters.parseFrom(request);
QueryOrder order = QueryOrders.parseFrom(request);
QueryRange range = QueryRanges.parseFrom(request, Constants.DEFAULT_RANGE_LIMIT);
Page<UserAuthorization> entities
= userAuthorizationBo.readAllByUserAndService(uuid, filter, range, order);
response.setCollectionResponse(range, entities.getList().size(), entities.getRowCount());
HyperExpressBindHelper.bindPaginationTokens(range, entities.getRowCount());
addTokenBinder();
return entities.getList();
}
示例3: readAll
import org.restexpress.query.QueryRanges; //导入方法依赖的package包/类
public List<Blog> readAll(Request request, Response response)
{
QueryFilter filter = QueryFilters.parseFrom(request);
QueryOrder order = QueryOrders.parseFrom(request);
QueryRange range = QueryRanges.parseFrom(request, 20);
List<Blog> entities = blogs.readAll(filter, range, order);
response.setCollectionResponse(range, entities.size(), blogs.count(filter));
return entities;
}
示例4: readAll
import org.restexpress.query.QueryRanges; //导入方法依赖的package包/类
public List<Comment> readAll(Request request, Response response)
{
String blogId = request.getHeader(Constants.Url.BLOG_ID_PARAMETER, "No Blog ID supplied");
String blogEntryId = request.getHeader(Constants.Url.BLOG_ENTRY_ID_PARAMETER, "No Blog Entry ID supplied");
final Blog blog = blogs.read(UUID.parse(blogId));
entries.read(UUID.parse(blogEntryId));
QueryFilter filter = QueryFilters.parseFrom(request);
QueryOrder order = QueryOrders.parseFrom(request);
QueryRange range = QueryRanges.parseFrom(request, 20);
filter.addCriteria("blogEntryId", FilterOperator.EQUALS, UuidConverter.parse(blogEntryId));
List<Comment> entities = comments.readAll(filter, range, order);
response.setCollectionResponse(range, entities.size(), comments.count(filter));
// Bind the resources in the collection with link URL tokens, etc. here...
HyperExpress.tokenBinder(new TokenBinder<Comment>()
{
@Override
public void bind(Comment entity, TokenResolver resolver)
{
resolver.bind(Constants.Url.BLOG_ID_PARAMETER, UUID.format(blog.getUuid()));
}
});
return entities;
}
示例5: readAll
import org.restexpress.query.QueryRanges; //导入方法依赖的package包/类
public List<BlogEntry> readAll(Request request, Response response)
{
String blogId = request.getHeader(Constants.Url.BLOG_ID_PARAMETER, "Blog ID not provided");
QueryFilter filter = QueryFilters.parseFrom(request);
QueryOrder order = QueryOrders.parseFrom(request);
QueryRange range = QueryRanges.parseFrom(request, 20);
filter.addCriteria("blogId", FilterOperator.EQUALS, UuidConverter.parse(blogId));
List<BlogEntry> results = blogEntries.readAll(filter, range, order);
response.setCollectionResponse(range, results.size(), blogEntries.count(filter));
return results;
}