Package org.springframework.jdbc.core

Examples of org.springframework.jdbc.core.RowMapper


    @SuppressWarnings("unchecked")
    protected Object queryForObject(ResultSet rs) throws SQLException {
        Object result = null;
        if (outputClass == null) {
            RowMapper rowMapper = new ColumnMapRowMapper();
            RowMapperResultSetExtractor<Map<String, Object>> mapper = new RowMapperResultSetExtractor<Map<String, Object>>(rowMapper);
            List<Map<String, Object>> data = mapper.extractData(rs);
            if (data.size() > 1) {
                throw new SQLDataException("Query result not unique for outputType=SelectOne. Got " + data.size() " count instead.");
            } else if (data.size() == 1) {
                // Set content depend on number of column from query result
                Map<String, Object> row = data.get(0);
                if (row.size() == 1) {
                    result = row.values().iterator().next();
                } else {
                    result = row;
                }
            }
        } else {
            Class<?> outputClzz = getCamelContext().getClassResolver().resolveClass(outputClass);
            RowMapper rowMapper = new BeanPropertyRowMapper(outputClzz);
            RowMapperResultSetExtractor<?> mapper = new RowMapperResultSetExtractor(rowMapper);
            List<?> data = mapper.extractData(rs);
            if (data.size() > 1) {
                throw new SQLDataException("Query result not unique for outputType=SelectOne. Got " + data.size() " count instead.");
            } else if (data.size() == 1) {
View Full Code Here


   */
  public WorkflowDefinition findWorkflowDefinitionById(String id)
  {
    String sql = " select * from t_ff_df_workflowdef where id=? ";

    return (WorkflowDefinition) super.getJdbcTemplate().queryForObject(sql, new Object[] { id }, new RowMapper()
    {
      public Object mapRow(ResultSet rs, int rowNum) throws SQLException
      {

        WorkflowDefinition workFlowDefinition = new WorkflowDefinition();
View Full Code Here

    {
      System.out.println("FIREWORKFLOW_JDCB:" + sql.toString());
    }

    return (WorkflowDefinition) super.getJdbcTemplate().queryForObject(sql, new Object[] { processId, version },
        new RowMapper()
        {
          public Object mapRow(ResultSet rs, int rowNum) throws SQLException
          {

            WorkflowDefinition workFlowDefinition = new WorkflowDefinition();
View Full Code Here

    if (show_sql)
    {
      System.out.println("FIREWORKFLOW_JDCB:" + sql.toString());
    }

    return super.getJdbcTemplate().query(sql, new Object[] { processId }, new RowMapper()
    {
      public Object mapRow(ResultSet rs, int rowNum) throws SQLException
      {

        WorkflowDefinition workFlowDefinition = new WorkflowDefinition();
View Full Code Here

    "SELECT defid, parentfolder, name, objtype, prodver FROM bpm_procdef ").append(
    "WHERE (isdeleted='0') AND (objtype = 'folder') ").toString();
   
    final AclManager aclManager = AclManager.getInstance();
   
    return this.jdbcTemplate.query(sql, new RowMapper() {
      public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        Item item = null;
       
        int defid = rs.getInt("defid");
       
View Full Code Here

    "SELECT defid, parentfolder, name, objtype, prodver FROM bpm_procdef ").append(
    "WHERE (isdeleted='0') AND ((objtype = 'process' AND prodver <> 0) OR (objtype = 'folder') )").toString();
   
    final AclManager aclManager = AclManager.getInstance();
   
    return this.jdbcTemplate.query(sql, new RowMapper() {
      public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        Item item = null;
       
        int defid = rs.getInt("defid");
       
View Full Code Here

  @SuppressWarnings("unchecked")
  public List<Item> findAllProcessDefinitions(final String endpoint) {
   
    String sql = "SELECT defid, parentfolder, name, objtype, prodver FROM bpm_procdef WHERE isdeleted='0'";
   
    return this.jdbcTemplate.query(sql, new RowMapper() {

      public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        Item item = null;
       
        int defid = rs.getInt("defid");
View Full Code Here

   
    String sql = "SELECT defid, parentfolder, name, objtype, prodver FROM bpm_procdef WHERE isdeleted='0' AND comcode = '" + comCode + "'";
   
    final AclManager aclManager = AclManager.getInstance();
   
    return this.jdbcTemplate.query(sql, new RowMapper() {
      public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        Item item = null;
       
        int defid = rs.getInt("defid");
        Map<Character, Boolean> permission = aclManager.getPermission(defid, endpoint, true);
View Full Code Here

       .append("   AND  comcode = '").append(comCode).append("'").append("\n");
   
   
    final AclManager aclManager = AclManager.getInstance();
   
    return this.jdbcTemplate.query(sql.toString(), new RowMapper() {
      public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        Item item = null;
       
        int defid = rs.getInt("defid");
        //Map<Character, Boolean> permission = aclManager.getPermission(defid, endpoint);
View Full Code Here

 
  @SuppressWarnings("unchecked")
  public List<Form> findAllFormVersions(int defId) {
    String sql = "SELECT defverid, ver FROM bpm_procdefver WHERE defid=? AND isdeleted=0";
    return this.jdbcTemplate.query(sql, new Object[] { defId },
        new RowMapper() {
          public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
            Form form = new Form();
            form.setDefVerId(rs.getInt("defVerId"));
            form.setVer(rs.getString("ver"));
            return form;
View Full Code Here

TOP

Related Classes of org.springframework.jdbc.core.RowMapper

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.