Repository navigation
Description
Part of #3122. Uncovered by #3221 (PR #3231).
#3221 names each JPA entity from its schema's clean-room key, so CBSA now generates 29 entity classes instead of 3 — one per schema, as it should. It deliberately did not touch the table name: the class is disambiguated, the COBOL 01-level it maps keeps its own name.
The consequence is visible in the blessed snapshot:
// Bnk1cacDfhcommarea.java, Bnk1ccaDfhcommarea.java, ... 26 of them
@Entity
@Table(name = "DFHCOMMAREA")
public class Bnk1cacDfhcommarea { ... }26 entity classes, 26 different field layouts, one table name. JPA rejects that at startup (Multiple entities mapped to table DFHCOMMAREA), so the generated Spring Boot tree cannot boot as-is. It also cannot compile-check today, which is #3121.
Why this is a separate call. Every CICS program declares a DFHCOMMAREA — it is the communication area, not a shared table. Deciding what each one should map to is semantic, and there are at least three defensible answers:
- Key the table too (
BNK1CAC_DFHCOMMAREA), accepting 26 tables that are really 26 parameter structures. - Don't generate an entity for a
DFHCOMMAREAat all — it is a transient parameter block, not persistent state — and emit a DTO/record instead. - Generate the entity only for records the program actually reads or writes to a file (the SELECT/ASSIGN and OPEN lineage), and a DTO for the rest.
(3) is the most faithful but needs #3201's named SELECT/ASSIGN and OPEN modes, which the engine does not carry yet. (2) is probably the right default in the meantime.
Reproduce.
python tests/tools/mainframe_corpus.py fetch
python tests/tools/refraction_snapshot.py update --corpus cics-banking-sample-application-cbsa
grep -rl 'name = "DFHCOMMAREA"' tests/cobol_mainframe/refraction_snapshot/full/cics-banking-sample-application-cbsa/ | wc -lDone means. A stated rule for what a COBOL record becomes on the Java side, applied by cobol_to_java_spring_forge.py, with the refraction snapshot blessed and the change explained in docs/refraction_engine_differential.md.
Activity
fix(refraction): a DFHCOMMAREA maps to a DTO, not a JPA entity (#3233) (