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

This code example shows how to use the following methods:getCallParameters, getOutParameterNames, initializeMetaData, matchInParameterValuesWithCallParameters, processParameters
		MapSqlParameterSource parameterSource = new MapSqlParameterSource();
		parameterSource.addValue("id", 1);
		parameterSource.addValue("name", "Sven");
		parameterSource.addValue("customer_no", "12345XYZ");
 
		context.setProcedureName(TABLE);
		context.initializeMetaData(dataSource);
		context.processParameters(parameters);
 
		Map<String, Object> inParameters = context.matchInParameterValuesWithCallParameters(parameterSource);
		assertEquals("Wrong number of matched in parameter values", 2, inParameters.size());
		assertTrue("in parameter value missing", inParameters.containsKey("id"));
		assertTrue("in out parameter value missing", inParameters.containsKey("name"));
		assertTrue("out parameter value matched", !inParameters.containsKey("customer_no"));
 
		List<String> names = context.getOutParameterNames();
		assertEquals("Wrong number of out parameters", 2, names.size());
 
		List<SqlParameter> callParameters = context.getCallParameters();
		assertEquals("Wrong number of call parameters", 3, callParameters.size());

8
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Spring Framework CallMetaDataContext Methods: