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

متعدد إلى متعدد وكيانات الربط

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

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

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

في هذا الدرس

know when @ManyToMany is enough and when to model the link.

الموضوعات المخطط لها

  • @ManyToMany uses a hidden join table with only the two foreign keys.
  • It cannot hold extra data (quantity, date, price at the time).
  • When the link has data, create an entity for it (OrderLine links Order and Product with quantity and price).
  • Each side then has a plain @OneToMany to the join entity.
  • Prefer explicit join entities from the start in real systems.
تفاصيل المخطط المبدئي

عرض عملي

a diagram: Order 1 — * OrderLine * — 1 Product, where OrderLine has quantity and unitPrice.

اختبر فهمك

Where do you store the quantity of a product in an order?

أظهر الإجابة

In the join entity OrderLine.

التطبيق

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

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

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

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