Table does not affect the sorting order of entities. The order comes as is from database, so there is no way to get unsorted entities.
If you want to get similar order after saving your instance, you should set ORDER BY any field condition in Articles browser query and programmatically sort inner CollectionPropertyContainer by the same field in Inventory editor and choose ordered entities.
I think the order is not the same due to Set type of Inventory#id_article property.
Also, check a generated SQL in the “Administration -> Server Log” screen:
Select “debug” for eclipselink.sql logger and click on the “set” button.
Try to edit inventory and check what SQL is generated.
For the demo project above I get this generated SQL for the Browser screen :
SELECT LIMIT ? ? ID AS a1, CODE AS a2, DELETE_TS AS a3, DELETED_BY AS a4, NAME AS a5, VERSION AS a6 FROM SORT_ARTICLE WHERE (DELETE_TS IS NULL)
And the order:
In the DB
In the Browse screen
For Editor I get 3 queries:
select from the client;
select inventory with client
select articles with given inventory.
SQL for articles with given inventory:
SELECT t1.ID, t1.DELETE_TS, t1.DELETED_BY, t1.NAME, t1.VERSION FROM SORT_INVENTORY_ARTICLE_LINK t0, SORT_ARTICLE t1 WHERE (((t0.INVENTORY_ID = ?) AND (t1.ID = t0.ARTICLE_ID)) AND (t1.DELETE_TS IS NULL))
The order in the DB:
Note, that I’ve changed Set type of property to List and get this in the Editor:
Thank you for your tips with debug log.
Also I changed from Set type of property to List but not resolve the problem.
Look also not write in the same order from the table in database,
I choose - Tinctoriale, Aromatice și condimentare, Vița de vie :
after insert (Confirm) in database is written Tinctoriale, Vița de vie, Aromatice și condimentare - windows <2> and <3> but the editor load Aromatice și condimentare, Tinctoriale, Vița de vie - because the select used Script-6
SELECT t1.ID, t1.DELETE_TS, t1.DELETED_BY, t1.NAME, t1.VERSION FROM BIOGEN_TAXONOMY_CULTURECATEG_LINK t0, BIOGEN_CULTURECATEG t1 WHERE (((t0.TAXONOMY_ID = ‘f58530ce-782c-55ec-b985-00dc2cd3d91e’) AND (t1.ID = t0.CULTURECATEG_ID)) AND (t1.DELETE_TS IS NULL))
return this order Aromatice și condimentare, Tinctoriale, Vița de vie
In table linked, the records order in the table is Aromatice și condimentare, Tinctoriale, Vița de vie