//	**** update  ****
 public ApplicationRewardReqTeam update() throws Exception {
   DB db = this.initDB();
   try {
     String parameter = "";
     List<Object> objList = new ArrayList<Object>();
     for (int i = 0; i < ALL_COLUMNS.length; i++) {
       if (ALL_COLUMNS[i] != pkCol) { // cannot set pkCol
         Object value = PropertyUtils.getProperty(this, ALL_COLUMNS[i].toLowerCase());
         // if( value != null ){
         parameter += ALL_COLUMNS[i] + "=?,";
         objList.add(value);
         // }
       } else objList.add(this.id); // pk
     }
     if (parameter.length() > 0) {
       String sql_update = SQL_UPDATE + parameter.substring(0, parameter.lastIndexOf(","));
       // System.out.println(sql_update);
       // System.out.println("obj"+objList);
       prep =
           db.getParameterizedStatement(
               db.appendWhere(sql_update, pkCol + "=?"), objList.toArray());
       if (prep.executeUpdate() == 1) return (ApplicationRewardReqTeam) this;
     } else // not update
     return (ApplicationRewardReqTeam) this;
   } catch (Exception e) {
     throw e;
   } finally {
     this.closeDB(db);
   }
   return null;
 }
 public Integer deleteByWhere(String where, Object[] objs) throws Exception {
   DB db = this.initDB();
   try {
     prep = db.getParameterizedStatement(db.appendWhere(SQL_DELETE, where), objs);
     return prep.executeUpdate();
   } catch (Exception e) {
     throw e;
   } finally {
     this.closeDB(db);
   }
 }
  public synchronized ApplicationRewardReqTeam create() throws Exception {
    DB db = this.initDB();
    try {
      String columns = "(";
      String parameter = "(";
      List<Object> objList = new ArrayList<Object>();
      for (int i = 0; i < ALL_COLUMNS.length; i++) {
        if (ALL_COLUMNS[i] != pkCol) {
          Object value = PropertyUtils.getProperty(this, ALL_COLUMNS[i].toLowerCase());
          if (value != null) {
            columns += ALL_COLUMNS[i] + ",";
            parameter += "?,";
            objList.add(value);
          }
        }
      }
      String sql_insert =
          SQL_INSERT + columns + pkCol + ") values " + parameter + SEQUENCE_NAME + ".nextVal)";
      // System.out.println("sql-->"+sql_insert);
      // System.out.println(objList);

      prep = db.getParameterizedStatement(sql_insert, objList.toArray());
      // logger.debug(SQL_INSERT);
      if (prep.executeUpdate() == 1) {
        prep = db.getParameterizedStatement(db.getIdentityString(SEQUENCE_NAME), null);
        rs = prep.executeQuery();
        if (rs.next()) {
          this.id = new Long(rs.getString(1));
          return (ApplicationRewardReqTeam) this;
        }
      }
    } catch (SQLException e) {
      e.printStackTrace();
    } finally {
      this.closeDB(db);
    }
    return null;
  }
 public Integer countByWhere(String where, Object[] objs) throws Exception {
   DB db = this.initDB();
   Integer result = null;
   try {
     prep = db.getParameterizedStatement(db.appendWhere(SQL_COUNT, where), objs);
     rs = prep.executeQuery();
     if (rs.next()) result = rs.getInt(1);
   } catch (Exception e) {
     throw e;
   } finally {
     this.closeDB(db);
   }
   return result;
 }
 public List<MODULE> findByWhere(String where, Object[] objs, PageUtil pageUtil) throws Exception {
   DB db = this.initDB();
   List<MODULE> resultList = new ArrayList<MODULE>();
   try {
     if (pageUtil == null) {
       prep = db.getParameterizedStatement(db.appendWhere(SQL_SELECT, where), objs);
       rs = prep.executeQuery();
       while (rs.next()) resultList.add(this.populate(rs));
     } else {
       String sql = db.appendWhere(SQL_SELECT, where); // build sql
       prep = db.getPagination(sql, objs, pageUtil.getPage(), pageUtil.getPageSize());
       rs = prep.executeQuery();
       while (rs.next()) resultList.add(this.populate(rs));
     }
   } catch (Exception e) {
     throw e;
   } finally {
     this.closeDB(db);
   }
   return resultList;
 }