2526272829303132
public void deleteBlogCategoryById(Integer id) throws BlogCategoryException { try{ BlogCategory blogCategory = (BlogCategory) baseDao.findById(BlogCategory.class, id); baseDao.delete(blogCategory); } catch (Exception e) { throw new BlogCategoryException("BlogCategory删除异常"); } }
3839404142434445
@Transactional public void saveBlogCategory(BlogCategory blogCategory) throws BlogCategoryException { try { baseDao.save(blogCategory); } catch (Exception e) { throw new BlogCategoryException("BlogCategory保存异常"); } }
5152535455565758
@Transactional public BlogCategory findBlogCategoryById(Integer id) throws BlogCategoryException { try { return (BlogCategory) baseDao.findById(BlogCategory.class, id); } catch (Exception e) { throw new BlogCategoryException("BlogCategory按ID查询异常"); } }
6970717273747576
Object[] values = CommonDaoUtil.commonQuery(map); hql += values[0].toString(); // Object[]需要进行强制转换. return baseDao.findPage(start, limit, hql, (Object[]) values[1]); } catch (Exception e) { throw new BlogCategoryException("BlogCategory分页异常"); } }
8788899091929394
Object[] values = CommonDaoUtil.commonQuery(map); hql += values[0].toString(); // Object[]需要进行强制转换. return baseDao.find(hql, (Object[]) values[1]); } catch (Exception e) { throw new BlogCategoryException("查询BlogCategory全部异常"); } }