Beispiel #1
0
 /** {@inheritDoc} */
 @Override
 @UpdateSingleCache(namespace = namespace, expiration = expiration)
 public User insertUser(@ParameterValueKeyProvider @ParameterDataUpdateContent User user) {
   try {
     user.setCreateTime(new Date());
     user.setUpdateTime(new Date());
     sqlSession.insert("user.INSERT_USER", user);
   } catch (Exception e) {
     throw new DaoException("USER_ADD_ERROR", "保存用户异常", e);
   }
   return user;
 }
Beispiel #2
0
 /**
  * {@inheritDoc}
  *
  * @return
  */
 @Override
 @UpdateSingleCache(namespace = namespace, expiration = expiration)
 public int updateUser(@ParameterValueKeyProvider @ParameterDataUpdateContent User user) {
   try {
     user.setUpdateTime(new Date());
     return sqlSession.update("user.UPDATE_USER", user);
   } catch (Exception e) {
     throw new DaoException("USER_UPDATE_ERROR", "更新用户异常", e);
   }
 }