Exemplo n.º 1
0
  @Override
  public Integer set(TareaBean oTareaBean) throws Exception {
    Integer iResult = null;
    try {
      if (oTareaBean.getId() == 0) {
        strSQL = "INSERT INTO " + strTable + " ";
        strSQL += "(" + oTareaBean.getColumns() + ")";
        strSQL += "VALUES(" + oTareaBean.getValues() + ")";
        iResult = oMysql.executeInsertSQL(strSQL);
      } else {
        strSQL = "UPDATE " + strTable + " ";
        strSQL += " SET " + oTareaBean.toPairs();
        strSQL += " WHERE id=" + oTareaBean.getId();
        iResult = oMysql.executeUpdateSQL(strSQL);
      }

    } catch (Exception ex) {
      ExceptionBooster.boost(
          new Exception(this.getClass().getName() + ":set ERROR: " + ex.getMessage()));
    }
    return iResult;
  }