Exemplo n.º 1
0
 /** Blog按ID查询 */
 @Override
 @Transactional
 public Blog findBlogById(Integer id) throws BlogException {
   try {
     return (Blog) baseDao.findById(Blog.class, id);
   } catch (Exception e) {
     throw new BlogException("Blog按ID查询异常");
   }
 }
Exemplo n.º 2
0
 /** Blog删除 */
 @Override
 @Transactional
 public void deleteBlogById(Integer id) throws BlogException {
   try {
     Blog blog = (Blog) baseDao.findById(Blog.class, id);
     baseDao.delete(blog);
   } catch (Exception e) {
     throw new BlogException("Blog删除异常");
   }
 }