79790662

Date: 2025-10-14 22:18:15
Score: 1
Natty:
Report link

@BatchSize is a Hibernate-specific annotation that optimizes the N+1 query problem by fetching lazy-loaded associations in batches rather than one at a time, then you can optimize as:

@OneToMany(mappedBy = "courses", fetch = FetchType.LAZY)
@BatchSize(size = 25) 
private Set<CourseModules> courseModules = new HashSet<>();
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): is a
  • Low reputation (1):
Posted by: Alvaro Montesinos