متعدد إلى متعدد وكيانات الربط
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
know when @ManyToMany is enough and when to model the link.
الموضوعات المخطط لها
@ManyToManyuses 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 (
OrderLinelinksOrderandProductwith quantity and price). - Each side then has a plain
@OneToManyto 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.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.