3031323334353637
public void deleteMiniById(Integer id) throws MiniException { try { Mini mini = (Mini) baseDao.findById(Mini.class, id); baseDao.delete(mini); } catch (Exception e) { throw new MiniException("Mini删除异常"); } }
5354555657585960
mini.setCommentCount(0); mini.setFeedId(0); mini.setCreateTime(new Date()); baseDao.save(mini); } catch (Exception e) { throw new MiniException("Mini保存异常"); } }
949596979899100101
@Transactional public Mini findMiniById(Integer id) throws MiniException { try { return (Mini) baseDao.findById(Mini.class, id); } catch (Exception e) { throw new MiniException("Mini按ID查询异常"); } }
131132133134135136137138
} } else { return null; } } catch (Exception e) { throw new MiniException("Mini分页异常"); } }
149150151152153154155156
Object[] values = CommonDaoUtil.commonQuery(map); hql += values[0].toString(); // Object[]需要进行强制转换. return baseDao.find(hql, (Object[]) values[1]); } catch (Exception e) { throw new MiniException("查询Mini全部异常"); } }