Package br.com.procempa.modus.session

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


    List<FilaInscricao> listaEspera = new ArrayList<FilaInscricao>();
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put("curso", curso);

    List<Persistent> list = pa.search(
        "FROM FilaInscricao WHERE curso= :curso ORDER BY ordem", params);
    for (Persistent persistent : list) {
      listaEspera.add((FilaInscricao) persistent);
    }
    return listaEspera;
View Full Code Here


    HashMap<String, Object> params = new HashMap<String, Object>();
   
    params.put("dataInicio", new Timestamp(dataInicial));
    params.put("dataFim", new Timestamp(dataFinal))
   
    List<Persistent> list = pa
        .search(
            "FROM ExceptionLog WHERE timestamp >= :dataInicio AND timestamp <= :dataFim",
            params);

    for (Persistent persistent : list) {
View Full Code Here

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

    Usuario u = null;
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      HashMap<String, Object> params = new HashMap<String, Object>();
      params.put("rg", rg);
      List<Persistent> l = pa.search("from Usuario where rg = :rg", params);
      if (!l.isEmpty()) {
        u = (Usuario) l.get(0);
      }
    } catch (Exception e) {
      throw new UsuarioException(e.getClass().getName() + ": "
View Full Code Here

   */
  public static List<Usuario> getList() throws UsuarioException {
    List<Usuario> users = new ArrayList<Usuario>();
    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      List<Persistent> list = pa.search("from Usuario");
      for (Persistent persistent : list) {
        users.add((Usuario) persistent);
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

  public static void removeUsuario(Long id) throws Exception {
    PersistentAccess pa = PersistentAccessFactory.getInstance();
    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put("id", id);
    List<Persistent> users = pa.search("from Usuario as u left join fetch u.visitaList where u.id = :id", params);

    if (!users.isEmpty()) {
      Usuario u = (Usuario) users.get(0);
      if (u.getVisitaList().isEmpty()) {
        pa.remove(u);
View Full Code Here

      // usu�rio com o mesmo RG
      if (isInsert) {
        PersistentAccess pa = PersistentAccessFactory.getInstance();
        HashMap<String, Object> params = new HashMap<String, Object>();
        params.put("rg", u.getRg());
        List l = pa.search("from Usuario where rg = :rg", params);

        if (!l.isEmpty()) {
          messages.add("J� existe um usu�rio cadastrado com o RG "
              + u.getRg());
          status = false;
View Full Code Here

    if (isInsert && StringUtils.isNotEmpty(u.getEmail())) {
      if (isValidEmail(u.getEmail())) {
        PersistentAccess pa = PersistentAccessFactory.getInstance();
        HashMap<String, Object> params = new HashMap<String, Object>();
        params.put("email", u.getEmail());
        List l = pa.search("from Usuario where email= :email", params);

        if (!l.isEmpty()) {
          messages.add("J� existe um usu�rio cadastrado com o email "
              + u.getEmail());
          status = false;
View Full Code Here

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

  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

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.