Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 KB | None | 0 0
  1. package br.edu.ifpb.projeto.bean;
  2.  
  3. import javax.annotation.PostConstruct;
  4. import javax.faces.bean.ManagedBean;
  5. import javax.faces.bean.ViewScoped;
  6.  
  7. import br.edu.ifpb.projeto.dao.AlunoDAO;
  8. import br.edu.ifpb.projeto.model.Aluno;
  9.  
  10. @ManagedBean(name = "alunoBean")
  11. @ViewScoped
  12. public class AlunoBean {
  13.     private AlunoDAO alunoDao;
  14.     private Aluno aluno;
  15.     private String email;
  16.     private String nome;
  17.     private String competencias;   
  18.    
  19.     @PostConstruct
  20.     public void init() {
  21.         this.aluno = new Aluno();
  22.     }
  23.  
  24.     public String getEmail() {
  25.         return email;
  26.     }
  27.  
  28.     public void setEmail(String email) {
  29.         this.email = email;
  30.     }
  31.  
  32.     public String getNome() {
  33.         return nome;
  34.     }
  35.  
  36.     public void setNome(String nome) {
  37.         this.nome = nome;
  38.     }
  39.  
  40.  
  41.     public Aluno getAluno() {
  42.         return aluno;
  43.     }
  44.  
  45.     public void setAluno(Aluno aluno) {
  46.         this.aluno = aluno;
  47.     }
  48.    
  49.     public void atualizar(){
  50.         alunoDao = new AlunoDAO();
  51.         alunoDao.beginTransaction();
  52.         alunoDao.update(aluno);
  53.         alunoDao.commit();
  54.     }
  55.  
  56.     public String getCompetencias() {
  57.         return competencias;
  58.     }
  59.  
  60.     public void setCompetencias(String competencias) {
  61.         this.competencias = competencias;
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement