mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
not useful
This commit is contained in:
@@ -37,15 +37,9 @@ public abstract class GenericDAO<T extends AbstractModel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void saveOrUpdate(Collection<? extends AbstractModel> models) {
|
public void saveOrUpdate(Collection<? extends AbstractModel> models) {
|
||||||
int i = 1;
|
|
||||||
Session session = em.unwrap(Session.class);
|
Session session = em.unwrap(Session.class);
|
||||||
for (AbstractModel model : models) {
|
for (AbstractModel model : models) {
|
||||||
session.saveOrUpdate(model);
|
session.saveOrUpdate(model);
|
||||||
|
|
||||||
if (i % 20 == 0) {
|
|
||||||
em.flush();
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user