@Test public void saveOrUpdate() { Root root = rootA(); assertThat(H.saveOrUpdate(root)).isSameAs(root); int countNew = createRequestForRootA().count(); assertThat(countNew).isEqualTo(1); H.saveOrUpdate(root); int countUpdated = createRequestForRootA().count(); assertThat(countUpdated).isEqualTo(1); }
public static <T> T saveOrUpdate(final T entity) { return HibernateSessionFactory.doInTransaction(new IRequest<T>() { @Override public T doInTransaction(Session session) { session.saveOrUpdate(entity); return entity; } }); }
HibernateObjectQuery { public static <T> T saveOrUpdate(final T entity) { return HibernateSessionFactory.doInTransaction(new IRequest<T>() { @Override public T doInTransaction(Session session) { session.saveOrUpdate(entity); return entity; } }); } }
HibernateObjectQuery { public static <T> T saveOrUpdate(final T entity) { return HibernateSessionFactory.doInTransaction(new IRequest<T>() { @Override public T doInTransaction(Session session) { session.saveOrUpdate(entity); return entity; } }); }  }
HibernateObjectQuery { public static <T> T saveOrUpdate(final T entity) { return HibernateSessionFactory.doInTransaction(new IRequest<T>() { @Override public T doInTransaction(Session session) { session.saveOrUpdate(entity); return entity; } }); }  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> T saveOrUpdate(final T entity) { return HibernateSessionFactory.doInTransaction(new IRequest<T>() { @Override public T doInTransaction(Session session) { session.saveOrUpdate(entity); return entity; } }); }  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);  }