From a2c633c5de999ac9a6006ea1db9188e1225dbe77 Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 28 Apr 2026 20:21:23 +0200 Subject: [PATCH] feat(transcription): findByMentionedPersons_PersonId derived query MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spring Data resolves the method name to a join over transcription_block_mentioned_persons, returning every block whose sidecar contains the given personId. The B-tree index on person_id (V56) keeps the lookup O(log n) — required for the rename propagation that fans out to every block referencing the renamed person, and for the future "show all blocks mentioning person X" query on the person detail page. The underscore between MentionedPersons and PersonId is the explicit property-boundary form, immune to ambiguous longest-match parsing if the embeddable later gains another nested object. Refs #362 Co-Authored-By: Claude Opus 4.7 --- .../familienarchiv/repository/TranscriptionBlockRepository.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/main/java/org/raddatz/familienarchiv/repository/TranscriptionBlockRepository.java b/backend/src/main/java/org/raddatz/familienarchiv/repository/TranscriptionBlockRepository.java index 1bf2d108..4a226bd6 100644 --- a/backend/src/main/java/org/raddatz/familienarchiv/repository/TranscriptionBlockRepository.java +++ b/backend/src/main/java/org/raddatz/familienarchiv/repository/TranscriptionBlockRepository.java @@ -29,6 +29,8 @@ public interface TranscriptionBlockRepository extends JpaRepository findByAnnotationId(UUID annotationId); + List findByMentionedPersons_PersonId(UUID personId); + void deleteByAnnotationId(UUID annotationId); int countByDocumentId(UUID documentId);