refactor(entity): update fetch strategies to LAZY for improved reliability#122
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (111)
📝 WalkthroughWalkthroughThis pull request refactors JPA lazy loading strategies and transaction boundaries across the codebase. Entity relationships are changed from eager to lazy loading with batch size hints, new repository query methods with Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Controller
participant Service
participant SecFilter
participant UserRepo
participant BookRepo
participant DB
Client->>SecFilter: Request with JWT token
SecFilter->>UserRepo: findByIdWithDetails(userId)
UserRepo->>DB: SELECT user + settings/libraries/permissions
DB-->>UserRepo: BookLoreUserEntity with relations
UserRepo-->>SecFilter: Enriched user entity
SecFilter->>SecFilter: Create BookLoreUser DTO
SecFilter->>SecFilter: Set SecurityContext
SecFilter-->>Client: Proceed to Controller
Client->>Controller: API request (authenticated)
Controller->>Service: Business logic call
Service->>BookRepo: findByIdWithBookFiles(bookId)
BookRepo->>DB: SELECT book + bookFiles
DB-->>BookRepo: BookEntity with files
BookRepo-->>Service: Enriched book entity
Service->>Service: Process with available files
Service-->>Controller: Response DTO
Controller-->>Client: HTTP response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~55 minutes Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
# Conflicts: # booklore-api/src/main/java/org/booklore/service/kobo/KoboEntitlementService.java
Description
Linked Issue: Fixes #
Changes
See: https://www.baeldung.com/spring-open-session-in-view
First pass at fixing some of the hibernate stuff.
Main change is obvious trying to optimize the queries.
Summary by CodeRabbit
Release Notes
New Features
Performance Improvements
Bug Fixes
Chores