Ejemplo n.º 1
0
 public static String unreadIndicator(String userId) {
   String retVal = "";
   try {
     long lUserId = Long.valueOf(userId);
     String query =
         "select count(distinct m) from MessageCenter mc join mc.inbox m where m.messageProperties.isRead = ? and mc.owner.id = ?";
     long count = MessageCenter.count(query, false, lUserId);
     retVal = count != 0 ? "*" : "";
   } catch (Exception e) {
     cLogger.error("The user is incorrect '" + userId + "'");
   }
   return retVal;
 }
Ejemplo n.º 2
0
 public static MessageCenter findByUserId(Long id) {
   String query = "select mc from MessageCenter mc where mc.owner.id = ?";
   MessageCenter messageCenter = MessageCenter.find(query, id).first();
   return messageCenter;
 }