2526272829303132
public void deletePhotoAlbumById(Integer id) throws PhotoAlbumException { try{ PhotoAlbum photoAlbum = (PhotoAlbum) baseDao.findById(PhotoAlbum.class, id); baseDao.delete(photoAlbum); } catch (Exception e) { throw new PhotoAlbumException("PhotoAlbum删除异常"); } }
3839404142434445
@Transactional public void savePhotoAlbum(PhotoAlbum photoAlbum) throws PhotoAlbumException { try { baseDao.save(photoAlbum); } catch (Exception e) { throw new PhotoAlbumException("PhotoAlbum保存异常"); } }
5152535455565758
@Transactional public PhotoAlbum findPhotoAlbumById(Integer id) throws PhotoAlbumException { try { return (PhotoAlbum) baseDao.findById(PhotoAlbum.class, id); } catch (Exception e) { throw new PhotoAlbumException("PhotoAlbum按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 PhotoAlbumException("PhotoAlbum分页异常"); } }
8788899091929394
Object[] values = CommonDaoUtil.commonQuery(map); hql += values[0].toString(); // Object[]需要进行强制转换. return baseDao.find(hql, (Object[]) values[1]); } catch (Exception e) { throw new PhotoAlbumException("查询PhotoAlbum全部异常"); } }