List of usage examples for javax.persistence FlushModeType AUTO
FlushModeType AUTO
To view the source code for javax.persistence FlushModeType AUTO.
Click Source Link
From source file:sf.net.experimaestro.scheduler.Scheduler.java
/** * Iterator on resources/*from w w w . j ava2 s .com*/ */ public CloseableIterable<Resource> resources() { final List<Resource> resultList = Transaction.evaluate(em -> { TypedQuery<Resource> query = em.createQuery("from resources", Resource.class); query.setFlushMode(FlushModeType.AUTO); return query.getResultList(); }); return new CloseableIterable<Resource>() { @Override public void close() throws CloseException { } @Override public Iterator<Resource> iterator() { return resultList.iterator(); } }; }