Package com.apress.prospring.domain

Examples of com.apress.prospring.domain.User


    bm.saveEntry(new Entry(), null);
    performAssert();
  }

  public void testSaveComment() {
    bm.saveComment(new Comment(), new User());
    performAssert();
  }
View Full Code Here


  public void testGetBean() {
    assertNotNull(getDao());
  }
 
  public void testGetAll() {
    User user = getDao().getByUsernameAndPassword("root", "pwd");
    log().debug(user);
    assertNotNull(user);
  }
View Full Code Here

        this.auditService = auditService;
    }

    public User login(String username, String password)
            throws InvalidCredentialsException {
        User user = userDao.getByUsernameAndPassword(username, password);

        if (user == null) {
            throw new InvalidCredentialsException(
                    "The credentials you supplied do not match a known user profile. Try again");
        } else {
View Full Code Here

  /* (non-Javadoc)
   * @see com.apress.prospring.data.UserDao#delete(int)
   */
  public void delete(int userId) {
    User user = new User();
    user.setUserId(userId);
    getHibernateTemplate().delete(user);
  }
View Full Code Here

      comment.setReplyTo(new Integer(rs.getInt("ReplyTo")));
      if (rs.wasNull()) comment.setReplyTo(null);
      comment.setEntry(rs.getInt("Entry"));
      comment.setSubject(rs.getString("Subject"));

      User user = new User();
      user.setEmail(rs.getString("Email"));
      user.setPassword(rs.getString("Password"));
      user.setType(rs.getInt("Type"));
      user.setUserId(rs.getInt("UserId"));
      user.setUsername(rs.getString("Username"));

      comment.setPostedBy(user);

      return comment;
    }
View Full Code Here

    String username = request.getParameter("username");
    String password = request.getParameter("password");

    if (username != null && password != null) {
      // process login
      User user = blogManager.login(username, password);
      SessionSecurityManager.setUser(request, user);
      return new ModelAndView("index-redirect");
    } else {
      return new ModelAndView("security-login");
    }
View Full Code Here

   *
   * @param request The current request
   * @return The User object
   */
  public static User getUser(HttpServletRequest request) {
    User user = (User)request.getSession().getAttribute(USER_SESSION_KEY);
    if (user == null) {
      user = User.ANONYMOUS;
    }
   
    return user;
View Full Code Here

   * Inserts a comment
   *
   * @param comment The comment
   */
  private void insert(Comment comment) {
    comment.setPostedBy(new User());
    //comment.getPostedBy().setUserId(user);

    getSqlMapClientTemplate().insert("updateComment", comment);
  }
View Full Code Here

    /* (non-Javadoc)
     * @see org.springframework.jdbc.object.MappingSqlQuery#mapRow(java.sql.ResultSet, int)
     */
    protected Object mapRow(ResultSet rs, int rowNum) throws SQLException {
      User user = new User();

      user.setEmail(rs.getString("Email"));
      user.setPassword(rs.getString("Password"));
      user.setType(rs.getInt("Type"));
      user.setUserId(rs.getInt("UserId"));
      user.setUsername(rs.getString("Username"));

      return user;
    }
View Full Code Here

TOP

Related Classes of com.apress.prospring.domain.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.