Package br.com.procempa.modus.session

Examples of br.com.procempa.modus.session.PersistentAccess


    return presencas;
  }
 
  public static List<Presenca> getList(Turma turma) throws Exception {
    List<Presenca> presencas = new ArrayList<Presenca>();
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put("turma", turma);
    List<Persistent> list = pa.search("FROM Presenca WHERE inscricao.turma = :turma",params);
    for (Persistent persistent : list) {
      presencas.add((Presenca) persistent);
    }
    return presencas;
  }
View Full Code Here


    return presencas;
  }
 
  public static List<Presenca> getList(Inscricao inscricao) throws Exception {
    List<Presenca> presencas = new ArrayList<Presenca>();
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put("inscricao", inscricao);
    List<Persistent> list = pa.search("FROM Presenca WHERE inscricao = :inscricao",params);
    for (Persistent persistent : list) {
      presencas.add((Presenca) persistent);
    }
    return presencas;
  }
View Full Code Here

    return presencas;
  }
 
  public static List<Presenca> getList(Encontro encontro) throws Exception {
    List<Presenca> presencas = new ArrayList<Presenca>();
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put("encontro", encontro);
    List<Persistent> list = pa.search("FROM Presenca WHERE encontro = :encontro",params);
    for (Persistent persistent : list) {
      presencas.add((Presenca) persistent);
    }
    return presencas;
  }
View Full Code Here

    return presencas;
  }
 
  public static List<PresencaVO> getListVO(Turma turma) throws Exception {
    List<PresencaVO> presencas = new ArrayList<PresencaVO>();
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put("turma", turma);
    List<Persistent> list = pa
        .search(
            "FROM Presenca WHERE inscricao.turma = :turma ORDER BY inscricao.usuario.nome",
            params);
   
    Long idAnterior = new Long(-1);
View Full Code Here

    return presencas;
  }
 
  public static Presenca persist(Presenca presenca, List<String> messages)throws Exception  {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();

      presenca = (Presenca) pa.persist(presenca);

    } catch (Exception e) {
      e.printStackTrace();
      //throw new Exception(e.getClass().getName() + ": " + e.getMessage());
    }
View Full Code Here


  public static Presenca getPresenca(Long id) {
    Presenca presenca = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      presenca = (Presenca) pa.find(Presenca.class, id);
    } catch (Exception e) {
      e.printStackTrace();
    }
    return presenca;
  }
View Full Code Here

    return presenca;
  }

  public static void remove(Long id) throws Exception {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      Presenca presenca = (Presenca) pa.find(Presenca.class, id);
      pa.remove(presenca);
    } catch (Exception e) {
      throw new Exception(e.getClass().getName() + ": " + e.getMessage());
    }
  }
View Full Code Here

public class ConteudoDataServices implements DataServices{
   
  public static List<Conteudo> getList() throws Exception {
    List<Conteudo> conteudos = new ArrayList<Conteudo>();
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    List<Persistent> list = pa.search("FROM Conteudo");
    for (Persistent persistent : list) {
      conteudos.add((Conteudo) persistent);
    }
    return conteudos;
  }
View Full Code Here

    return conteudos;
  }
 
  public static List<Conteudo> getList(Curso curso) throws Exception {
    List<Conteudo> conteudos = new ArrayList<Conteudo>();
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put("curso", curso);
    List<Persistent> list = pa.search("FROM Conteudo WHERE curso = :curso",params);
    for (Persistent persistent : list) {
      conteudos.add((Conteudo) persistent);
    }
    return conteudos;
 
View Full Code Here

    return conteudos;
 
   
  public static Conteudo persist(Conteudo conteudo, List<String> messages)throws Exception  {
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();

      if (isValid(conteudo, messages)) {
        conteudo = (Conteudo) pa.persist(conteudo);
       
        List<Turma> turmas = TurmaDataServices.getList(conteudo.getCurso());
        for (Turma turma : turmas) {
          Encontro encontro = new Encontro();
          encontro.setTurma(turma);
          encontro.setConteudo(conteudo);
          encontro.setData("");
          encontro = (Encontro)pa.persist(encontro);
        }
       
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

TOP

Related Classes of br.com.procempa.modus.session.PersistentAccess

Copyright © 2018 www.massapicom. 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.