我可以設定lastJobExecutionId為jobExecutionContext['_lastJobExecutionId']. 但問題是_lastJobExecutionId在另一個類中定義的值。我不想在 xml 檔案中使用 String '_lastJobExecutionId' 并將其更改為它的參考(如x.y.z.CustomTasklet.KEY_LAST_JOB_EXECUTION_ID)。
我如何解決它?
亞西斯
<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>
想要像……
<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>
uj5u.com熱心網友回復:
這是關于 SpEL 語法的更多資訊,您可以使用以下符號來參考型別:
<property name="lastJobExecutionId" value="#{jobExecutionContext[T(x.y.z.CustomTasklet).KEY_LAST_JOB_EXECUTION_ID]}"/>
有關語法的更多詳細資訊,請查看參考檔案。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/389425.html
