Package com.bolbachchan.blog.hibernate.domain

Examples of com.bolbachchan.blog.hibernate.domain.Posts


    @RequestMapping(method = RequestMethod.GET)
    public String get(@RequestParam(POST_ID) int postId, @ModelAttribute(FBB) UpdatePostForm fbb, Model model) {
  if (postId == 0) {
      return ERROR_PAGE_VIEW;
  }
  Posts post = userPostsService.getPostsByPostId(postId);
  fbb.setPost(post);
  model.addAttribute(FBB, fbb);

  return UPDATE_POST_VIEW;
    }
View Full Code Here


     * com.bolbachchan.blog.dao.posts.UserPostsDAO#saveNewPost(com.bolbachchan
     * .blog.dto.PostDTO)
     */
    @Override
    public void saveNewPost(PostDTO dto) {
  Posts post = null;
  Session session = null;
  try {
      session = getSessionFactory().getCurrentSession();
      post = new Posts();

      post.setUserDetails(dto.getUserDetails());
      post.setPostTitle(dto.getPostTitle());
      post.setPostContent(dto.getPostContent());

      Timestamp updateDt = new Timestamp(new Date().getTime());

      post.setCreateDt(updateDt);
      post.setUpdateDt(updateDt);

      LOG.debug("The new post is : " + post);

      int id = (Integer) session.save(post);

View Full Code Here

    }

    @Override
    public Posts getPostByPostId(int objId) {
  Query query = null;
  Posts post = new Posts();
  Map<String, Object> parameterMap = getParameterMap();
  parameterMap.put(OBJ_ID, objId);
  try {
      LOG.debug("Entering getPostByPostId >> UserPostsDAOImpl");
      query = getNamedQuery(GET_POST_BY_POST_ID, parameterMap);
View Full Code Here

    /**
     * @return the post
     */
    public Posts getPost() {
  if (post == null) {
      post = new Posts();
  }
  return post;
    }
View Full Code Here

TOP

Related Classes of com.bolbachchan.blog.hibernate.domain.Posts

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.