Package br.com.procempa.modus.session

Examples of br.com.procempa.modus.session.PersistentAccess.find()


  }

  public static void remove(String id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Curso curso = (Curso) pa.find(Curso.class, id);
   
      List<Inscricao> inscritos = InscricaoDataServices.getList(curso);
      if (inscritos.isEmpty()){

        List<Conteudo> conteudos = ConteudoDataServices.getList(curso);
View Full Code Here


   */
  public static Equipamento getEquipamento(String id) {
    Equipamento eq = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      eq = (Equipamento) pa.find(Equipamento.class, id);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return eq;
  }
View Full Code Here

   * @throws Exception
   */
  public static void remove(String id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Equipamento eq = (Equipamento) pa.find(Equipamento.class, id);
      if (!EquipamentoDataServices.temVisita(eq)) {
        eq.setStatus(Status.EXCLUIDO);
        pa.persist(eq);
      }
    } catch (Exception e) {
View Full Code Here

public class TelecentroDataServices implements DataServices {

  public static Telecentro getTelecentro(String id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Telecentro t = (Telecentro) pa.find(Telecentro.class, id);
    return t;
  }

  public static Telecentro persist(Telecentro t, List<String> messages)
      throws Exception {
View Full Code Here

  }

  public static void remove(String id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Telecentro t = (Telecentro) pa.find(Telecentro.class, id);
      t.setStatus(Status.EXCLUIDO);
      pa.persist(t);
    } catch (Exception e) {
      throw new Exception(e.getClass().getName() + ": " + e.getMessage());
    }
View Full Code Here

 
  public static FilaInscricao getListaEspera(String id) {
    FilaInscricao listaEspera = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      listaEspera = (FilaInscricao) pa.find(FilaInscricao.class, id);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return listaEspera;
  }
View Full Code Here

  }

  public static void remove(String id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      FilaInscricao le = (FilaInscricao) pa.find(FilaInscricao.class, id);
      le.setStatus(Status.EXCLUIDO);
      pa.persist(le);

      // TODO Ao remover algu�m da lista de espera,
      // deve se alterar a ordem dos outros na lista de espera
View Full Code Here

  public static Turma getTurma(String id) {
    Turma turma = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      turma = (Turma) pa.find(Turma.class, id);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return turma;
  }
View Full Code Here

  }
 
  public static void remove(String id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Turma turma = (Turma) pa.find(Turma.class, id);
     
      List<Inscricao> inscritos = InscricaoDataServices.getList(turma);
      if (inscritos.isEmpty()){
        for (Inscricao inscrito : inscritos) {
          InscricaoDataServices.remove(inscrito.getId());
View Full Code Here

  public static Turma getTurma(Long id) {
    Turma turma = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      turma = (Turma) pa.find(Turma.class, id);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return turma;
  }
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.