Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SpringJDBC入站适配器的动态选择查询_Spring_Spring Jdbc - Fatal编程技术网

SpringJDBC入站适配器的动态选择查询

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="

我可以为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="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的类负责为参数提供值

有关更多详情,请访问: