@Test public void deleteById() { H.saveOrUpdate(rootA()); Root root = createRequestForRootA().first(); assertThat(root).isNotNull(); H.deleteById(Root.class, root.getPid()); int count = createRequestForRootA().count(); assertThat(count).isEqualTo(0); }
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);  }