Skip to content

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

Closed

Description

@squid-protocol

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:

  1. Key the table too (BNK1CAC_DFHCOMMAREA), accepting 26 tables that are really 26 parameter structures.
  2. Don't generate an entity for a DFHCOMMAREA at all — it is a transient parameter block, not persistent state — and emit a DTO/record instead.
  3. 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 -l

Done 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

  1. added
    bug
    legacy-modernization
    on Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglegacy-modernization

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions