Examples of NewsFactory


Examples of com.gracevallorani.jpa.factories.NewsFactory

    form.setId(id);
   
    if (id != 0) {
      News news;
     
      IJpaFactory<News> strategy = new NewsFactory(new J2eeConfig());
     
      try {
        news = strategy.get(id);           
      } finally {
        strategy.close();
      }

      form.setBrowseout(news.isBrowseout());
      form.setContent(news.getContent());
      form.setStamp(news.getStamp());
View Full Code Here

Examples of com.gracevallorani.jpa.factories.NewsFactory

    if (result.hasErrors()) {
      return JSP_EDIT;
    }
   
    News news;
    IJpaFactory<News> strategy = new NewsFactory(new J2eeConfig());
    strategy.setTransactional(true);
   
    try {
      if (form.getId() == 0) {
        news = new News();
      } else {
        news = strategy.get(form.getId());
      }     

      news.setBrowseout(form.isBrowseout());
      news.setContent(form.getContent());
      news.setStamp(form.getStamp());
      news.setTitle(form.getTitle());
      news.setUrl(form.getUrl());

      if (form.getId() == 0) {
        strategy.add(news);             
      } else {
        strategy.refresh(news);
     
    } finally {
      strategy.close();
    }
       
    return JSP_DISPLAY;   
  }
View Full Code Here

Examples of com.gracevallorani.jpa.factories.NewsFactory

    return JSP_DISPLAY;   
  }

  @RequestMapping(value = "/admin/news/delete", method = RequestMethod.GET)
  public String getDelete(@RequestParam(value = "id", required = true, defaultValue = "0") int id) throws Exception {   
    IJpaFactory<News> strategy = new NewsFactory(new J2eeConfig());
       
    try {
      News news = strategy.get(id);
      strategy.setTransactional(true);
      strategy.delete(news);
    } finally {
      strategy.close();
    }
 
    return JSP_DISPLAY;   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.