Commit 3e8d96d
feat(codegen-spring): complete FR-006 Java payload-VO codegen (all template subtypes + origin.* resolution)
Brings SpringPayloadGenerator to full parity with the Kotlin reference
(KotlinPayloadGenerator) and the cross-port contract — closes the
Day-1 deferral noted in the previous KNOWN_GAPS entry.
Generator changes:
- Iterate ALL MetaTemplate subtypes (prompt / output / toolcall), not
just template.output. Every template with a @payloadRef now emits a
<TemplateShortName>Payload Java record.
- Honour origin.* children on payload-VO fields:
- origin.passthrough @from "Entity.field" — type of source field
- origin.aggregate @agg count → Long; @agg avg → Double;
@agg sum|min|max → @Of source field's type
- origin.collection @via "Parent.rel" → java.util.List<TargetPayload>,
recursively emitting a nested payload record (per-run dedup so
multiple templates referencing the same target produce a single
nested record).
- Refactor extracts emitPayloadRecord so root + nested emission share
one code path.
Test additions (30 → 37): template.prompt + template.toolcall happy
paths, all three origin subtypes (passthrough, count/avg/sum
aggregates, collection), nested-payload dedup across templates.
KNOWN_GAPS: removes the "Payload origin.* resolution not honoured"
entry. Cross-port doc (docs/features/templates-and-payloads.md) updated
to reflect that the Java side now ships payload-VO codegen.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 99d5e39 commit 3e8d96d
4 files changed
Lines changed: 635 additions & 90 deletions
File tree
- docs/features
- server/java/codegen-spring/src
- main/java/com/metaobjects/generator/spring
- test/java/com/metaobjects/generator/spring
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
212 | | - | |
213 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 222 | + | |
225 | 223 | | |
226 | 224 | | |
227 | 225 | | |
228 | 226 | | |
229 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
230 | 239 | | |
231 | 240 | | |
232 | 241 | | |
| |||
Lines changed: 0 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | 41 | | |
73 | 42 | | |
74 | 43 | | |
| |||
0 commit comments