Пример #1
0
 @Override
 public List<Book> findByPage(int offset, int size, Integer[] total) {
   String hql = "from Book";
   return (List<Book>) HibernateUtil.findByPage(hql, offset, size, total);
 }
Пример #2
0
 private List<Book> findByProperty(String property, Object value) {
   String hql = "from Book as model where model." + property + "= ?";
   return HibernateUtil.find(hql, value);
 }
Пример #3
0
 @Override
 public List<Book> findAll() {
   String hql = "from Book";
   return (List<Book>) HibernateUtil.find(hql);
 }
Пример #4
0
 @Override
 public void update(Book book) {
   HibernateUtil.update(book);
 }
Пример #5
0
 @Override
 public Book findById(Integer id) {
   return (Book) HibernateUtil.get(Book.class, id);
 }
Пример #6
0
 @Override
 public void deleteById(Integer id) {
   HibernateUtil.deleteById(Book.class, id);
 }
Пример #7
0
 @Override
 public void delete(Book book) {
   HibernateUtil.delete(book);
 }
Пример #8
0
 @Override
 public void save(Book book) {
   HibernateUtil.save(book);
 }