Esempio n. 1
0
  private long insertCommit(String author, LocalDateTime date, CommitId commitId) {
    InsertQuery query =
        polyJDBC
            .query()
            .insert()
            .into(COMMIT_TABLE_NAME)
            .value(COMMIT_AUTHOR, author)
            .value(COMMIT_COMMIT_DATE, toTimestamp(date))
            .value(COMMIT_COMMIT_ID, commitId.valueAsNumber())
            .sequence(COMMIT_PK, COMMIT_PK_SEQ);

    return polyJDBC.queryRunner().insert(query);
  }
Esempio n. 2
0
  public CommitId getCommitHeadId() {
    Optional<BigDecimal> maxCommitId = selectMaxCommitId();

    return maxCommitId.isEmpty() ? null : CommitId.valueOf(maxCommitId.get());
  }