@Override
public List<Community> findApprovedCommunities() {
LOG.info("findApprovedCommunites()");
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaQuery<Community> criteria = builder.createQuery(Community.class);
Root<Community> community = criteria.from(Community.class);
try {
criteria.where(builder.equal(community.get("state"), new Enumeration(2)));
} catch (DatabaseException e1) {
LOG.error("Enumeration(2).APPROVED konnte nicht erstellt werden!");
}
TypedQuery<Community> query = em.createQuery(criteria);
try {
List <Community> coms = query.getResultList();
for(Community c : coms) {
initializeCom(c);
}
return coms;
} catch (NoResultException e) {
LOG.error(e.toString());
return null;
}
}
CommunityDAOImpl.java 文件源码
java
阅读 40
收藏 0
点赞 0
评论 0
项目:chr-krenn-fhj-ws2017-sd17-pse
作者:
评论列表
文章目录