fix(document): add trainingLabels to Document.full entity graph (#642)
All checks were successful
CI / Semgrep Security Scan (push) Successful in 19s
CI / Compose Bucket Idempotency (push) Successful in 59s
CI / Unit & Component Tests (push) Successful in 3m28s
CI / OCR Service Tests (push) Successful in 20s
CI / Backend Unit Tests (push) Successful in 3m22s
CI / fail2ban Regex (push) Successful in 49s
All checks were successful
CI / Semgrep Security Scan (push) Successful in 19s
CI / Compose Bucket Idempotency (push) Successful in 59s
CI / Unit & Component Tests (push) Successful in 3m28s
CI / OCR Service Tests (push) Successful in 20s
CI / Backend Unit Tests (push) Successful in 3m22s
CI / fail2ban Regex (push) Successful in 49s
trainingLabels was switched to LAZY fetch in #467 but not added to the Document.full @NamedEntityGraph. DocumentRepository.findById() uses Document.full to eagerly load sender/receivers/tags, but the Hibernate session closes before Jackson serializes the response. Accessing trainingLabels outside the session throws LazyInitializationException, causing GET /api/documents/{id} to return HTTP 500. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit was merged in pull request #644.
This commit is contained in:
@@ -25,7 +25,8 @@ import java.util.UUID;
|
||||
@NamedEntityGraph(name = "Document.full", attributeNodes = {
|
||||
@NamedAttributeNode("sender"),
|
||||
@NamedAttributeNode("receivers"),
|
||||
@NamedAttributeNode("tags")
|
||||
@NamedAttributeNode("tags"),
|
||||
@NamedAttributeNode("trainingLabels")
|
||||
})
|
||||
@NamedEntityGraph(name = "Document.list", attributeNodes = {
|
||||
@NamedAttributeNode("sender"),
|
||||
|
||||
Reference in New Issue
Block a user