1

I have a question about doctrine persistance mechanisme.

Situation : I have a ManyToMany relation,and I add some entities in a defined order, but when I retrieve my entities there are retrieved in a different order. it's like doctrine change the order when saving entities.

Example : Obj_A (id=3) and Obj_B1 (id = 2) , Obj_B2 (id = 5), Obj_B3 (id = 1)

when retrieved, the order of Obj_B* id obj3, obj1, obj2 it's like an id order.

Can you help me please. I have to retrieve theme in the initial order.

Best Regards,

4

1 回答 1

1

已解决,通常学说按 id(主键)对条目进行排序,因此,为了保存顺序,必须创建一个与其自己的 Id 的类关联(这将保持排序)。

于 2013-08-05T11:23:42.933 回答