UserUserDAO extends BaseIbatisDAO { public void save(final UserUser userUsers) { if (null != userUsers && null != userUsers.getEmail()) { userUsers.setEmail(userUsers.getEmail().toLowerCase()); } if (null != userUsers && null != userUsers.getUserName()) { userUsers.setUserName(userUsers.getUserName().toLowerCase()); } super.insert("USER_USER.insert", userUsers); }  void save(final UserUser userUsers); void update(final UserUser userUsers); UserUser getUsersByPk(final Long userId); UserUser getUsersByUserNo(final String userNo); @SuppressWarnings("rawtypes") UserUser getUsersForObject(final Map<String, Object> parameters); boolean queryForLoginValidate(final Map<String, Object> parameters); @SuppressWarnings("unchecked") List<UserUser> queryUserUserKeyWordsLike(final Map<String, Object> parameters); @SuppressWarnings("unchecked") List<UserUser> query(final Map<String, Object> parameters); @SuppressWarnings("unchecked") List<UserUser> getUsersListByPkList(final List<String> idList); void userMemberGradeUpdate(final Long userId, final String grade); boolean checkUsersForObject(final Map<String, Object> parameters); void refreshUsersPoint(final Long userId); Date getUserLastLoginDate(final String userNo); @SuppressWarnings("unchecked") Long getTotalProcessCash(final String userId); void expirationDateToNextYearForNormalGrade(Date date); @SuppressWarnings("unchecked") List<UserUser> queryUserUserByUserId(List<Long> ids); void unBindingMobile(final Long userId); void unBindingEmail(final Long userId);  }
@Test public void testSave() throws Exception { UserUser user = new UserUser(); user.setUserNo("pettest8a62364c9b2f01364c9b2f0b0"); user.setCityId(null); user.setUserName("pettest001"); user.setPasswordPrompt("什么是PET"); user.setPasswordAnswer("PET是个新项目"); user.setRealName("pet"); user.setAddress("驴妈妈"); user.setCreatedDate(new Date()); user.setUpdatedDate(null); user.setIsValid("Y"); user.setMobileNumber("13701930870"); user.setEmail("libo.wang.vip@gmail.com"); user.setGender("M"); user.setIdNumber(null); user.setPoint(100l); user.setNickName("pettest001"); user.setMemo(null); user.setImageUrl("/uploads/header/user_pic_6.jpg"); user.setIsEmailChecked("Y"); user.setRealPass("123456"); user.setPhoneNumber(null); user.setIsAcceptEdm("Y"); user.setIsMobileChecked("N"); user.setMemberShipCard(null); user.setChannel("PAGEREG"); user.setGrade("PLATINUM"); userUserDAO.save(user); Assert.assertNotNull(user.getUserId()); Statement stat = conn.createStatement(); ResultSet rs = stat.executeQuery("select * from user_user where user_no = '" + user.getUserNo() + "'"); rs.next(); Assert.assertEquals("user_name", rs.getString("USER_NAME")); Assert.assertEquals("user_password", rs.getString("USER_PASSWORD")); Assert.assertEquals("is_email_checked", rs.getString("IS_EMAIL_CHECKED")); }