Package br.com.procempa.modus.session

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


    pa.remove(v);
  }

  public static void terminate(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Visita v = (Visita) pa.find(Visita.class, id);
    v.setDataFim(new Date());
    pa.persist(v);
  }

  public static List<Visita> getList() throws Exception {
View Full Code Here


public class VisitaDataServices implements DataServices {

  public static Visita getVisita(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Visita v = (Visita) pa.find(Visita.class, id);
    return v;
  }

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

    return true;
  }

  public static void remove(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Visita v = (Visita) pa.find(Visita.class, id);
    pa.remove(v);
  }

  public static Visita terminate(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
View Full Code Here

    pa.remove(v);
  }

  public static Visita terminate(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Visita v = (Visita) pa.find(Visita.class, id);
    v.setDataFim(new Date());
    v = (Visita) pa.persist(v);
    if (!v.isListaEspera()) {
      Equipamento eq = v.getEquipamento();
      EquipamentoDataServices.closeStation(eq);
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

public class TelecentroDataServices implements DataServices {

  public static Telecentro getTelecentro(Long 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(Long 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 void remove(Long id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Telecentro t = (Telecentro) pa.find(Telecentro.class, id);
      pa.remove(t);
    } catch (Exception e) {
      throw new Exception(e.getClass().getName() + ": " + e.getMessage());
    }
  }
View Full Code Here

public class UsuarioDataServices implements DataServices {

  public static Usuario getUsuario(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    Usuario u = (Usuario) pa.find(Usuario.class, id);
    return u;
  }

  public static Usuario getUsuarioByRg(String rg) throws UsuarioException {
    Usuario u = null;
View Full Code Here

   */
  public static Equipamento getEquipamento(Long 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

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.