@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);