Пример #1
0
 public List<Topic> getTopicsForCategory(String id) {
   List<Topic> topics = this.repository.getTopicsForCategory(id);
   for (Topic topic : topics) {
     topic.setCommentsCount(repository.getCommentsCount(topic.getId()));
   }
   return topics;
 }
Пример #2
0
  public void insertTopic(Topic topic) {
    Date date = new Date();
    DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM);
    topic.setDate(df.format(date));

    this.repository.insert(topic);
  }