Unbounded Query No Limit (ARCH4061)
هذا المحتوى غير متوفر بلغتك بعد.
Key java.orm.unbounded-query-no-limit · Severity warning · Category orm
Fetching an entire table with no LIMIT/pagination risks a memory blowup as the table grows. Paginate the result with Pageable.
Incorrect
Section titled “Incorrect”List<Event> events = eventRepository.findAll(); // millions of rowsreturn events;Correct
Section titled “Correct”Page<Event> events = eventRepository.findAll(PageRequest.of(0, 50));return events.getContent();Add Pageable or an explicit LIMIT to queries that feed a list/response.