Skip to content

fix(refraction): a DFHCOMMAREA maps to a DTO, not a JPA entity (#3233) - #3239

Merged
squid-protocol merged 1 commit into
mainfrom
fix/3233-dfhcommarea-dto
Sep 20, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/3233-dfhcommarea-dto

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3233. Part of the CICS modernization epic #3122.

Problem

Every CICS program declares a DFHCOMMAREA — its communication area, a transient parameter block, not a shared table. Since #3231 named each generated Java class from its clean-room key, CBSA emitted 20 entity classes all bound to @Table(name = "DFHCOMMAREA") (the issue/#3221 prose said "26"; that 26 is the layouts discarded pre-#3231 across all three colliding titles — see the count fix below). Hibernate refuses to start on Multiple entities mapped to table DFHCOMMAREA, so the generated Spring Boot tree could not boot.

This is the "deciding what table each should map to is a semantic question, tracked separately" caveat the #3221 differential-doc update explicitly left open.

The rule

A record whose 01-level title is DFHCOMMAREA is transient state and now generates a plain Lombok POJO DTO in the .dto package instead of a JPA entity: @Data @NoArgsConstructor, no @Entity/@Table, no synthetic @Id, no @Column/@Transient/@ElementCollection, no jakarta.persistence import. The COBOL layout (field order, BigDecimal precision, OCCURS as List<>, REDEFINES aliases) is preserved as plain fields — the block is still read/written by the migrated logic, it is simply not persisted. The class keeps its clean-room-keyed name with a Dto suffix (Bnk1cacDfhcommareaDto).

Changes

corpus JPA entities DFHCOMMAREA DTOs (was entities)
zopeneditor-sample 5 0
cics-banking-sample-application-cbsa 9 20
aws-mainframe-modernization-carddemo 15 21

Totals unchanged from the #3221 table; the DFHCOMMAREA rows moved from entity/ to dto/. No generated service/controller/repository referenced these classes, so nothing else moved except the per-corpus audit count line.

Scope / follow-ups

Verification

  • pytest tests/cobol_mainframe/ tests/tools_recorders/ → all pass (entity golden byte-identical, new DTO golden, snapshot suite, updated collision test).
  • Baseline audits: ruff_audit.py --ci no new findings; mypy_audit.py --ci no new errors.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MnydTpQgzRShNDhfe3WXf7

Every CICS program declares a DFHCOMMAREA -- its communication area, a
transient parameter block, not a shared table. Since #3231 named each
generated class from its clean-room key, CBSA emitted 20 entity classes all
bound to @table(name = "DFHCOMMAREA") (26 layouts were being discarded before
#3231, across all three colliding titles). Hibernate refuses to start on
"Multiple entities mapped to table DFHCOMMAREA", so the generated tree could
not boot.

A record whose 01-level title is DFHCOMMAREA now generates a plain Lombok POJO
DTO in the .dto package: @DaTa @NoArgsConstructor, no @Entity/@table, no
synthetic @id, no @Column/@Transient/@ElementCollection, no jakarta.persistence
import. The COBOL layout (field order, BigDecimal precision, OCCURS as List<>,
REDEFINES aliases) is preserved as plain fields, since the block is still read
and written by the migrated logic -- it is simply not persisted.

- forge: is_transient_record + generate_java_dto + dto_class_name; the
  per-field rendering is factored into a shared _render_field(jpa=bool) helper,
  so the entity path stays byte-identical (golden image unchanged).
- controller: dto/ scaffold dir, schema-loop branch, "Transient DTOs" count.
- tests: new DTO golden image; the #3221 collision test now asserts one
  distinct DTO per clean-room key with no entity generated.
- refraction snapshots re-blessed (excerpts + full corpora); no
  @table(name = "DFHCOMMAREA") remains anywhere.
- docs/refraction_engine_differential.md: new section closing the "tracked
  separately" caveat the #3221 update left open, and corrects that section's
  DFHCOMMAREA-class count (20, not 26).

The lineage-gated rule (persist only records a program reads/writes to a file)
is the more faithful successor, blocked on #3201; other working-storage records
stay entities until then. Compiling the generated tree is tracked in #3121.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MnydTpQgzRShNDhfe3WXf7
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 16b72de into main Sep 20, 2026
29 checks passed
@squid-protocol
squid-protocol deleted the fix/3233-dfhcommarea-dto branch September 20, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cobol-to-java: 26 CBSA entities all map @Table(name = "DFHCOMMAREA")

1 participant