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

segundoMB

By: a guest on Apr 26th, 2011  |  syntax: Java  |  size: 1.22 KB  |  views: 41  |  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.Name;
  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.business.UsercaseBC;
  10. import br.ufpe.nti.usercase.domain.Usercase;
  11.  
  12. @ViewController
  13. @Name(value="usercaseEditMB")
  14. public class UsercaseEditMB extends AbstractEditPageBean<Usercase, Long> {
  15.  
  16.         private static final long serialVersionUID = 8427680238665579004L;
  17.  
  18.         @Inject
  19.         private UsercaseBC bc;
  20.         @Inject
  21.         private DocumentBC documentBC;
  22.        
  23.         private Long documentId;
  24.        
  25.         @Override
  26.         public String delete() {
  27.                 this.bc.delete(super.getId());
  28.                 return null;
  29.         }
  30.  
  31.         @Override
  32.         public String insert() {
  33.                 this.bc.insert(super.getBean());
  34.                 return null;
  35.         }
  36.  
  37.         @Override
  38.         public String update() {
  39.                 this.bc.update(super.getBean());
  40.                 return null;
  41.         }
  42.  
  43.         @Override
  44.         protected void handleLoad() {
  45.                 super.setBean(this.bc.load(super.getId()));
  46.         }
  47.        
  48.         public void setDocumentId(Long documentId) {
  49.                 this.documentId = documentId;
  50.                 this.getBean().setDocument(this.documentBC.load(documentId));
  51.         }
  52.  
  53. }
clone this paste RAW Paste Data