Example #1
0
 public User login(User user) {
   List<Object> param = new LinkedList<Object>();
   StringBuffer hql = new StringBuffer("from User where username=? and password=?");
   param.add(user.getUsername());
   param.add(user.getPassword());
   return baseDao.get(hql.toString(), param);
 }
Example #2
0
 public List<User> list(User s_User, PageBean pb) {
   List<Object> param = new LinkedList<Object>();
   StringBuffer hql = new StringBuffer("from User");
   hql.append(" and status=1 ");
   if (pb != null) {
     return baseDao.find(hql.toString().replaceFirst("and", "where"), param, pb);
   }
   return null;
 }
Example #3
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;
   }
 }
Example #4
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);
 }
Example #5
0
 public void saveUser(User user) {
   baseDao.save(user);
 }