Example #1
0
  public String genStoreEventDescription(RecT rec) throws SQLException {
    boolean isStored = recIsStored(rec);
    StringBuilder res = new StringBuilder();
    res.append(
        String.format(
            "%s %s.", rec.caption(), isStored ? rec.cx().t8(updated()) : rec.cx().t8(created())));
    if (isStored) {
      Set<String> fieldDescriptions = new TreeSet<>();
      genDirtyFieldDescriptions(rec, fieldDescriptions);

      if (fieldDescriptions.isEmpty()) {
        return null;
      }

      res.append(' ');
      String sep = "";
      for (String s : fieldDescriptions) {
        res.append(sep).append(s);
        sep = ", ";
      }
      res.append('.');
    }
    return res.toString();
  }
Example #2
0
 public String genDeleteEventDescription(RecT rec, String deleted) throws SQLException {
   return String.format("%s %s.", rec.caption(), rec.cx().t8(deleted));
 }