عرض عملي: الإسقاطات لقوائم مرقّمة
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
build the paged, filtered product list; prepares JNR-029-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Define
ProductListItem(id, name, price, category name). - Write one
@Querywith optional name, category, and price-range filters and aPageableparameter. - Call it from the service with
PageRequest.of(page, size, Sort.by("name")). - Planned mistake: return the entity from the controller; show the extra columns and lazy-loading trouble, then switch to the projection.
- Check the SQL log: only the listed columns are selected, plus a count query.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.