class SampleDao {

  public void createSample(final Sample sample, Long userIdMakingChange) {
    Database db = dbp.get();

    Date updateTime = db.nowPerApp();
    Long sampleId = db.toInsert(
        "insert into sample (sample_id, sample_name, update_sequence, update_time) values (?,?,0,?)")
        .argPkSeq("id_seq")
        .argString(sample.getName())
        .argDate(updateTime)
        .insertReturningPkSeq("sample_id");

    db.toInsert("insert into sample_history (sample_id, sample_name, update_sequence, update_time, update_user_id,"
        + " is_deleted) values (?,?,0,?,?,'N')")
        .argLong(sampleId)
        .argString(sample.getName())
        .argDate(updateTime)
        .argLong(userIdMakingChange)
        .insert(1);

    // Update the object in memory
    sample.setSampleId(sampleId);
    sample.setUpdateSequence(0);
    sample.setUpdateTime(updateTime);
  }

  public  SampleDao(Supplier<Database> dbp);

}