您好
我想写SELECT SUM(cevecoin) FROM coin where clid="ABC";
但一直都没办法成功 可以帮我看看吗? 谢谢
code如下
@Override
public Integer SumCoin(String Clid) {
CriteriaBuilder builder =getSession().getCriteriaBuilder();
CriteriaQuery<CoinBean> criteria =builder.createQuery(CoinBean.class);
Root<CoinBean> root = criteria.from(CoinBean.class);
builder.sum(root.get("Clid"));
return
getSession().createQuery(criteria).getSingleResult().getCevecoin();
}