[MR Train 2/6] Refactor: Implement database layer with JPA
MR Train Overview
This is MR 2 of 6 in a stacked MR train to refactor orders-service.
Train Structure
- [MR 1/6] Foundation (!2 (merged))
- [MR 2/6] Database layer ← YOU ARE HERE
- [MR 3/6] Service layer (depends on MR 2)
- [MR 4/6] API endpoints (depends on MR 3)
- [MR 5/6] Integration tests (depends on MR 4)
- [MR 6/6] Performance optimizations (depends on MR 5)
This MR: Database Layer
Implements the database persistence layer using Spring Data JPA.
Changes
- Created OrderRepositoryImpl with Spring Data JPA
- Added JPA entity mappings (OrderEntity, OrderItemEntity)
- Created Flyway migration scripts for orders and order_items tables
- Added proper indexes for query optimization
Dependencies
This MR is based on the refactor/step1-foundation branch and must be merged AFTER MR 1.
Review Notes
- All queries use proper indexing
- Entity-to-domain conversion is handled cleanly
- Migration scripts are idempotent
@sabrina_farmer Can you review the JPA implementation?