Want more features on Pastebin? Sign Up, it's FREE!
Guest

primeiroMB

By: a guest on Apr 26th, 2011  |  syntax: Java  |  size: 1.00 KB  |  views: 77  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package br.ufpe.nti.usercase.view;
  2.  
  3. import javax.inject.Inject;
  4.  
  5. import br.gov.frameworkdemoiselle.annotation.PreviousView;
  6. import br.gov.frameworkdemoiselle.stereotype.ViewController;
  7. import br.gov.frameworkdemoiselle.template.AbstractEditPageBean;
  8. import br.ufpe.nti.usercase.business.DocumentBC;
  9. import br.ufpe.nti.usercase.domain.Document;
  10.  
  11. @ViewController
  12. @PreviousView("/document_list.xhtml")
  13. public class DocumentEditMB extends AbstractEditPageBean<Document, Long> {
  14.  
  15.         private static final long serialVersionUID = -3148805410193764865L;
  16.  
  17.         @Inject
  18.         private DocumentBC bc;
  19.        
  20.         @Override
  21.         public String delete() {
  22.                 this.bc.delete(super.getId());
  23.                 return getPreviousView();
  24.         }
  25.  
  26.         @Override
  27.         public String insert() {
  28.                 this.bc.insert(super.getBean());
  29.                 return getPreviousView();
  30.         }
  31.  
  32.         @Override
  33.         public String update() {
  34.                 this.bc.update(super.getBean());
  35.                 return getPreviousView();
  36.         }
  37.  
  38.         @Override
  39.         protected void handleLoad() {
  40.                 super.setBean(this.bc.load(super.getId()));
  41.         }
  42.        
  43. }
clone this paste RAW Paste Data