use of org.ambraproject.rhino.view.comment.CommentCountView in project rhino by PLOS.
the class CommentCrudServiceImpl method getCommentCount.
@Override
public ServiceResponse<CommentCountView> getCommentCount(Article article) {
CommentCountView view = hibernateTemplate.execute((Session session) -> {
long all = getCount(session, article, "AND isRemoved = FALSE");
long root = getCount(session, article, "AND isRemoved = FALSE AND parent IS NULL");
long removed = getCount(session, article, "AND isRemoved = TRUE");
return new CommentCountView(all, root, removed);
});
return ServiceResponse.serveView(view);
}
Aggregations