SpringJDBC入站适配器的动态选择查询
我可以为jdbc入站通道适配器定义一个动态查询吗SpringJDBC入站适配器的动态选择查询,spring,spring-jdbc,Spring,Spring Jdbc,我可以为jdbc入站通道适配器定义一个动态查询吗 <int-jdbc:inbound-channel-adapter max-rows-per-poll="1" query ="#{'select * from work where status=0 and and test='' + test.testValue+ '' order by date_modified'}" channel="test" data-source="testDS" update="
<int-jdbc:inbound-channel-adapter max-rows-per-poll="1"
query ="#{'select * from work where status=0 and and test='' + test.testValue+ '' order by date_modified'}"
channel="test" data-source="testDS" update="update work set status=1 where id in (:id)"
>
<int:poller fixed-rate="100">
<int:transactional transaction-manager="testTM"/>
</int:poller>
</int-jdbc:inbound-channel-adapter>
这里我定义了一个测试bean,它有一个getTestValue()方法。
这是行不通的。
有什么建议吗?尝试使用int jdbc:inbound channel adapter的select sql参数源属性
<int-jdbc:inbound-channel-adapter query="select * from user where lower(username)=:key"
channel="inputChannel" data-source="dataSource"
update="UPDATE DUMMY SET DUMMY_VALUE='test'" row-mapper="personResultMapper"
select-sql-parameter-source="parameterSource" />
<bean id="parameterSource" class="Class to extend AbstractSqlParameterSource" />
扩展AbstractSqlParameterSource的类负责为参数提供值
有关更多详细信息,请访问:尝试使用int jdbc:inbound channel adapter的select sql参数源属性
<int-jdbc:inbound-channel-adapter query="select * from user where lower(username)=:key"
channel="inputChannel" data-source="dataSource"
update="UPDATE DUMMY SET DUMMY_VALUE='test'" row-mapper="personResultMapper"
select-sql-parameter-source="parameterSource" />
<bean id="parameterSource" class="Class to extend AbstractSqlParameterSource" />
扩展AbstractSqlParameterSource的类负责为参数提供值
有关更多详情,请访问: