Spring Framework SingleColumnRowMapper - 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 SingleColumnRowMapper class.

This code example shows how to use the following methods:
 * @since 2.5.2 
 * @deprecated along with {@link SimpleJdbcTemplate}, in favor of the regular 
 * {@link org.springframework.jdbc.core.SingleColumnRowMapper} 
 */ 
@Deprecated 
public class ParameterizedSingleColumnRowMapper<T> extends SingleColumnRowMapper<T>
		implements ParameterizedRowMapper<T> {
 
	/** 
	 * Static factory method to create a new ParameterizedSingleColumnRowMapper 
	 * (with the required type specified only once). 
	 * @param requiredType the type that each result object is expected to match 
	 */ 
	public static <T> ParameterizedSingleColumnRowMapper<T> newInstance(Class<T> requiredType) {
		ParameterizedSingleColumnRowMapper<T> newInstance = new ParameterizedSingleColumnRowMapper<T>();
		newInstance.setRequiredType(requiredType);
		return newInstance;
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:
 * @author Jean-Pierre Pawlak 
 * @see StoredProcedure 
 */ 
public class SqlFunction<T> extends MappingSqlQuery<T> { 
 
	private final SingleColumnRowMapper<T> rowMapper = new SingleColumnRowMapper<T>(); 
 
 
	/** 
	 * Constructor to allow use as a JavaBean. 
	 * A DataSource, SQL and any parameters must be supplied before 
	 * invoking the {@code compile} method and using this object. 
	 * @see #setDataSource 
	 * @see #setSql 
	 * @see #compile 
	 */ 
	public SqlFunction() { 
		setRowsExpected(1); 
	} 
 
5
CodeRank
This code example shows how to use the following methods:
	/* (non-Javadoc) 
	 * @see org.ohmage.query.impl.IClassDocumentQueries#getClassesAssociatedWithDocument(java.lang.String) 
	 */ 
	public List<String> getClassesAssociatedWithDocument(String documentId) throws DataAccessException { 
		try { 
			return getJdbcTemplate().query( 
					SQL_GET_CLASSES_ASSOCIATED_WITH_DOCUMENT,  
					new Object[] { documentId },  
					new SingleColumnRowMapper<String>()); 
		} 
		catch(org.springframework.dao.DataAccessException e) { 
			throw new DataAccessException( 
					"Error executing SQL '" +  
					SQL_GET_CLASSES_ASSOCIATED_WITH_DOCUMENT +  
						"' with parameter: " + documentId,  
					e); 
		} 
	} 
	 
	/* (non-Javadoc) 
5
CodeRank
This code example shows how to use the following methods:
			"AND pr.response = ubr.uuid " + 
			"AND pr.survey_response_id = sr.id " + 
			"AND sr.campaign_id = c.id"; 
		 
		try { 
			return getJdbcTemplate().query( 
				sql, 
				new Object[] { mediaId.toString() },
				new SingleColumnRowMapper<String>());
		} 
		catch(org.springframework.dao.DataAccessException e) {
			throw new DataAccessException( 
				"Error executing SQL '" +  
					sql + 
					"' with parameter: " +  
					mediaId.toString(),
				e);
		} 
	} 
 
5
CodeRank
This code example shows how to use the following methods:
	 *  
	 * @throws DataAccessException Thrown if there is an error. 
	 */ 
	public List<String> getVisibleDocumentsToUserInClass(String username, String classId) throws DataAccessException { 
		try { 
			return getJdbcTemplate().query( 
					SQL_GET_DOCUMENTS_SPECIFIC_TO_CLASS_FOR_REQUESTING_USER,  
					new Object[] { username, classId }, 
					new SingleColumnRowMapper<String>()); 
		} 
		catch(org.springframework.dao.DataAccessException e) { 
			throw new DataAccessException("Error executing SQL '" + SQL_GET_DOCUMENTS_SPECIFIC_TO_CLASS_FOR_REQUESTING_USER + " with parameters: " + 
					username + ", " + classId, e); 
		} 
	} 
	 
	/** 
	 * Retrieves whether or not the user is privileged any of the classes  
	 * associated with the document. 
	 *  
5
CodeRank
This code example shows how to use the following methods:
	 */ 
	public List<String> getVisibleDocumentsToUserInCampaign(String username, String campaignId)  
	 	throws DataAccessException { 
		 
		try { 
			return getJdbcTemplate().query( 
					SQL_GET_DOCUMENTS_SPECIFIC_TO_CAMPAIGN_FOR_REQUESTING_USER,  
					new Object[] { username, campaignId }, 
					new SingleColumnRowMapper<String>()); 
		} 
		catch(org.springframework.dao.DataAccessException e) { 
			throw new DataAccessException("Error executing SQL '" + SQL_GET_DOCUMENTS_SPECIFIC_TO_CAMPAIGN_FOR_REQUESTING_USER + " with parameters: " + 
					username + ", " + campaignId, e); 
		} 
	} 
	 
	/** 
	 * Checks if the user is a supervisor in any class to which the document is 
	 * associated. 
	 *  
5
CodeRank
This code example shows how to use the following methods:
        // 返回单列的查询的(或者返回只有2列的Map类型查询的) 
        if (TypeUtils.isColumnType(rowType)) {
            if (returnClassType == Map.class) {
                rowMapper = new MapEntryColumnRowMapper(modifier, rowType);
            } else { 
                rowMapper = new SingleColumnRowMapper(rowType);
            } 
        } 
        // 返回多列的,用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();
3
CodeRank