Migrate eShopLegacyWebForms from .NET Framework to Java 21 / Spring Boot 3.5#5
Open
devin-ai-integration[bot] wants to merge 12 commits into
Open
Migrate eShopLegacyWebForms from .NET Framework to Java 21 / Spring Boot 3.5#5devin-ai-integration[bot] wants to merge 12 commits into
devin-ai-integration[bot] wants to merge 12 commits into
Conversation
- Spring Boot 3.5.0 with Java 21 - Maven project with spring-boot-starter-web, data-jpa, thymeleaf, validation, actuator - H2 (dev), SQL Server (prod) database configurations - Flyway migration support for both H2 and SQL Server - Thymeleaf Layout Dialect for master page support - Static assets copied (CSS, fonts, images, product pics) - Logback logging configuration (ported from log4net) - Spring profiles: dev, mock, prod - Maven wrapper included
- Add @column(name=...) for all entity fields to match Flyway schema - Add @transient to CatalogItem.pictureUri (not persisted, matches .NET Ignore config) - Configure PhysicalNamingStrategyStandardImpl to preserve column names
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:
|
- logback: SizeBasedTriggeringPolicy -> SizeAndTimeBasedRollingPolicy (wrong interface) - CatalogServiceMock.findCatalogItem: return null -> throw ResponseStatusException (NPE risk) - H2 DDL: add GENERATED BY DEFAULT AS IDENTITY to all PKs (required for @GeneratedValue)
- Remove stale target/ build artifacts from version control - Add **/target/ to .gitignore for Java/Maven output - Use Collections.synchronizedList for CatalogServiceMock thread-safety
Replaces Collections.synchronizedList which still requires external synchronization during iteration. CopyOnWriteArrayList is safe for concurrent iteration and suits this read-heavy mock service.
Prevents Spring Data's save() from calling merge() on non-zero primitive IDs, which would ignore the explicitly set IDs and rely on coincidental auto-generated ordering for FK references.
- Replace CatalogDataInitializer with V2__seed_data.sql Flyway migration using explicit INSERT with IDs, guaranteeing correct FK references regardless of insertion order - Reset identity counters after seed to avoid collisions - Fix findCatalogItem to populate brand/type via composeCatalogItems
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
Full migration of the eShopLegacyWebForms catalog management application from .NET Framework 4.7.2 (ASP.NET WebForms + Entity Framework 6) to Java 21 / Spring Boot 3.5.0.
Architecture
@Configuration+@Profile).aspxpages.htmltemplatesMigrated Components
Entities (3):
CatalogItem,CatalogBrand,CatalogType— JPA entities with Jakarta Validation,BigDecimalfor prices,@ManyToOnerelationships with FK mappingsRepositories (3):
CatalogItemRepository,CatalogBrandRepository,CatalogTypeRepository— Spring Data JPA with customJOIN FETCHqueries for eager loadingServices (3):
CatalogServiceinterface,CatalogServiceImpl(@Profile("!mock")with JPA),CatalogServiceMock(@Profile("mock")with in-memory data)Controller (1):
CatalogController— full CRUD with pagination (GET/, details, create, edit, delete)Templates (6): Layout (
default.html), index with pagination, create/edit forms with validation, details view, delete confirmationConfig:
application.yml(dev/mock/prod profiles), Flyway H2 schema, logback-spring.xml, static assets (CSS, fonts, images)File Inventory
Build Status
mvn clean compile— PASS (15 source files, zero errors)mvn test— PASS (1 test, 0 failures)Per-Epic Commits
Epic 0: Initialize Spring Boot 3.5 project scaffold— Maven project, configs, static assetsEpic 1-2: Add domain entities, JPA repositories, Flyway schema, and data initializer— Child sessionEpic 3: Add service layer with JPA and mock implementations— Child sessionEpic 5: Add CatalogController and Thymeleaf views— Child sessionFix entity column mappings and add PhysicalNamingStrategyStandardImpl— Orchestrator post-integration fixFix 3 bugs from Devin Review— logback rollingPolicy, mock NPE, H2 DDL identityReview & Testing Checklist for Human
cd eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot && ./mvnw spring-boot:run -Dspring-boot.run.profiles=devand verify the catalog page loads at http://localhost:8080-Dspring-boot.run.profiles=mockand confirm in-memory data works without a database@Column(name=...)annotations match the Flyway schema exactlyNotes
UseMockData=trueis the default (matching source behavior) — setUSE_MOCK_DATA=falseto use the JPA/database mode@GeneratedValue(strategy = GenerationType.IDENTITY)since the seed data sets explicit IDspictureUriis marked@Transient(matching the .NETbuilder.Ignore()configuration)PhysicalNamingStrategyStandardImplis configured to preserve PascalCase column names from the original SQL Server schemaLink to Devin session: https://partner-workshops.devinenterprise.com/sessions/23bcd570aafc4ee3afcb373981b51155
Requested by: @mbatchelor81