-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Labels
status: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged
Description
- Key Changes
- Introduction of Intermediary Entity: Replaced @manytomany with a formal ProductTag entity, refactoring the relationship into @onetomany and @manytoone associations.
- Enhanced Entity Stability: Removed the risky @DaTa annotation in favor of @Getter and @NoArgsConstructor(access = AccessLevel.PROTECTED) to ensure encapsulation and identifier integrity.
- Explicit ID Generation: Replaced ambiguous @GeneratedValue with GenerationType.IDENTITY for better database predictability.
- Optimized Fetching: Updated the NamedEntityGraph with Subgraphs to ensure Product, ProductTag, and Tag can still be fetched in a single optimized query.
- Expected Benefits
- Extensibility: Allows for adding relationship-specific metadata (e.g., created_at, display_order) to the ProductTag entity without schema overhauls.
- Runtime Reliability: Eliminates potential StackOverflowError during serialization and prevents HashSet inconsistency caused by mutable hashCode values in entities.
- Query Control: Provides explicit control over the intermediary table, preventing performance degradation (such as the "Hibernate Bag" issue) during bulk data operations.
Metadata
Metadata
Assignees
Labels
status: waiting-for-triageAn issue we've not yet triagedAn issue we've not yet triaged