예제 #1
0
 @Override
 public ArrayList<TareaBean> getPage(
     int intRegsPerPag,
     int intPage,
     ArrayList<FilterBeanHelper> hmFilter,
     HashMap<String, String> hmOrder,
     Integer expand)
     throws Exception {
   strSQL += SqlBuilder.buildSqlWhere(hmFilter);
   strSQL += SqlBuilder.buildSqlOrder(hmOrder);
   strSQL += SqlBuilder.buildSqlLimit(oMysql.getCount(strSQL), intRegsPerPag, intPage);
   ArrayList<TareaBean> arrTarea = new ArrayList<>();
   try {
     ResultSet oResultSet = oMysql.getAllSql(strSQL);
     if (oResultSet != null) {
       while (oResultSet.next()) {
         TareaBean oTareaBean = new TareaBean();
         arrTarea.add(oTareaBean.fill(oResultSet, oConnection, expand));
       }
     }
   } catch (Exception ex) {
     ExceptionBooster.boost(
         new Exception(this.getClass().getName() + ":getPage ERROR: " + ex.getMessage()));
   }
   return arrTarea;
 }
 public ArrayList<ComentarioBean> getAllporusuario(
     int id_usuario,
     ArrayList<FilterBeanHelper> alFilter,
     HashMap<String, String> hmOrder,
     Integer expand)
     throws Exception {
   strSQL =
       "SELECT comentario.* from comentario, amistad where comentario.id_amistad= amistad.id and amistad.id_usuario2="
           + id_usuario;
   strSQL += SqlBuilder.buildSqlOrder(hmOrder);
   ArrayList<ComentarioBean> arrComentario = new ArrayList<>();
   try {
     ResultSet oResultSet = oMysql.getAllSql(strSQL);
     if (oResultSet != null) {
       while (oResultSet.next()) {
         ComentarioBean oComentarioBean = new ComentarioBean();
         arrComentario.add(oComentarioBean.fill(oResultSet, oConnection, expand));
       }
     }
   } catch (Exception ex) {
     ExceptionBooster.boost(
         new Exception(this.getClass().getName() + ":getPage ERROR: " + ex.getMessage()));
   }
   return arrComentario;
 }
 public ArrayList<ComentarioBean> getPagexidusuario(
     int id_usuario,
     int intRegsPerPag,
     int intPage,
     ArrayList<FilterBeanHelper> hmFilter,
     HashMap<String, String> hmOrder,
     Integer expand)
     throws Exception {
   // strSQL += SqlBuilder.buildSqlWhere(hmFilter);
   // strSQL += SqlBuilder.buildSqlOrder(hmOrder);
   strSQL =
       "select comentario.id, comentario.texto, comentario.fecha, comentario.id_amistad from comentario, amistad, usuario where ( usuario.id= amistad.id_usuario2) AND amistad.id = comentario.id_amistad AND usuario.id="
           + id_usuario;
   strSQL += SqlBuilder.buildSqlLimit(oMysql.getCount(strSQL), intRegsPerPag, intPage);
   ArrayList<ComentarioBean> arrComentario = new ArrayList<>();
   try {
     ResultSet oResultSet = oMysql.getAllSql(strSQL);
     if (oResultSet != null) {
       while (oResultSet.next()) {
         ComentarioBean oComentarioBean = new ComentarioBean();
         arrComentario.add(oComentarioBean.fill(oResultSet, oConnection, expand));
       }
     }
   } catch (Exception ex) {
     ExceptionBooster.boost(
         new Exception(this.getClass().getName() + ":getPage ERROR: " + ex.getMessage()));
   }
   return arrComentario;
 }
예제 #4
0
 @Override
 public int getCount(ArrayList<FilterBeanHelper> hmFilter) throws Exception {
   strSQL += SqlBuilder.buildSqlWhere(hmFilter);
   int pages = 0;
   try {
     pages = oMysql.getCount(strSQL);
   } catch (Exception ex) {
     ExceptionBooster.boost(
         new Exception(this.getClass().getName() + ":getCount ERROR: " + ex.getMessage()));
   }
   return pages;
 }