Esempio n. 1
0
 /**
  * loadParameters Sets MID, FID (which is auto-incremented later by the table), and FlagValue.
  * Since the only time this will be called is for putting things into the table, it is reasonable
  * to assume that we want the flagged value to be true.
  *
  * @throws SQLException
  */
 public PreparedStatement loadParameters(PreparedStatement ps, FlagsBean p) throws SQLException {
   int i = 1;
   ps.setLong(i++, p.getFid());
   ps.setLong(i++, p.getMid());
   ps.setLong(i++, p.getPregId());
   ps.setString(i++, p.getFlagValue().toString());
   return ps;
 }
Esempio n. 2
0
 /**
  * Loads the FID, MID, and flag value from the result set into the bean.
  *
  * @param rs
  * @param p
  * @throws SQLException
  */
 private void loadCommon(ResultSet rs, FlagsBean p) throws SQLException {
   p.setFid(rs.getLong("FID"));
   p.setMid(rs.getLong("MID"));
   p.setFlagValue(FlagValue.valueOf(rs.getString("flagValue")));
   p.setFlagged(true); // if this record is found, this is true
 }