Esempio n. 1
0
 @Override
 public List<Mblog> getMyFoucs(User user) {
   // TODO Auto-generated method stub
   user = userDAO.findById(user.getUserId());
   Set<Follow> myFollows = user.getFollowsForUserId();
   List<Mblog> list = new ArrayList<Mblog>();
   for (Follow follow : myFollows) {
     User us = follow.getUserByFollowedUserId();
     List li = mblogDAO.findByProperty("user", us);
     list.addAll(li);
   }
   List li = mblogDAO.findByProperty("user", user);
   list.addAll(li);
   return sortByTime(list);
 }
Esempio n. 2
0
 @Override
 public Mblog addMblog(User user, String content) {
   user = userDAO.findById(user.getUserId());
   Mblog mblog = new Mblog(user, content, new Timestamp(System.currentTimeMillis()));
   mblogDAO.save(mblog);
   return mblog;
 }
Esempio n. 3
0
 @Override
 public List<Mblog> getByUser(User user) {
   user = userDAO.findById(user.getUserId());
   List list = mblogDAO.findByProperty("user", user);
   return sortByTime(list);
 }