문제

How to use hibernate detached criteria with "HibernateCursorItemReader" of spring batch?

도움이 되었습니까?

해결책

A solution could be the following:

  1. create a custom HibernateDetachedCriteriaItemReader<> extends AbstractItemCountingItemStreamItemReader<>
  2. add a property Criteria criteria and inject it before use
  3. rewrite all do*() functions to manage resultset lifecycle

Or extends from HibernateCursorItemReader and override doOpen() to let working in dual-mode (normal,with detached criteria)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top