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

This code example shows how to use the following methods:declareParameter, setDataSource, setSql
 
@Repository 
public class NodeTagInsert extends BatchSqlUpdate { 
 
	@Autowired 
	public NodeTagInsert(DataSource dataSource) { 
		setDataSource(dataSource); 
		setSql("INSERT INTO node_tags (node_id, k, v) VALUES (?,?,?)"); 
		declareParameter(new SqlParameter(Types.INTEGER)); 
		declareParameter(new SqlParameter(Types.VARCHAR)); 
		declareParameter(new SqlParameter(Types.VARCHAR)); 
	} 
 
	public void insert(long nodeId, Map<String, String> keyValues) { 
		for (String k : keyValues.keySet()) { 
			update(nodeId, k, keyValues.get(k)); 
		} 
		flush(); 
	} 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Spring Framework BatchSqlUpdate Methods: