2526272829303132
public void deleteCommentById(Integer id) throws CommentException { try{ Comment comment = (Comment) baseDao.findById(Comment.class, id); baseDao.delete(comment); } catch (Exception e) { throw new CommentException("Comment删除异常"); } }
3839404142434445
@Transactional public void saveComment(Comment comment) throws CommentException { try { baseDao.save(comment); } catch (Exception e) { throw new CommentException("Comment保存异常"); } }
5152535455565758
@Transactional public Comment findCommentById(Integer id) throws CommentException { try { return (Comment) baseDao.findById(Comment.class, id); } catch (Exception e) { throw new CommentException("Comment按ID查询异常"); } }
7071727374757677
hql += values[0].toString(); // Object[]需要进行强制转换. hql += " order by module.createTime desc "; return baseDao.findPage(start, limit, hql, (Object[]) values[1]); } catch (Exception e) { throw new CommentException("Comment分页异常"); } }
8889909192939495
Object[] values = CommonDaoUtil.commonQuery(map); hql += values[0].toString(); // Object[]需要进行强制转换. return baseDao.find(hql, (Object[]) values[1]); } catch (Exception e) { throw new CommentException("查询Comment全部异常"); } }