Skip to content

Migrate eShopLegacyWebForms from .NET Framework to Java 21 / Spring Boot 3.5#5

Open
devin-ai-integration[bot] wants to merge 12 commits into
mainfrom
devin/1779337278-webforms-springboot-migration
Open

Migrate eShopLegacyWebForms from .NET Framework to Java 21 / Spring Boot 3.5#5
devin-ai-integration[bot] wants to merge 12 commits into
mainfrom
devin/1779337278-webforms-springboot-migration

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented May 21, 2026

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

Layer .NET Source Java Target
Framework .NET Framework 4.7.2 / ASP.NET WebForms Java 21 / Spring Boot 3.5.0
ORM Entity Framework 6 Code First Spring Data JPA + Flyway
DI Autofac Spring IoC (@Configuration + @Profile)
UI WebForms .aspx pages Thymeleaf .html templates
Logging log4net SLF4J + Logback
Monitoring Spring Boot Actuator + Micrometer Prometheus

Migrated Components

Entities (3): CatalogItem, CatalogBrand, CatalogType — JPA entities with Jakarta Validation, BigDecimal for prices, @ManyToOne relationships with FK mappings

Repositories (3): CatalogItemRepository, CatalogBrandRepository, CatalogTypeRepository — Spring Data JPA with custom JOIN FETCH queries for eager loading

Services (3): CatalogService interface, 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 confirmation

Config: application.yml (dev/mock/prod profiles), Flyway H2 schema, logback-spring.xml, static assets (CSS, fonts, images)

File Inventory

  • 15 Java source files (1 app, 3 models, 1 DTO, 3 repos, 3 services, 1 controller, 3 config)
  • 6 Thymeleaf templates (layout + 5 pages)
  • 1 Flyway migration (H2 schema)
  • 4 YAML configs (main + 3 profiles)
  • 1 test (context loads)
  • 38 static assets (CSS, fonts, images, product pics)

Build Status

  • mvn clean compilePASS (15 source files, zero errors)
  • mvn testPASS (1 test, 0 failures)

Per-Epic Commits

  1. Epic 0: Initialize Spring Boot 3.5 project scaffold — Maven project, configs, static assets
  2. Epic 1-2: Add domain entities, JPA repositories, Flyway schema, and data initializerChild session
  3. Epic 3: Add service layer with JPA and mock implementationsChild session
  4. Epic 5: Add CatalogController and Thymeleaf viewsChild session
  5. Fix entity column mappings and add PhysicalNamingStrategyStandardImpl — Orchestrator post-integration fix
  6. Fix 3 bugs from Devin Review — logback rollingPolicy, mock NPE, H2 DDL identity

Review & Testing Checklist for Human

  • Run the app locally with cd eShopLegacyWebFormsSolution/eShopLegacyWebForms-SpringBoot && ./mvnw spring-boot:run -Dspring-boot.run.profiles=dev and verify the catalog page loads at http://localhost:8080
  • Test CRUD operations: Create a new catalog item, edit it, view details, delete it
  • Verify mock mode: Run with -Dspring-boot.run.profiles=mock and confirm in-memory data works without a database
  • Check pagination: Verify Previous/Next navigation works correctly with 10 items per page
  • Review entity mappings: Verify @Column(name=...) annotations match the Flyway schema exactly

Notes

  • The migration uses H2 in-memory database for dev mode and SQL Server for production (matching the original .NET config)
  • UseMockData=true is the default (matching source behavior) — set USE_MOCK_DATA=false to use the JPA/database mode
  • The HiLo ID generator from the .NET source was simplified to @GeneratedValue(strategy = GenerationType.IDENTITY) since the seed data sets explicit IDs
  • pictureUri is marked @Transient (matching the .NET builder.Ignore() configuration)
  • PhysicalNamingStrategyStandardImpl is configured to preserve PascalCase column names from the original SQL Server schema

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/23bcd570aafc4ee3afcb373981b51155
Requested by: @mbatchelor81


Open in Devin Review

- 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
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

- 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)
devin-ai-integration[bot]

This comment was marked as resolved.

- Remove stale target/ build artifacts from version control
- Add **/target/ to .gitignore for Java/Maven output
- Use Collections.synchronizedList for CatalogServiceMock thread-safety
devin-ai-integration[bot]

This comment was marked as resolved.

Replaces Collections.synchronizedList which still requires external
synchronization during iteration. CopyOnWriteArrayList is safe for
concurrent iteration and suits this read-heavy mock service.
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

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.
devin-ai-integration[bot]

This comment was marked as resolved.

- 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
devin-ai-integration[bot]

This comment was marked as resolved.

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.

1 participant