Example #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);
 }
Example #2
0
 private List<Book> findByProperty(String property, Object value) {
   String hql = "from Book as model where model." + property + "= ?";
   return HibernateUtil.find(hql, value);
 }
Example #3
0
 @Override
 public List<Book> findAll() {
   String hql = "from Book";
   return (List<Book>) HibernateUtil.find(hql);
 }
Example #4
0
 @Override
 public void update(Book book) {
   HibernateUtil.update(book);
 }
Example #5
0
 @Override
 public Book findById(Integer id) {
   return (Book) HibernateUtil.get(Book.class, id);
 }
Example #6
0
 @Override
 public void deleteById(Integer id) {
   HibernateUtil.deleteById(Book.class, id);
 }
Example #7
0
 @Override
 public void delete(Book book) {
   HibernateUtil.delete(book);
 }
Example #8
0
 @Override
 public void save(Book book) {
   HibernateUtil.save(book);
 }