/**
  * Atualizar periodo.
  *
  * @param p the p
  * @return the periodo
  */
 public Periodo atualizarPeriodo(Periodo p) {
   PersistenceContext pc = DAOFactory.createPersistenceContext();
   PeriodoDAO dao = DAOFactory.getPeriodoDAO(pc);
   dao.atualizar(p);
   pc.commitAndClose();
   return p;
 }
 public List<Periodo> listarPeriodo(String p) {
   PersistenceContext pc = DAOFactory.createPersistenceContext();
   PeriodoDAO dao = DAOFactory.getPeriodoDAO(pc);
   List<Periodo> result = dao.listByPeriodo(p);
   pc.commitAndClose();
   return result;
 }
 /**
  * Listarkey.
  *
  * @param key the key
  * @return the list
  */
 public List<Periodo> listarkey(int key) {
   PersistenceContext pc = DAOFactory.createPersistenceContext();
   PeriodoDAO dao = DAOFactory.getPeriodoDAO(pc);
   List<Periodo> result = dao.listarKey(key);
   pc.commitAndClose();
   return result;
 }