1
我試圖使用HibernateCursorItemReader我在春天批次(一種用於建築的原因,我不能用JpaPagingItemReader
,因爲我並不需要分頁)。但是,問題是我必須設置會話工廠,在我的情況下,我只有entityManagerFactory
。不幸的是,我只能使用XML配置來達到這個目的。我知道,在Java代碼中,我們可以轉換這樣的:使用HibernateCursorItemReader與entityManagerFactory的
Session session = manager.unwrap(Session.class);
sessionFactory = session.getSessionFactory();
如何設置我的sessionFactory
財產在我HibernateCursorItemReader
?如果我必須從entityManagerFactory
轉換爲SessionFactory
?我怎樣才能直接在XML配置?