Package com.freewebsys.sns.pojo

Examples of com.freewebsys.sns.pojo.Friend


  @Transactional
  public void deleteFriendById(Integer userId, Integer friendId)
      throws FriendException {
    try {
      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删除异常");
    }
View Full Code Here


  @Transactional
  public void saveFriend(Friend friend) throws FriendException {
    try {

      String hql = " from Friend friend where friend.userId = ? and friend.friend.id = ? ";
      Friend friendTemp = (Friend) baseDao.findFirstOne(hql,
          friend.getUserId(), friend.getFriend().getId());
      if (friendTemp == null) {// 特殊情况会提交2次。就记录一次数据。
        friend.setCreateTime(new Date());
        friend.setStatus(0);
        baseDao.save(friend);
View Full Code Here

  }

  @Override
  public int findIsFriend(Integer userId, Integer friendId) {
    String hql = " from Friend friend where friend.userId = ? and friend.friend.id = ?";
    Friend friend = (Friend) baseDao.findFirstOne(hql, userId, friendId);
    if (friend == null || friend.getStatus() == null) {
      return -1;
    } else {
      return friend.getStatus().intValue();
    }
  }
View Full Code Here

   */
  public void saveFriend() throws Exception {
    int state = friendService.findIsFriend(getSessionUserInfo().getId(),
        friendId);
    if (state == -1) {
      friend = new Friend();
      // 帮定好友用户
      userInfo = new UserInfo();
      userInfo.setId(friendId);
      friend.setFriend(userInfo);
      // 设置我的Id
View Full Code Here

TOP

Related Classes of com.freewebsys.sns.pojo.Friend

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.