Skip to content

feat: add Table Data Gateway pattern - #3626

Open
SC-10749 wants to merge 2 commits into
iluwatar:masterfrom
SC-10749:codex/table-data-gateway-1318
Open

SC-10749 wants to merge 2 commits into
iluwatar:masterfrom
SC-10749:codex/table-data-gateway-1318

Conversation

@SC-10749

Copy link
Copy Markdown

Summary

  • Add a CustomerTableGateway that centralizes parameterized CRUD operations for the CUSTOMERS table.
  • Add an immutable Customer record, H2 demo, UML source, and README.
  • Register the new Maven module and cover CRUD behavior with tests.

Validation

  • table-data-gateway clean verify: 5 tests passed.
  • Packaged demo runs successfully.

Closes #1318

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

PR Summary

Introduced a Table Data Gateway pattern for the CUSTOMERS table, including an immutable Customer record, a demonstration App using an in-memory H2 database, UML diagram, and README. Added a new Maven module with tests to validate CRUD operations and to cover the gateway behavior.

Changes

File Summary
pom.xml Updated root pom to declare the new module table-data-gateway and to include the JUnit 5 API dependency for tests.
table-data-gateway/README.md Documentation for the Table Data Gateway pattern, including intent, example usage, and related patterns.
table-data-gateway/etc/table-data-gateway.urm.puml PlantUML diagram showing App, Customer, and CustomerTableGateway and their relationships.
table-data-gateway/pom.xml Module POM declaring dependencies (slf4j, logback, h2, junit-jupiter-api, junit-jupiter-engine, mockito-core) and an assembly plugin for an executable artifact.
table-data-gateway/src/main/java/com/iluwatar/tabledatagateway/App.java Demo application wiring up an in-memory H2 DB and performing CRUD via CustomerTableGateway with logs.
table-data-gateway/src/main/java/com/iluwatar/tabledatagateway/Customer.java Immutable Customer record representing a row in the CUSTOMERS table.
table-data-gateway/src/main/java/com/iluwatar/tabledatagateway/CustomerTableGateway.java Gateway encapsulating all SQL operations for the CUSTOMERS table: insert, findById, findAll, update, delete.
table-data-gateway/src/test/java/com/iluwatar/tabledatagateway/AppTest.java Tests ensuring the App class can be constructed and its main runs without throwing.
table-data-gateway/src/test/java/com/iluwatar/tabledatagateway/CustomerTableGatewayTest.java Comprehensive tests for CRUD operations of CustomerTableGateway using H2.

autogenerated by presubmit.ai

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM!

Review Summary

Commits Considered (1)
Files Processed (8)
  • pom.xml (1 hunk)
  • table-data-gateway/README.md (1 hunk)
  • table-data-gateway/etc/table-data-gateway.urm.puml (1 hunk)
  • table-data-gateway/pom.xml (1 hunk)
  • table-data-gateway/src/main/java/com/iluwatar/tabledatagateway/App.java (1 hunk)
  • table-data-gateway/src/main/java/com/iluwatar/tabledatagateway/Customer.java (1 hunk)
  • table-data-gateway/src/main/java/com/iluwatar/tabledatagateway/CustomerTableGateway.java (1 hunk)
  • table-data-gateway/src/test/java/com/iluwatar/tabledatagateway/CustomerTableGatewayTest.java (1 hunk)
Actionable Comments (0)
Skipped Comments (2)
  • table-data-gateway/src/main/java/com/iluwatar/tabledatagateway/CustomerTableGateway.java [42-42]

    best_practice: "Declare gateway as final."

  • table-data-gateway/pom.xml [53-57]

    best_practice: "Add JUnit Jupiter API dependency."

@codecov

codecov Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.11%. Comparing base (4cabb20) to head (b4ccfa5).

Files with missing lines Patch % Lines
...luwatar/tabledatagateway/CustomerTableGateway.java 96.22% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3626      +/-   ##
============================================
+ Coverage     84.06%   84.11%   +0.05%     
- Complexity     4353     4368      +15     
============================================
  Files          1133     1136       +3     
  Lines         15400    15475      +75     
  Branches        739      743       +4     
============================================
+ Hits          12946    13017      +71     
- Misses         2158     2159       +1     
- Partials        296      299       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM!

Review Summary

Commits Considered (1)
  • b4ccfa5: test: improve table data gateway coverage
Files Processed (5)
  • pom.xml (2 hunks)
  • table-data-gateway/pom.xml (1 hunk)
  • table-data-gateway/src/main/java/com/iluwatar/tabledatagateway/CustomerTableGateway.java (1 hunk)
  • table-data-gateway/src/test/java/com/iluwatar/tabledatagateway/AppTest.java (1 hunk)
  • table-data-gateway/src/test/java/com/iluwatar/tabledatagateway/CustomerTableGatewayTest.java (1 hunk)
Actionable Comments (0)
Skipped Comments (4)
  • pom.xml [265-265]

    enhancement: "Add table-data-gateway module to the aggregator"

  • pom.xml [327-333]

    enhancement: "Add JUnit 5 API dependency in root POM"

  • table-data-gateway/pom.xml [75-75]

    enhancement: "Set runnable main class in table-data-gateway module"

  • table-data-gateway/src/main/java/com/iluwatar/tabledatagateway/CustomerTableGateway.java [73-73]

    best_practice: "Add null checks for Customer fields in insert"

This branch has not been deployed

No deployments
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.

Table Data Gateway pattern

1 participant