本文共 486 字,大约阅读时间需要 1 分钟。
/**
* 判断积分日志表中是否有某个用户的注册日志 */@Transactional(propagation = Propagation.REQUIRED)public boolean isExistRegPointLog(int userId, UserAction addReg) { try { String hql = "select count(pl) from PointLog pl WHERE pl.userid = ? AND pl.userAction = ? ";Object result = sessionFactory.getCurrentSession().createQuery(hql)
.setParameter(0, userId).setParameter(1, addReg) .uniqueResult();if ((Long) result > 0) {
return true; } } catch (Exception e) { e.printStackTrace(); } return false;}转载地址:http://zppxx.baihongyu.com/