Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5892 มุมมอง

Normally (I assume) when you use the many2many relationship the ORM creates a junction table for you and the order in which the records are returned for either direction is the order in which they were created/populated the database.


I have a situation where I have two entities:

 - Procedures

 - Sequences


The same sequence can be associated with more than one procedure, however each procedure has a unique sort order. 

For instance procedure A, B, C may reference dozens of Sequences, but all share Sequence B, however Sequence B may be the first sequence on Procedure A, the second last on Procedure B, etc...


Would I solve this problem by simply introducing the junction table explicitly in the model - using double one to one relationships?

อวตาร
ละทิ้ง

Good question, I am also interested in the relationship many2many the possibility of setting priorities.

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.พ. 19
2218
3
พ.ย. 18
8745
0
ส.ค. 17
3711
3
ธ.ค. 23
5941
4
ต.ค. 21
23865