How a list table can remain as it (to be unsort)

Hi all,
I need a list table to remain as it (to be unsort).
In next screen-shoot is the the list in order that I choose
Choose_order

and after OK (insert) the order is not the same
Choose_order_after_insert

I need to have the same sort order like in list table, how can I do this?

I attache the example project.
sort.zip (88.1 KB)

Hi.

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.

Regards,
Nadezhda.

1 Like

Thank you Nadezhda for your answer,
So I need the table order like in database.
Look in table the order is not the same with order that comes from database
Screenshot_20210426_113438
I choose Medicinale, Tinctoriale and Plante oleifere and in table load order Medicinale, Plante oleifere and Tinctoriale after logoff and login.
Screenshot_20210426_114751
I not need to sort asc or desc the table, because is important to remain the order choose by user.

Hello!

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:

  1. Select “debug” for eclipselink.sql logger and click on the “set” button.
  2. 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

image

In the Browse screen

image

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:

image

Note, that I’ve changed Set type of property to List and get this in the Editor:

Interval Editor

image

Hi Roman,
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 :
Screenshot_20210427_081738

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

Screenshot_20210427_082900

In table linked, the records order in the table is Aromatice și condimentare, Tinctoriale, Vița de vie
Screenshot_20210427_085837

Exist a solution for this aspects?

I found who change the order.
In where clause AND (t1.DELETE_TS IS NULL) changed the order, look:
Screenshot_20210427_094509