【发布时间】:2022-01-22 13:22:19
【问题描述】:
我可以将lastJobExecutionId 设置为jobExecutionContext['_lastJobExecutionId']。但问题是_lastJobExecutionId 是另一个类中定义的值。我不想在 xml 文件中使用 String '_lastJobExecutionId' 并将其更改为它的引用(如x.y.z.CustomTasklet.KEY_LAST_JOB_EXECUTION_ID)。
我该如何解决?
ASIS
<bean id="reader" class="x.y.z.CustomReader" scope="step">
<property name="sqlSessionTemplate" ref="SqlSessionTemplate"/>
<property name="queryId" value="mybatis.mapper.x.y.z.selectTarget"/>
<property name="pageSize" value="1000"/>
<property name="lastJobExecutionId" value="#{jobExecutionContext['_lastJobExecutionId']}"/>
</bean>
想要 TOBE 喜欢...
<bean id="reader" class="x.y.z.CustomReader" scope="step">
<property name="sqlSessionTemplate" ref="SqlSessionTemplate"/>
<property name="queryId" value="mybatis.mapper.x.y.z.selectTarget"/>
<property name="pageSize" value="1000"/>
<property name="lastJobExecutionId" value="#{jobExecutionContext['x.y.z.CustomTasklet.KEY_LAST_JOB_EXECUTION_ID']}"/>
</bean>
【问题讨论】:
标签: xml spring spring-batch