Package com.github.diamond.web.model

Examples of com.github.diamond.web.model.Project


          "WHERE a.PROJ_ID = b.ID AND b.DELETE_FLAG = 0 order by b.ID desc limit ?, ?";
      List<Project> projects = jdbcTemplate.query(sql, new RowMapper<Project>() {
 
        public Project mapRow(ResultSet rs, int rowNum) throws SQLException,
            DataAccessException {
          Project project = new Project();
          project.setId(rs.getLong(1));
          project.setCode(rs.getString(2));
          project.setName(rs.getString(3));
          return project;
        }
      }, offset, limit);
      return projects;
    } else {
      String sql = "SELECT distinct b.ID, b.PROJ_CODE, b.PROJ_NAME FROM CONF_PROJECT_USER a, CONF_PROJECT b " +
          "WHERE a.PROJ_ID = b.ID and a.USER_ID=? AND b.DELETE_FLAG = 0 order by b.ID desc limit ?, ?";
      List<Project> projects = jdbcTemplate.query(sql, new RowMapper<Project>() {
 
        public Project mapRow(ResultSet rs, int rowNum) throws SQLException,
            DataAccessException {
          Project project = new Project();
          project.setId(rs.getLong(1));
          project.setCode(rs.getString(2));
          project.setName(rs.getString(3));
          return project;
        }
      }, user.getId(), offset, limit);
      return projects;
    }
View Full Code Here


 
  private class ProjectRowMapper implements RowMapper<Project> {

    public Project mapRow(ResultSet rs, int rowNum) throws SQLException,
        DataAccessException {
      Project project = new Project();
      project.setId(rs.getLong(1));
      project.setCode(rs.getString(2));
      project.setName(rs.getString(3));
      project.setUserName(rs.getString(4));
      project.setOwnerId(rs.getLong(5));
      return project;
    }
View Full Code Here

TOP

Related Classes of com.github.diamond.web.model.Project

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.