2930313233343536
String hql = " from Friend friend where friend.userId = ? and friend.friend.id = ?"; Friend friend = (Friend) baseDao .findFirstOne(hql, userId, friendId); baseDao.delete(friend); } catch (Exception e) { throw new FriendException("Friend删除异常"); } }
5051525354555657
friend.setCreateTime(new Date()); friend.setStatus(0); baseDao.save(friend); } } catch (Exception e) { throw new FriendException("Friend保存异常"); } }
6364656667686970
@Transactional public Friend findFriendById(Integer id) throws FriendException { try { return (Friend) baseDao.findById(Friend.class, id); } catch (Exception e) { throw new FriendException("Friend按ID查询异常"); } }
100101102103104105106107
System.out.println(status); } } return pageConf; } catch (Exception e) { throw new FriendException("Friend分页异常"); } }
119120121122123124125126
Object[] values = CommonDaoUtil.commonQuery(map); hql += values[0].toString(); // Object[]需要进行强制转换. return baseDao.findPage(start, limit, hql, (Object[]) values[1]); } catch (Exception e) { throw new FriendException("Friend分页异常"); } }
137138139140141142143144
Object[] values = CommonDaoUtil.commonQuery(map); hql += values[0].toString(); // Object[]需要进行强制转换. return baseDao.find(hql, (Object[]) values[1]); } catch (Exception e) { throw new FriendException("查询Friend全部异常"); } }
159160161162163164165166
try { String hql = " select module from UserInfo module where module.name = ? "; // 通用查询匹配 return baseDao.findPage(start, limit, hql, name); } catch (Exception e) { throw new FriendException("查询Friend异常"); } }