@Test @DataSet("UserDao.Users.xls") public void findUserByUserName() { User user = userDao.getUserByUserName("test"); assertNull(user,"不存在用户名为test的用户!"); user = userDao.getUserByUserName("admin"); assertNotNull(user,"admin用户存在！"); assertEquals("admin", user.getUserName()); assertEquals("123456",user.getPassword()); }
public User getUserByUserName(String userName){ List<User> users = (List<User>)find(GET_USER_BY_USERNAME,userName); if (users.size() == 0) { return null; }else{ return users.get(0); } }
UserDao extends BaseDao<User> { public User getUserByUserName(String userName){ List<User> users = (List<User>)find(GET_USER_BY_USERNAME,userName); if (users.size() == 0) { return null; }else{ return users.get(0); } } }
UserDao extends BaseDao<User> { public User getUserByUserName(String userName){ List<User> users = (List<User>)find(GET_USER_BY_USERNAME,userName); if (users.size() == 0) { return null; }else{ return users.get(0); } }  }
UserDao extends BaseDao<User> { public User getUserByUserName(String userName){ List<User> users = (List<User>)find(GET_USER_BY_USERNAME,userName); if (users.size() == 0) { return null; }else{ return users.get(0); } }  User getUserByUserName(String userName); List<User> queryUserByUserName(String userName); }
UserDao extends BaseDao<User> { public User getUserByUserName(String userName){ List<User> users = (List<User>)find(GET_USER_BY_USERNAME,userName); if (users.size() == 0) { return null; }else{ return users.get(0); } }  User getUserByUserName(String userName); List<User> queryUserByUserName(String userName);  }