انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهJNR-030-L08

عرض عملي: مفاجآت التسلسل وحذف اليتامى

  • الدرس 8 من 8
  • Junior
في هذا الدرس 3 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

see what cascades and orphan removal really do; prepares JNR-030-LAB1.

تفاصيل المخطط المبدئي

خطوة بخطوة

  1. Remove one line from the order's list and commit; the log shows a delete for that line only.
  2. Replace the whole list with order.setLines(newList) and show the orphan-removal error ("collection was no longer referenced") and why to mutate the same collection.
  3. Planned mistake: put CascadeType.ALL on OrderLine.product; delete an order and watch it try to delete a product used elsewhere (constraint error).
  4. Remove the cascade and show the order deletes alone.
  5. Summarize: cascade only parent-to-owned-children.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.