Beispiel #1
0
 public boolean existUserByUserName(String userName) {
   String hql = "select count(*) from User where userName=?";
   List<Object> param = new LinkedList<Object>();
   param.add(userName);
   Long i = baseDao.count(hql, param);
   if (i > 0) {
     return true;
   } else {
     return false;
   }
 }
Beispiel #2
0
 public Long count(User s_User) {
   List<Object> param = new LinkedList<Object>();
   StringBuffer hql = new StringBuffer("select count(*) from User");
   hql.append(" and status=1 ");
   return baseDao.count(hql.toString().replaceFirst("and", "where"), param);
 }