class SampleDao {

  public Sample findSampleById(final Long sampleId, boolean lockRow) {
    return dbp.get().toSelect("select sample_name, update_sequence, update_time from sample where sample_id=?"
        + (lockRow ? " for update" : ""))
        .argLong(sampleId).queryOneOrNull(r -> {
          Sample result = new Sample();
          result.setSampleId(sampleId);
          result.setName(r.getStringOrNull());
          result.setUpdateSequence(r.getIntegerOrNull());
          result.setUpdateTime(r.getDateOrNull());
          return result;
        });
  }

  public  SampleDao(Supplier<Database> dbp);

}