diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java index ef788f99c7..254142e7ca 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java @@ -27,6 +27,8 @@ import org.springframework.expression.Expression; import org.springframework.integration.Message; import org.springframework.integration.jdbc.storedproc.ProcedureParameter; import org.springframework.jdbc.core.RowMapper; +import org.springframework.jdbc.core.SqlInOutParameter; +import org.springframework.jdbc.core.SqlOutParameter; import org.springframework.jdbc.core.SqlParameter; import org.springframework.jdbc.core.namedparam.SqlParameterSource; import org.springframework.jdbc.core.simple.SimpleJdbcCall; @@ -37,20 +39,20 @@ import org.springframework.util.Assert; /** * A message handler that executes Stored Procedures for update purposes. * - * Stored procedure parameter value are by default automatically extracted from - * the Payload if the payload's bean properties match the parameters of the Stored - * Procedure. - * + * Stored procedure parameter value are by default automatically extracted from + * the Payload if the payload's bean properties match the parameters of the Stored + * Procedure. + * * This may be sufficient for basic use cases. For more sophisticated options * consider passing in one or more {@link ProcedureParameter}. * * If you need to handle the return parameters of the called stored procedure * explicitly, please consider using a {@link StoredProcOutboundGateway} instead. * - * Also, if you need to execute SQL Functions, please also use the - * {@link StoredProcOutboundGateway}. As functions are typically used to look up + * Also, if you need to execute SQL Functions, please also use the + * {@link StoredProcOutboundGateway}. As functions are typically used to look up * values, only, the Stored Procedure message handler does purposefully not support - * SQL function calls. If you believe there are valid use-cases for that, please file a + * SQL function calls. If you believe there are valid use-cases for that, please file a * feature request at http://jira.springsource.org. * * @@ -60,117 +62,142 @@ import org.springframework.util.Assert; */ public class StoredProcExecutor implements InitializingBean { - /** - * Uses the {@link SimpleJdbcCall} implementation for executing Stored Procedures. - * For more details please see: - */ + /** + * Uses the {@link SimpleJdbcCall} implementation for executing Stored Procedures. + */ private final SimpleJdbcCallOperations jdbcCallOperations; /** - * Name of the stored procedure to execute. + * Name of the stored procedure or function to be executed. */ private volatile String storedProcedureName; - + /** * For fully supported databases, the underlying {@link SimpleJdbcCall} can - * retrieve the parameter information for the to be invoked Stored Procedure - * from the JDBC Meta-data. However, if the used database does not support - * meta data lookups or if you like to provide customized parameter definitions, - * this flag can be set to 'true'. It defaults to 'false'. + * retrieve the parameter information for the to be invoked Stored Procedure + * or Function from the JDBC Meta-data. However, if the used database does + * not support meta data lookups or if you like to provide customized + * parameter definitions, this flag can be set to 'true'. It defaults to 'false'. */ private volatile boolean ignoreColumnMetaData = false; - + /** - * If you database system is not fully supported by Spring and thus obtaining + * If your database system is not fully supported by Spring and thus obtaining * parameter definitions from the JDBC Meta-data is not possible, you must define - * the {@link SqlParameter} explicitly. + * the {@link SqlParameter} explicitly. See also {@link SqlOutParameter} and + * {@link SqlInOutParameter}. */ private volatile List sqlParameters = new ArrayList(0); /** - * By default bean properties of the passed in {@link Message} will be used - * as a source for the Stored Procedure's input parameters. - * + * By default bean properties of the passed in {@link Message} will be used + * as a source for the Stored Procedure's input parameters. By default a + * {@link BeanPropertySqlParameterSourceFactory} will be used. + * * This may be sufficient for basic use cases. For more sophisticated options * consider passing in one or more {@link ProcedureParameter}. */ - private volatile SqlParameterSourceFactory sqlParameterSourceFactory = new BeanPropertySqlParameterSourceFactory(); - + private volatile SqlParameterSourceFactory sqlParameterSourceFactory = null; + /** - * Indicates that whether only the payload of the passed in {@link Message} - * will be used as a source of parameters. The is 'true' by default because as a - * default a {@link BeanPropertySqlParameterSourceFactory} implementation is + * Indicates that whether only the payload of the passed in {@link Message} + * will be used as a source of parameters. The is 'true' by default because as a + * default a {@link BeanPropertySqlParameterSourceFactory} implementation is * used for the sqlParameterSourceFactory property. */ - private volatile boolean usePayloadAsParameterSource = false; - + private volatile Boolean usePayloadAsParameterSource = null; + /** * Custom Stored Procedure parameters that may contain static values * or Strings representing an {@link Expression}. */ private volatile ListprocedureParameters; - + private volatile boolean isFunction = false; private volatile boolean returnValueRequired = false; private volatile Map> returningResultSetRowMappers = new HashMap>(0); - + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - + /** - * Constructor taking {@link DataSource} from which the DB Connection can be + * Constructor taking {@link DataSource} from which the DB Connection can be * obtained and the select query to execute the stored procedure. * * @param dataSource used to create a {@link SimpleJdbcTemplate}, must not be Null * @param storedProcedureName Name of the Stored Procedure of function, must not be empty */ public StoredProcExecutor(DataSource dataSource, String storedProcedureName) { - - Assert.notNull(dataSource, "dataSource must not be null."); - Assert.hasText(storedProcedureName, "storedProcedureName must not be null and cannot be empty."); - + + Assert.notNull(dataSource, "dataSource must not be null."); + Assert.hasText(storedProcedureName, "storedProcedureName must not be null and cannot be empty."); + this.jdbcCallOperations = new SimpleJdbcCall(dataSource); this.storedProcedureName = storedProcedureName; } - /** + /** * Verifies parameters, sets the parameters on {@link SimpleJdbcCallOperations} - * and ensures the appropriate {@link SqlParameterSourceFactory} is defined + * and ensures the appropriate {@link SqlParameterSourceFactory} is defined * when {@link ProcedureParameter} are passed in. */ public void afterPropertiesSet() { - - if (this.procedureParameters != null) { - - if (!(this.sqlParameterSourceFactory instanceof ExpressionEvaluatingSqlParameterSourceFactory)) { - this.sqlParameterSourceFactory = new ExpressionEvaluatingSqlParameterSourceFactory(); - } - - ExpressionEvaluatingSqlParameterSourceFactory expressionSourceFactory - = (ExpressionEvaluatingSqlParameterSourceFactory) this.sqlParameterSourceFactory; - - expressionSourceFactory.setStaticParameters(ProcedureParameter.convertStaticParameters(procedureParameters)); - expressionSourceFactory.setParameterExpressions(ProcedureParameter.convertExpressions(procedureParameters)); - } + if (this.procedureParameters != null ) { + + if (this.sqlParameterSourceFactory == null) { + ExpressionEvaluatingSqlParameterSourceFactory expressionSourceFactory = + new ExpressionEvaluatingSqlParameterSourceFactory(); + + expressionSourceFactory.setStaticParameters(ProcedureParameter.convertStaticParameters(procedureParameters)); + expressionSourceFactory.setParameterExpressions(ProcedureParameter.convertExpressions(procedureParameters)); + + this.sqlParameterSourceFactory = expressionSourceFactory; + + } else { + + if (!(this.sqlParameterSourceFactory instanceof ExpressionEvaluatingSqlParameterSourceFactory)) { + throw new IllegalStateException("You are providing 'ProcedureParameters'. " + + "Was expecting the the provided sqlParameterSourceFactory " + + "to be an instance of 'ExpressionEvaluatingSqlParameterSourceFactory', " + + "however the provided one is of type '" + this.sqlParameterSourceFactory.getClass().getName() + "'"); + } + + } + + if (this.usePayloadAsParameterSource == null) { + this.usePayloadAsParameterSource = false; + } + + } else { + + if (this.sqlParameterSourceFactory == null) { + this.sqlParameterSourceFactory = new BeanPropertySqlParameterSourceFactory(); + } + + if (this.usePayloadAsParameterSource == null) { + this.usePayloadAsParameterSource = true; + } + + } if (this.ignoreColumnMetaData) { this.jdbcCallOperations.withoutProcedureColumnMetaDataAccess(); } - + this.jdbcCallOperations.declareParameters(this.sqlParameters.toArray(new SqlParameter[this.sqlParameters.size()])); - - + + if (!this.returningResultSetRowMappers.isEmpty()) { for (Entry> mapEntry : this.returningResultSetRowMappers.entrySet()) { jdbcCallOperations.returningResultSet(mapEntry.getKey(), mapEntry.getValue()); } } - + if (this.returnValueRequired) { jdbcCallOperations.withReturnValue(); } - + if (this.isFunction) { this.jdbcCallOperations.withFunctionName(this.storedProcedureName); } else { @@ -178,158 +205,162 @@ public class StoredProcExecutor implements InitializingBean { } } - + /** * Execute a Stored Procedure of Function - Use when not {@link Message} is - * available to extract {@link ProcedureParameter} values from it. - * - * @return Map containing the stored procedure results if any. + * available to extract {@link ProcedureParameter} values from it. + * + * @return Map containing the stored procedure results if any. */ public Map executeStoredProcedure() { return executeStoredProcedureInternal(new Object()); } - + /** * Execute a Stored Procedure of Function - Use with {@link Message} is - * available to extract {@link ProcedureParameter} values from it. - * - * @return Map containing the stored procedure results if any. + * available to extract {@link ProcedureParameter} values from it. + * + * @return Map containing the stored procedure results if any. */ public Map executeStoredProcedure(Message message) { - - Assert.notNull(message, "The message parameter must not be null."); - + + Assert.notNull(message, "The message parameter must not be null."); + Assert.notNull(usePayloadAsParameterSource, "Property usePayloadAsParameterSource " + + "was Null. Did you call afterPropertiesSet()?"); + if (usePayloadAsParameterSource) { - return executeStoredProcedureInternal(message.getPayload()); + return executeStoredProcedureInternal(message.getPayload()); } else { - return executeStoredProcedureInternal(message); + return executeStoredProcedureInternal(message); } - + } - + /** * Execute the Stored Procedure using the passed in {@link Message} as a source * for parameters. - * + * * @param message The message is used to extract parameters for the stored procedure. - * @return A map containing the return values from the Stored Procedure call if any. + * @return A map containing the return values from the Stored Procedure call if any. */ private Map executeStoredProcedureInternal(Object input) { - SqlParameterSource storedProcedureParameterSource = + Assert.notNull(sqlParameterSourceFactory, "Property sqlParameterSourceFactory " + + "was Null. Did you call afterPropertiesSet()?"); + + SqlParameterSource storedProcedureParameterSource = sqlParameterSourceFactory.createParameterSource(input); return StoredProcExecutor.executeStoredProcedure(jdbcCallOperations, - storedProcedureParameterSource); + storedProcedureParameterSource); } /** */ - private static Map executeStoredProcedure(SimpleJdbcCallOperations simpleJdbcCallOperations, - SqlParameterSource storedProcedureParameterSource) { - + private static Map executeStoredProcedure(SimpleJdbcCallOperations simpleJdbcCallOperations, + SqlParameterSource storedProcedureParameterSource) { + Map resultMap = simpleJdbcCallOperations.execute(storedProcedureParameterSource); return resultMap; } - + //~~~~~Setters for Properties~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - + /** * For fully supported databases, the underlying {@link SimpleJdbcCall} can - * retrieve the parameter information for the to be invoked Stored Procedure - * from the JDBC Meta-data. However, if the used database does not support + * retrieve the parameter information for the to be invoked Stored Procedure + * from the JDBC Meta-data. However, if the used database does not support * meta data lookups or if you like to provide customized parameter definitions, * this flag can be set to 'true'. It defaults to 'false'. */ - public void setIgnoreColumnMetaData(boolean ignoreColumnMetaData) { - this.ignoreColumnMetaData = ignoreColumnMetaData; - } - + public void setIgnoreColumnMetaData(boolean ignoreColumnMetaData) { + this.ignoreColumnMetaData = ignoreColumnMetaData; + } + /** * Custom Stored Procedure parameters that may contain static values * or Strings representing an {@link Expression}. */ - public void setProcedureParameters(List procedureParameters) { - - Assert.notEmpty(procedureParameters, "procedureParameters must not be null or empty."); - - for (ProcedureParameter procedureParameter : procedureParameters) { - Assert.notNull(procedureParameter, "The provided list (procedureParameters) cannot contain null values."); - } - - this.procedureParameters = procedureParameters; - this.usePayloadAsParameterSource = false; - } - - /** - * If you database system is not fully supported by Spring and thus obtaining - * parameter definitions from the JDBC Meta-data is not possible, you must define - * the {@link SqlParameter} explicitly. - */ - public void setSqlParameters(List sqlParameters) { - Assert.notEmpty(sqlParameters, "sqlParameters must not be null or empty."); - - for (SqlParameter sqlParameter : sqlParameters) { - Assert.notNull(sqlParameter, "The provided list (sqlParameters) cannot contain null values."); - } - - this.sqlParameters = sqlParameters; - } - - /** - * Provides the ability to set a custom {@link SqlParameterSourceFactory}. - * Keep in mind that if {@link ProcedureParameter} are set explicitly and - * you would like to provide a custom {@link SqlParameterSourceFactory}, - * then you must provide an instance of {@link ExpressionEvaluatingSqlParameterSourceFactory}. - * - * If not the SqlParameterSourceFactory will be replaced the default - * {@link ExpressionEvaluatingSqlParameterSourceFactory}. - * - * @param sqlParameterSourceFactory - */ - public void setSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory) { - Assert.notNull(sqlParameterSourceFactory, "sqlParameterSourceFactory must not be null."); - this.sqlParameterSourceFactory = sqlParameterSourceFactory; - this.usePayloadAsParameterSource = false; + public void setProcedureParameters(List procedureParameters) { + + Assert.notEmpty(procedureParameters, "procedureParameters must not be null or empty."); + + for (ProcedureParameter procedureParameter : procedureParameters) { + Assert.notNull(procedureParameter, "The provided list (procedureParameters) cannot contain null values."); + } + + this.procedureParameters = procedureParameters; + } - /** - * @return the name of the Stored Procedure or Function + /** + * If you database system is not fully supported by Spring and thus obtaining + * parameter definitions from the JDBC Meta-data is not possible, you must define + * the {@link SqlParameter} explicitly. + */ + public void setSqlParameters(List sqlParameters) { + Assert.notEmpty(sqlParameters, "sqlParameters must not be null or empty."); + + for (SqlParameter sqlParameter : sqlParameters) { + Assert.notNull(sqlParameter, "The provided list (sqlParameters) cannot contain null values."); + } + + this.sqlParameters = sqlParameters; + } + + /** + * Provides the ability to set a custom {@link SqlParameterSourceFactory}. + * Keep in mind that if {@link ProcedureParameter} are set explicitly and + * you would like to provide a custom {@link SqlParameterSourceFactory}, + * then you must provide an instance of {@link ExpressionEvaluatingSqlParameterSourceFactory}. + * + * If not the SqlParameterSourceFactory will be replaced the default + * {@link ExpressionEvaluatingSqlParameterSourceFactory}. + * + * @param sqlParameterSourceFactory + */ + public void setSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory) { + Assert.notNull(sqlParameterSourceFactory, "sqlParameterSourceFactory must not be null."); + this.sqlParameterSourceFactory = sqlParameterSourceFactory; + } + + /** + * @return the name of the Stored Procedure or Function * */ - public String getStoredProcedureName() { - return this.storedProcedureName; - } + public String getStoredProcedureName() { + return this.storedProcedureName; + } - public void setUsePayloadAsParameterSource(boolean usePayloadAsParameterSource) { - this.usePayloadAsParameterSource = usePayloadAsParameterSource; - } + public void setUsePayloadAsParameterSource(boolean usePayloadAsParameterSource) { + this.usePayloadAsParameterSource = usePayloadAsParameterSource; + } - public void setFunction(boolean isFunction) { - this.isFunction = isFunction; - } + public void setFunction(boolean isFunction) { + this.isFunction = isFunction; + } - public void setReturnValueRequired(boolean returnValueRequired) { - this.returnValueRequired = returnValueRequired; - } + public void setReturnValueRequired(boolean returnValueRequired) { + this.returnValueRequired = returnValueRequired; + } - /** - * If the Stored Procedure returns ResultSets you may provide a map of - * {@link RowMapper} to convert the {@link ResultSet} to meaningful objects. - * - * @param returningResultSetRowMappers The map may not be null and must not contain null values. - */ - public void setReturningResultSetRowMappers( - Map> returningResultSetRowMappers) { - - Assert.notNull(returningResultSetRowMappers, "returningResultSetRowMappers must not be null."); - - for (RowMapper rowMapper : returningResultSetRowMappers.values()) { - Assert.notNull(rowMapper, "The provided map cannot contain null values."); - } - - this.returningResultSetRowMappers = returningResultSetRowMappers; - } + /** + * If the Stored Procedure returns ResultSets you may provide a map of + * {@link RowMapper} to convert the {@link ResultSet} to meaningful objects. + * + * @param returningResultSetRowMappers The map may not be null and must not contain null values. + */ + public void setReturningResultSetRowMappers( + Map> returningResultSetRowMappers) { + + Assert.notNull(returningResultSetRowMappers, "returningResultSetRowMappers must not be null."); + + for (RowMapper rowMapper : returningResultSetRowMappers.values()) { + Assert.notNull(rowMapper, "The provided map cannot contain null values."); + } + + this.returningResultSetRowMappers = returningResultSetRowMappers; + } } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java index ad10961c1a..f06ab8ee21 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcMessageHandler.java @@ -74,7 +74,7 @@ public class StoredProcMessageHandler extends AbstractMessageHandler implements Assert.hasText(storedProcedureName, "storedProcedureName must not be null and cannot be empty."); this.executor = new StoredProcExecutor(dataSource, storedProcedureName); - this.executor.setUsePayloadAsParameterSource(true); + } /** @@ -157,4 +157,25 @@ public class StoredProcMessageHandler extends AbstractMessageHandler implements this.executor.setSqlParameterSourceFactory(sqlParameterSourceFactory); } + /** + * If set to 'true', the payload of the Message will be used as a source for + * providing parameters. If false the entire Message will be available as a + * source for parameters. + * + * If no {@link ProcedureParameter} are passed in, this property will default to + * 'true'. This means that using a default {@link BeanPropertySqlParameterSourceFactory} + * the bean properties of the payload will be used as a source for parameter values for + * the to-be-executed Stored Procedure or Function. + * + * However, if {@link ProcedureParameter} are passed in, then this property + * will by default evaluate to 'false'. {@link ProcedureParameter} allow for + * SpEl Expressions to be provided and therefore it is highly beneficial to + * have access to the entire {@link Message}. + * + * @param usePayloadAsParameterSource If false the entire {@link Message} is used as parameter source. + */ + public void setUsePayloadAsParameterSource(boolean usePayloadAsParameterSource) { + this.executor.setUsePayloadAsParameterSource(usePayloadAsParameterSource); + } + } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java index 2f6218d58d..87e434d8d6 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcOutboundGateway.java @@ -58,7 +58,7 @@ public class StoredProcOutboundGateway extends AbstractReplyProducingMessageHand Assert.hasText(storedProcedureName, "storedProcedureName must not be null and cannot be empty."); this.executor = new StoredProcExecutor(dataSource, storedProcedureName); - this.executor.setUsePayloadAsParameterSource(true); + } /** @@ -188,5 +188,34 @@ public class StoredProcOutboundGateway extends AbstractReplyProducingMessageHand public void setExpectSingleResult(boolean expectSingleResult) { this.expectSingleResult = expectSingleResult; } - + + /** + * + * @param sqlParameterSourceFactory + */ + public void setSqlParameterSourceFactory(SqlParameterSourceFactory sqlParameterSourceFactory) { + this.executor.setSqlParameterSourceFactory(sqlParameterSourceFactory); + } + + /** + * If set to 'true', the payload of the Message will be used as a source for + * providing parameters. If false the entire Message will be available as a + * source for parameters. + * + * If no {@link ProcedureParameter} are passed in, this property will default to + * 'true'. This means that using a default {@link BeanPropertySqlParameterSourceFactory} + * the bean properties of the payload will be used as a source for parameter values for + * the to-be-executed Stored Procedure or Function. + * + * However, if {@link ProcedureParameter} are passed in, then this property + * will by default evaluate to 'false'. {@link ProcedureParameter} allow for + * SpEl Expressions to be provided and therefore it is highly beneficial to + * have access to the entire {@link Message}. + * + * @param usePayloadAsParameterSource If false the entire {@link Message} is used as parameter source. + */ + public void setUsePayloadAsParameterSource(boolean usePayloadAsParameterSource) { + this.executor.setUsePayloadAsParameterSource(usePayloadAsParameterSource); + } + } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcMessageHandlerParser.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcMessageHandlerParser.java index 7e93e71d62..47e5d6ebee 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcMessageHandlerParser.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcMessageHandlerParser.java @@ -51,13 +51,16 @@ public class StoredProcMessageHandlerParser extends AbstractOutboundChannelAdapt builder.addConstructorArgValue(storedProcedureName); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "ignore-column-meta-data"); - + IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "use-payload-as-parameter-source"); + IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "sql-parameter-source-factory"); + final ManagedList procedureParameterList = StoredProcParserUtils.getProcedureParameterBeanDefinitions(element, parserContext); final ManagedList sqlParameterDefinitionList = StoredProcParserUtils.getSqlParameterDefinitionBeanDefinitions(element, parserContext); if (!procedureParameterList.isEmpty()) { builder.addPropertyValue("procedureParameters", procedureParameterList); } + if (!sqlParameterDefinitionList.isEmpty()) { builder.addPropertyValue("sqlParameters", sqlParameterDefinitionList); } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcOutboundGatewayParser.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcOutboundGatewayParser.java index 0965fcf4c4..caa5fc0027 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcOutboundGatewayParser.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/config/StoredProcOutboundGatewayParser.java @@ -55,7 +55,10 @@ public class StoredProcOutboundGatewayParser extends AbstractConsumerEndpointPar IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, gatewayElement, "ignore-column-meta-data"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, gatewayElement, "expect-single-result"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, gatewayElement, "return-value-required"); - + IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, gatewayElement, "use-payload-as-parameter-source"); + IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, gatewayElement, "sql-parameter-source-factory"); + + final ManagedList procedureParameterList = StoredProcParserUtils.getProcedureParameterBeanDefinitions(gatewayElement, parserContext); final ManagedList sqlParameterDefinitionList = StoredProcParserUtils.getSqlParameterDefinitionBeanDefinitions(gatewayElement, parserContext); final ManagedMap returningResultsetMap = StoredProcParserUtils.getReturningResultsetBeanDefinitions(gatewayElement, parserContext); diff --git a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/config/spring-integration-jdbc-2.1.xsd b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/config/spring-integration-jdbc-2.1.xsd index 6cbe957168..baa243053d 100644 --- a/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/config/spring-integration-jdbc-2.1.xsd +++ b/spring-integration-jdbc/src/main/resources/org/springframework/integration/jdbc/config/spring-integration-jdbc-2.1.xsd @@ -608,16 +608,39 @@ + + + + + + + + + + + + - Reference to a SqlParameterSourceFactory. The input is the whole - outgoing message. The - default factory creates a bean - property parameter source so the query can specify named - parameters like :payload and :headers[foo]. + Reference to a SqlParameterSourceFactory. + + + + + + + + + + + +