Hello,
I have question regarding sql-parameter-source-factory.
I have, lets say this Pojo:
In reality my Pojo has more than 40 variables - which is reason of my question.Code:public class Pojo1 { private var1; private var2; // getters and setters }
Now I send my pojo into channel as Payload of the message and in my integration context simply do:
It works good and I like this logic, but is there any way how to achieve the same, if I have this parameterExpressions Map already prepared (and this Map is my Message Payload) so I dont not want to create it integration context? E.g. to do something like this:Code:<int-jdbc:outbound-channel-adapter data-source="targetDb" channel="output" query="INSERT INTO POJO1 VALUES(:var1,:var2)" sql-parameter-source-factory="spelSource"> </int-jdbc:outbound-channel-adapter> <bean id="spelSource" class="org.springframework.integration.jdbc.ExpressionEvaluatingSqlParameterSourceFactory"> <property name="parameterExpressions"> <map> <entry key="var1" value="payload.getVar1()"/> <entry key="var2" value="payload.getVar2()"/> </map> </property> </bean>
This one is not working of course.Code:<bean id="spelSource" class="org.springframework.integration.jdbc.ExpressionEvaluatingSqlParameterSourceFactory"> <property name="parameterExpressions" ref=":payload"> </property> </bean>
Thak you,
Jakub


Reply With Quote