|
Spring Integration | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.jdbc.ExpressionEvaluatingSqlParameterSourceFactory
public class ExpressionEvaluatingSqlParameterSourceFactory
An implementation of SqlParameterSourceFactory which creates an SqlParameterSource that evaluates
Spring EL expressions. In addition the user can supply static parameters that always take precedence.
| Constructor Summary | |
|---|---|
ExpressionEvaluatingSqlParameterSourceFactory()
|
|
| Method Summary | |
|---|---|
org.springframework.jdbc.core.namedparam.SqlParameterSource |
createParameterSource(java.lang.Object input)
Return a new SqlParameterSource. |
void |
setParameterExpressions(java.util.Map<java.lang.String,java.lang.String> parameterExpressions)
Optionally maps parameter names to explicit expressions. |
void |
setStaticParameters(java.util.Map<java.lang.String,?> staticParameters)
Define some static parameter values. |
| Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator |
|---|
evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getEvaluationContext, setBeanFactory, setBeanResolver, setConversionService |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExpressionEvaluatingSqlParameterSourceFactory()
| Method Detail |
|---|
public void setStaticParameters(java.util.Map<java.lang.String,?> staticParameters)
parameterExpressions, so a parameter in the query will be filled from here
first, and then from the expressions.
staticParameters - the static parameters to setpublic void setParameterExpressions(java.util.Map<java.lang.String,java.lang.String> parameterExpressions)
static parameters
can be referred to in an expression using the variable #staticParameters, for example:
| Key | Value (Expression) | Example SQL |
|---|---|---|
| id | payload.businessKey |
select * from items where id=:id |
| date | headers['timestamp'] |
select * from items where created>:date |
| key | #staticParameters['foo'].toUpperCase() |
select * from items where name=:key |
parameterExpressions - the parameter expressions to setpublic org.springframework.jdbc.core.namedparam.SqlParameterSource createParameterSource(java.lang.Object input)
SqlParameterSourceFactorySqlParameterSource.
createParameterSource in interface SqlParameterSourceFactoryinput - the raw message or query result to be transformed into a SqlParameterSource
|
Spring Integration | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||