Interface AnnotationSetDispositionDao

All Superinterfaces:
BaseDao<AnnotationSetDisposition>
All Known Implementing Classes:
AnnotationSetDispositionDaoImpl

public interface AnnotationSetDispositionDao extends BaseDao<AnnotationSetDisposition>
DAO for AnnotationSetDisposition rows — a curator's rulings on the individual findings inside an audit set.

These rows are append-only, so every read here comes in two flavours: the full log, and the latest-wins fold that answers "what is the standing ruling on this finding". Callers that want the second must not reach for the first and take its head per target by hand — the ordering tiebreaker lives in one place for a reason.

  • Method Details

    • findBySet

      List<AnnotationSetDisposition> findBySet(AnnotationSet annotationSet)
      Every ruling on one set, most recent first — the full log, including rulings that have since been superseded.
    • findBySetAndTarget

      List<AnnotationSetDisposition> findBySetAndTarget(AnnotationSet annotationSet, String targetId)
      Every ruling on one finding, most recent first. The head is the standing ruling.
    • findStandingBySet

      List<AnnotationSetDisposition> findStandingBySet(AnnotationSet annotationSet)
      The standing ruling for each finding in one set — the most recent row per finding id, or per target id for rows carrying no finding id.
      Returns:
      the standing rulings, most recent first
    • findStandingBySetIds

      Map<Long, List<AnnotationSetDisposition>> findStandingBySetIds(Collection<Long> annotationSetIds)
      Batched findStandingBySet(AnnotationSet), for a list view that would otherwise ask once per set.

      One query for the whole page rather than N: the per-dataset annotation set list routinely returns every set on a dataset, and folding dispositions in one set at a time turns that list into an N+1.

      Returns:
      annotation set id -> its standing rulings. Sets with no rulings are absent from the map.
    • deleteBySet

      int deleteBySet(AnnotationSet annotationSet)
      Delete every ruling on one set and report how many rows went.

      🛑 The one exception to the append-only rule above, and it is not a curator's tool. It exists for a do-over after a fault — a calibration package rebuilt, a wire-schema bug that made the rulings meaningless — where the rows record a mistake rather than a decision, and the superseding-row mechanism would preserve exactly the noise the caller is trying to be rid of. A curator who has changed their mind rules again; that is what rule is for.

      Returns:
      how many rulings were deleted; 0 when there were none