@Test public void saveOrUpdateAll() { List<Root> roots = rootsAB(); assertThat(H.saveOrUpdateAll(roots)).containsExactlyElementsOf(roots); int count = createRootRequest().count(); assertThat(count).isEqualTo(2); }
public static <T> Iterable<T> saveOrUpdateAll(final Iterable<T> entities) { return HibernateSessionFactory.doInTransaction(new IRequest<Iterable<T>>() { @Override public Iterable<T> doInTransaction(Session session) { for (T entity : entities) { session.saveOrUpdate(entity); } return entities; } }); }
HibernateObjectQuery { public static <T> Iterable<T> saveOrUpdateAll(final Iterable<T> entities) { return HibernateSessionFactory.doInTransaction(new IRequest<Iterable<T>>() { @Override public Iterable<T> doInTransaction(Session session) { for (T entity : entities) { session.saveOrUpdate(entity); } return entities; } }); } }
HibernateObjectQuery { public static <T> Iterable<T> saveOrUpdateAll(final Iterable<T> entities) { return HibernateSessionFactory.doInTransaction(new IRequest<Iterable<T>>() { @Override public Iterable<T> doInTransaction(Session session) { for (T entity : entities) { session.saveOrUpdate(entity); } return entities; } }); }  }
HibernateObjectQuery { public static <T> Iterable<T> saveOrUpdateAll(final Iterable<T> entities) { return HibernateSessionFactory.doInTransaction(new IRequest<Iterable<T>>() { @Override public Iterable<T> doInTransaction(Session session) { for (T entity : entities) { session.saveOrUpdate(entity); } return entities; } }); }  static T save(final T entity); static T saveOrUpdate(final T entity); static Iterable<T> saveAll(final Iterable<T> entities); static Iterable<T> saveOrUpdateAll(final Iterable<T> entities); static void delete(final T entity); static void deleteAll(final Iterable<T> entities); }
HibernateObjectQuery { public static <T> Iterable<T> saveOrUpdateAll(final Iterable<T> entities) { return HibernateSessionFactory.doInTransaction(new IRequest<Iterable<T>>() { @Override public Iterable<T> doInTransaction(Session session) { for (T entity : entities) { session.saveOrUpdate(entity); } return entities; } }); }  static T save(final T entity); static T saveOrUpdate(final T entity); static Iterable<T> saveAll(final Iterable<T> entities); static Iterable<T> saveOrUpdateAll(final Iterable<T> entities); static void delete(final T entity); static void deleteAll(final Iterable<T> entities);  }