feat: Migrate COBOL codebase to Java Spring Boot application#82
Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Open
feat: Migrate COBOL codebase to Java Spring Boot application#82devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
Conversation
Create java-migration/ directory with full Spring Boot project: - Entity: Account JPA entity mapping COBOL ws-sql-account-record - Repository: AccountRepository with Spring Data JPA methods replacing ACCOUNT-ALL-CUR, ACCOUNT-DISABLED-CUR, and ACCOUNT-QUERY-CUR cursors - Services: AccountService, SerializationService, ReportService - Controllers: AccountController (REST API replacing terminal menu), DemoController (JSON/XML/report/search/CLI arg demos) - DTOs: JsonRecord, XmlRecord, SearchItem - Utilities: StringUtils replacing COBOL TRIM, UNSTRING, IS NUMERIC, NUMVAL - Config: AppConfig with GlobalExceptionHandler replacing check-sql-state - Flyway migration: V1__create_accounts_table.sql from create_test_db.sql - Tests: 41 passing tests covering repository, service, controller, serialization, and string utility layers - application.properties configured for PostgreSQL localhost:5432/cobol_db_example Original COBOL code preserved for side-by-side comparison. Co-Authored-By: Jerry Oliphant <jerry.oliphant@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the ~18 COBOL example modules to a Java Spring Boot application under a new
java-migration/directory. The original COBOL code is preserved for side-by-side comparison.What's included
Project Setup (Phase 1)
Data Layer (Phase 2)
AccountJPA entity mapping the COBOLws-sql-account-record(sql/sql_example.cbl lines 44-52) with field sizes matching PIC clausesAccountRepositorywith Spring Data JPA query methods replacing the three COBOL cursors:ACCOUNT-ALL-CUR,ACCOUNT-DISABLED-CUR,ACCOUNT-QUERY-CURV1__create_accounts_table.sqlderived fromsql/create_test_db.sqlGlobalExceptionHandler(@RestControllerAdvice) replacing thecheck-sql-stateparagraphService Layer (Phase 3)
AccountServiceencapsulating business logic from the COBOL procedure division (display-all-accounts, display-disabled-accounts, query-accounts)SerializationServicereplacingJSON GENERATEandXML GENERATEwith Jackson and JAXBReportServicereplacing COBOL Report Writer (RD,PAGE LIMIT,HEADING,DETAIL,FOOTING)StringUtilsutility class replacing COBOL intrinsics:TRIM,UNSTRING,IS NUMERIC,NUMVALDTOs (Phase 3)
JsonRecordwith@JsonPropertyannotations matching COBOLNAME OFmappings and@JsonInclude(NON_EMPTY)forSUPPRESS WHEN SPACESXmlRecordwith@XmlAttributeforTYPE OF ... IS ATTRIBUTEand null suppression forSUPPRESS WHEN SPACESSearchItemwithComparableforSEARCH ALLbinary search (ascending key pattern)REST API (Phase 4)
AccountController:GET /api/accounts,GET /api/accounts/disabled,GET /api/accounts/search?q={value}— replacing the terminal menu systemDemoController:GET /api/demo/json,GET /api/demo/xml,GET /api/demo/report,GET /api/demo/search,GET /api/demo/args— demonstrating non-SQL module equivalentsConfiguration (Phase 4)
application.propertieswith PostgreSQL connection details matching the COBOL connection string (localhost:5432/cobol_db_example)Tests (Phase 5)
AccountRepositoryTest(9 integration tests with H2),AccountServiceTest(5 unit tests),AccountControllerTest(4 web layer tests),SerializationServiceTest(7 tests),StringUtilsTest(17 tests)COBOL-to-Java Mapping Summary
sql/sql_example.cbl(cursors, menu, check-sql-state)json_generate/json_generate.cblxml_generate/xml_generate.cblreport_writer/report_test.cblsearch/search.cbl(SEARCH ALL)sub_program/main_app.cbl(CALL BY CONTENT/REFERENCE)unstring/,trim/,is_numeric/,numval_test/comp_test/(COMP/COMP-5)redifines/(REDEFINES)merge_sort/(MERGE/SORT)read_command_args/Review & Testing Checklist for Human
AccountRepository.searchAccounts()LIKE query produces same results as the COBOLACCOUNT-QUERY-CURcursor with trimmed/wildcarded inputXmlRecordJAXB output matches the COBOLXML GENERATEstructure (enabled as attribute, blank suppressed)mvn testlocally to verify all 41 tests pass in your environmentNotes
**/target/to.gitignoreto exclude Maven build artifactsLink to Devin session: https://app.devin.ai/sessions/d18c2fba88af44dbb6e71e5957afb870
Requested by: @jerryoliphant-cog
Devin Review