Gunnar,
Thanks for the quick response. JDBC Outbound Gateway is exactly what I was using before, but I didn't like the idea of having to use a no-op update. Instead, what I ended up doing was writing a quick handler class like this:
Code:
public class ExpressionEvaluatingDAO extends NamedParameterJdbcDaoSupport {
private RowMapper<?> rowMapper = new ColumnMapRowMapper();
private String expression;
public void setRowMapper(RowMapper<?> rowMapper) {
this.rowMapper = rowMapper;
}
@Required
public void setExpression(String expression) {
this.expression = expression;
}
public Object handleMessage(Message<?> message) {
SqlParameterSource src = new ExpressionEvaluatingSqlParameterSourceFactory().createParameterSource(message);
return getNamedParameterJdbcTemplate().query(expression,src,rowMapper);
}
}
That allows me to, with only slightly more XML, do the same as above, only without namespace support:
Code:
<int:transformer input-channel="userIds" output-channel="users">
<bean class="com.mycompany.ExpressionEvaluatingDAO" p:rowMapper-ref="userMapper"
p:expression="select * from users u where u.user_id = :payload" p:jdbcTemplate-ref="jdbcTemplate" />
</int:transformer>
I will subscribe to the JIRA tickets so I know when the namespace support is made available. Meanwhile this works well for my needs. Thanks!