Interface AnnotationSetDao
- All Superinterfaces:
BaseDao<AnnotationSet>
- All Known Implementing Classes:
AnnotationSetDaoImpl
DAO for
AnnotationSet rows.
Addressed by id or by the (investigation, role, runId)
idempotency triple. The polymorphic semantic of runId (agent
run id / "draft-{curator}" / generated UUID per role) is
enforced at the service layer; the DAO treats it as an opaque key.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumField a cross-experiment listing is ordered by. -
Method Summary
Modifier and TypeMethodDescriptionlongcountByInvestigation(Investigation investigation, AnnotationSetRole roleFilter) Count rows attached to the given investigation matching the role filter (or all roles ifnull).countByRoleSince(Date since) Group rows by role, counting per bucket.longcountDistinctRunIdsSince(Date since, AnnotationSetRole roleFilter) Number of distinctrunIds seen on rows withcreatedAt >= since(or all-time if null).longcountSince(Date since, AnnotationSetRole roleFilter) Count rows withcreatedAton or aftersince(or all rows ifsinceis null).longcountSummaries(AnnotationSetRole roleFilter, AnnotationSetSource sourceFilter, String createdByFilter, AgentCurationKind kindFilter, String statusFilter, List<Long> investigationIds) Cross-experiment count.findByInvestigation(Investigation investigation, AnnotationSetRole roleFilter) All sets attached to the given investigation, newest first.findByInvestigationAndRoleAndRunId(Investigation investigation, AnnotationSetRole role, String runId) Find an existing row for the(investigation, role, runId)triple, ornull.findLatestByInvestigation(Investigation investigation, AnnotationSetRole roleFilter) The most recent set attached to the given investigation matching the role filter (or all roles ifnull), ornull.findLatestCreatedAt(AnnotationSetRole roleFilter) findSummariesByInvestigation(Investigation investigation, AnnotationSetRole roleFilter) Thin metadata projection of sets attached to the given investigation, newest first.listSummaries(AnnotationSetRole roleFilter, AnnotationSetSource sourceFilter, String createdByFilter, AgentCurationKind kindFilter, String statusFilter, List<Long> investigationIds, int offset, int limit, AnnotationSetDao.SummarySort sort, boolean descending) Cross-experiment thin metadata projection: everyAnnotationSetmatching the supplied filter, sliced byoffset / limit.intrebindInvestigation(Investigation from, Investigation to) Rebind every row currently attached tofromso it points atto.
-
Method Details
-
findByInvestigationAndRoleAndRunId
@Nullable AnnotationSet findByInvestigationAndRoleAndRunId(Investigation investigation, AnnotationSetRole role, String runId) Find an existing row for the(investigation, role, runId)triple, ornull. Used by the service to makePOST /datasets/{id}/annotation-setsidempotent on retry. -
findByInvestigation
List<AnnotationSet> findByInvestigation(Investigation investigation, @Nullable AnnotationSetRole roleFilter) All sets attached to the given investigation, newest first.- Parameters:
investigation- target. Required.roleFilter- optional role filter;null= all roles.
-
findSummariesByInvestigation
List<AnnotationSetSummaryValueObject> findSummariesByInvestigation(Investigation investigation, @Nullable AnnotationSetRole roleFilter) Thin metadata projection of sets attached to the given investigation, newest first.payloadJsonis NOT loaded; the projection emitslength(payloadJson)aspayloadSizeso the UI can decide whether to fetch the full row. -
findLatestByInvestigation
@Nullable AnnotationSet findLatestByInvestigation(Investigation investigation, @Nullable AnnotationSetRole roleFilter) The most recent set attached to the given investigation matching the role filter (or all roles ifnull), ornull. "Most recent" bycreatedAt, falling back to id whencreatedAtties. -
countByInvestigation
Count rows attached to the given investigation matching the role filter (or all roles ifnull). -
rebindInvestigation
Rebind every row currently attached tofromso it points atto. Returns the number of rows rebound. Used by the preboarded-promotion flow so the agent's historical proposals follow the EE after the preboarded row is replaced. -
listSummaries
List<AnnotationSetSummaryValueObject> listSummaries(@Nullable AnnotationSetRole roleFilter, @Nullable AnnotationSetSource sourceFilter, @Nullable String createdByFilter, @Nullable AgentCurationKind kindFilter, @Nullable String statusFilter, @Nullable List<Long> investigationIds, int offset, int limit, @Nullable AnnotationSetDao.SummarySort sort, boolean descending) Cross-experiment thin metadata projection: everyAnnotationSetmatching the supplied filter, sliced byoffset / limit.- Parameters:
roleFilter- optional role filter;null= all roles.sourceFilter- optional source filter;null= all sources.createdByFilter- optional createdBy filter;null= no filter.investigationIds- optional restriction to a set of investigation ids;nullor empty = no additional filter (ACL enforced upstream).sort- field to order by;null=AnnotationSetDao.SummarySort.CREATED_AT.descending- newest / highest first.
-
countSummaries
long countSummaries(@Nullable AnnotationSetRole roleFilter, @Nullable AnnotationSetSource sourceFilter, @Nullable String createdByFilter, @Nullable AgentCurationKind kindFilter, @Nullable String statusFilter, @Nullable List<Long> investigationIds) Cross-experiment count. Counterpart oflistSummaries(AnnotationSetRole, AnnotationSetSource, String, AgentCurationKind, String, List, int, int, SummarySort, boolean). -
countSince
Count rows withcreatedAton or aftersince(or all rows ifsinceis null). Optionally restricted by role. -
countByRoleSince
Group rows by role, counting per bucket. Rows withcreatedAt >= sinceonly whensinceis non-null. -
countDistinctRunIdsSince
Number of distinctrunIds seen on rows withcreatedAt >= since(or all-time if null). Approximates "how many agent runs have we ingested in the window" when filtered torole=PROPOSAL. -
findLatestCreatedAt
- Returns:
- the most-recent
createdAtacross every row matching the role filter, ornullif no rows.
-