Spring Framework ColumnMapRowMapper - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework ColumnMapRowMapper class.

This code example shows how to use the following methods:
        String query = request.getParameter("query"); 
        if (query != null) { 
            map.put("query", query); 
 
            try { 
                List<?> result = daoHelper.getJdbcTemplate().query(query, new ColumnMapRowMapper()); 
                map.put("result", result); 
            } catch (DataAccessException x) { 
                map.put("error", ExceptionUtils.getRootCause(x).getMessage()); 
            } 
        } 
 
        ModelAndView result = super.handleRequestInternal(request, response); 
        result.addObject("model", map); 
        return result; 
    } 
 
    public void setDaoHelper(DaoHelper daoHelper) { 
        this.daoHelper = daoHelper; 
    } 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	} 
 
	@Override 
	public SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta) {
		if (meta.getSqlType() == Types.OTHER && "refcursor".equals(meta.getTypeName())) {
			return new SqlOutParameter(parameterName, getRefCursorSqlType(), new ColumnMapRowMapper());
		} 
		else { 
			return super.createDefaultOutParameter(parameterName, meta);
		} 
	} 
 
	@Override 
	public boolean byPassReturnParameter(String parameterName) {
		return (RETURN_VALUE_NAME.equals(parameterName) ||
				super.byPassReturnParameter(parameterName));
	} 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	} 
 
	@Override 
	public SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta) {
		if (meta.getSqlType() == Types.OTHER && REF_CURSOR_NAME.equals(meta.getTypeName())) {
			return new SqlOutParameter(parameterName, getRefCursorSqlType(), new ColumnMapRowMapper());
		} 
		else { 
			return super.createDefaultOutParameter(parameterName, meta);
		} 
	} 
 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    } 
 
    @Test 
    public void testJumpOverPages() throws Exception { 
        list = new JdbcPagingList<Map<String, Object>>(template, limitSqlAdapter, "SELECT * from foo", 
                        new ColumnMapRowMapper(), 3); 
        Map<String, Object> map = list.get(3); 
        assertNotNull(map.get("name")); 
    } 
 
    @Test 
    public void testIterationOverSubList() throws Exception { 
        list = new JdbcPagingList<Map<String, Object>>(template, limitSqlAdapter, "SELECT * from foo", 
                        new ColumnMapRowMapper(), 3); 
        list = list.subList(1, 4); 
        assertEquals(3, list.size()); 
        int count = 0; 
        for (Map<String, Object> map : list) { 
            count++; 
            assertNotNull(map.get("name")); 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
	/** 
	 * Provide the maximum number of bytes allowed the query results. 
	 * @param maxSize 
	 */ 
	public SizeLimitRowMapper(long maxSize){
		this.maxBytes = maxSize;
	} 
 
	@Override 
	public Map<String, Object> mapRow(ResultSet rs, int rowNum)	throws SQLException {
		Map<String, Object> rowMap = super.mapRow(rs, rowNum);
		// Determine the size of this row. 
		return checkSize(rowMap);
	} 
 
	/** 
	 * This is where we actually check the size 
	 * @param rowMap 
	 * @return 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        // Make sure it's properly encoded 
        return "sql:" + UnsafeUriCharactersEncoder.encode(query);
    } 
 
    protected List<Map<String, Object>> queryForList(ResultSet rs) throws SQLException {
        ColumnMapRowMapper rowMapper = new ColumnMapRowMapper();
        RowMapperResultSetExtractor<Map<String, Object>> mapper = new RowMapperResultSetExtractor<Map<String, Object>>(rowMapper);
        List<Map<String, Object>> data = mapper.extractData(rs);
        return data;
    } 
 
    @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.");
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
            } 
        } 
        // 返回多列的,用Bean对象、集合、映射、数组来表示每一行的 
        else { 
            if (rowType == Map.class) {
                rowMapper = new ColumnMapRowMapper();
            } else if (rowType.isArray()) {
                rowMapper = new ArrayRowMapper(rowType);
            } else if ((rowType == List.class) || (rowType == Collection.class)) {
                rowMapper = new ListRowMapper(modifier);
            } else if (rowType == Set.class) {
                rowMapper = new SetRowMapper(modifier);
            } else { 
                boolean checkColumns = (rowHandler == null) ? true : rowHandler.checkColumns();
                boolean checkProperties = (rowHandler == null) ? false : rowHandler
                        .checkProperties(); 
                String key = rowType.getName() + "[checkColumns=" + checkColumns
                        + "&checkProperties=" + checkProperties + "]";
                rowMapper = rowMappers.get(key);
                if (rowMapper == null) {
3
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Spring Framework ColumnMapRowMapper Methods: