简体   繁体   中英

HibernateCursorItemReader with Hibernate Detached criteria

如何在Spring Batch的“ HibernateCursorItemReader”中使用休眠独立条件?

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM