Package org.netcools.forum.model

Examples of org.netcools.forum.model.Topics


    this.topicsDao = topicsDao;
  }

  @Override
  public List<Posts> findPostsByTopic(int topicId) {
    Topics topic = new Topics();
    topic.setId(topicId);
    return postsDao.findByTopic(topic);
  }
View Full Code Here


      post.setPostsText(new PostsText());
      post.setPostTime(new Date());
      post.setPostEditCount(1);
      post.getPostsText().setPost(post);
      post.setForum(new Forums(forumId));
      post.setTopic(new Topics(topicId));
      post.setUser(new Users(userId));
    } else {
      post.setPostEditCount(post.getPostEditCount() + 1);
    }
   
View Full Code Here

  }

  @Override
  public void addTopics(String subject, String text, int forumId,
      Integer userId, String posterIp) {
    Topics topic = new Topics();
   
    Forums forum = new Forums();
    forum.setId(forumId);
   
    PostsText postsText = new PostsText();
    postsText.setSubject(subject);
    postsText.setText(text);
   
    Posts post = new Posts();
    post.setForum(forum);
    post.setPostEditCount(1);
    Date date = new Date();
    post.setPostEditTime(date);
    post.setPosterIp(posterIp);
    post.setPostsText(postsText);
    post.setPostTime(date);
    post.setTopic(topic);
   
    postsText.setPost(post);
   
    Users user = new Users();
    userId = 3;
    user.setId(userId);
    post.setUser(user);
   
    topic.setVoteDesc(new VoteDesc(0));
   
    topic.setTitle(subject);
    topic.setForum(forum);
    topic.getPosts().add(post);
    topic.setFirstPost(post);
    topic.setLastPost(post);
    topic.setUser(user);
   
    topicsDao.save(topic);
  }
View Full Code Here

TOP

Related Classes of org.netcools.forum.model.Topics

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.