Package br.com.procempa.modus.session

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


   */
  public static List<Usuario> getList() throws SearchException {
    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


            i++;
          }
        }
      }

      List<Persistent> list = pa.search(query, params, 20);
      for (Persistent persistent : list) {
        users.add((Usuario) persistent);
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      HashMap<String, Object> params = new HashMap<String, Object>();
      params.put("timestamp", date);
      params.put("now", new Date());
      List<Persistent> l = pa.search("from Usuario where timestamp <= :now and timestamp >= :timestamp",params);
     
      for (Persistent persistent : l) {
        Usuario user = (Usuario) persistent;
        users.add(user);
      }
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", usuario.getRg());
        List l = pa.search("from Usuario where rg = :rg", params);

        if (!l.isEmpty()) {
          list.add(new Validation(
              "J� existe um us�rio cadastrado com o RG \""
                  + usuario.getRg() + "\""));
View Full Code Here

    try {
      PersistentAccess pa = PersistentAccessFactory.getInstance();
      HashMap<String, Object> params = new HashMap<String, Object>();
      params.put("timestamp", date);
      params.put("now", new Date());
      List<Persistent> l = pa
          .search(
              "from Usuario where timestamp <= :now and timestamp >= :timestamp",
              params);

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

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

        if (!l.isEmpty()) {
          list.add(new Validation(
              "J� existe um usu�rio cadastrado com o email "
                  + usuario.getEmail()));
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()) {
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", usuario.getRg());
        List l = pa.search("from Usuario where rg = :rg", params);

        if (!l.isEmpty()) {
          list.add(new Validation(
              "J� existe um us�rio cadastrado com o RG \""
                  + usuario.getRg() + "\""));
View Full Code Here

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

        if (!l.isEmpty()) {
          list.add(new Validation(
              "J� existe um usu�rio cadastrado com o email "
                  + usuario.getEmail()));
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()) {
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.