refactor(geschichte): switch entity to LAZY fetch and add GeschichteSummary projection DTO #383
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Markus flagged on PR #382 (#5763 B2) that
Geschichtedeclares@ManyToMany(fetch = FetchType.EAGER)on bothpersonsanddocuments. With 200+ stories on the index page that drags the full Person + Document object graph through every list query — the body field is the heaviest part of the row, andDocumentserialises ~30 fields per row through Jackson.The current PR follows the existing
Document.javaprecedent (EAGER everywhere) so it is internally consistent, but the cliff is real once stories scale.Scope
Geschichte.personsandGeschichte.documentstoFetchType.LAZY.GeschichteSummaryDTO with the fields the index page actually needs (id,title,status,author,persons[id+displayName],documents[id+title+documentDate],createdAt,updatedAt,publishedAt, plus a server-computed plain-textexcerptfield so the frontend stops shipping the full body in list responses).GeschichteService.list()returnsList<GeschichteSummary>.GeschichteService.getById()keeps the fullGeschichte.npm run generate:api)./geschichten/+page.svelte,GeschichtenCard.svelte,DocumentMetadataDrawer.svelte) to render theexcerptfield directly instead of runningplainExcerpt(g.body)client-side.Acceptance criteria
bodyfield for any story./geschichtenwith 50 published stories does fewer DB joins than today (verified by query log).list()returns rows whosebodyfield is null/absent.Out of scope
Document.javaEAGER pattern. That's a separate audit — this issue is just forGeschichte.Closes the deferred portion of Markus's review on PR #382.