Datagrid sorting with additional store

Hello,

I created an application with an additional datastore named GIGC. GIGC is essentially a Db2 for i instance. I configured this new datastore via Studio as a Generic JDBC Store and implemented the necessary classes (DataStore, DbmsFeatures, etc.). Then, I created two entities: one stored in the main datastore and the other in GIGC. After that, I created generic list+details views. One of the entities is correctly sorted in the datagrid of list view, while the other is not sorted at all.

What am I missing ?

UPD 21/03:

The request used by EclipseLink is wrong. Here what I see in the log:

> SELECT * FROM (
>     SELECT * FROM (
>         SELECT EL_TEMP.*, ROWNUMBER() OVER() AS EL_ROWNM FROM (
>             SELECT SCHEMA_NAME AS a1, SCHEMA_CREATOR AS a2, CREATION_TIMESTAMP AS a3, SCHEMA_TEXT AS a4, SCHEMA_OWNER AS a5, SCHEMA_SIZE AS a6 FROM SYSSCHEMAS ORDER BY SCHEMA_NAME ASC
>         ) AS EL_TEMP
>     ) AS EL_TEMP2 WHERE EL_ROWNM <= ?
> ) AS EL_TEMP3 WHERE EL_ROWNM > ?

Here is what it should be:

> SELECT * FROM (
> 	SELECT * FROM (
> 		SELECT EL_TEMP.*, ROWNUMBER() OVER(ORDER BY a6 DESC, a1 ASC) AS EL_ROWNM FROM (
> 			SELECT SCHEMA_NAME AS a1, SCHEMA_CREATOR AS a2, CREATION_TIMESTAMP AS a3, SCHEMA_TEXT AS a4, SCHEMA_OWNER AS a5, SCHEMA_SIZE AS a6 FROM QSYS2.SYSSCHEMAS ORDER BY SCHEMA_SIZE DESC, SCHEMA_NAME ASC
> 		) AS EL_TEMP
> 	) AS EL_TEMP2 WHERE EL_ROWNM <= ?
> ) AS EL_TEMP3 WHERE EL_ROWNM > ?

Best regards.
JMIX 2.5.0-243 / IntelliJ 2024.3.5 / Ubuntu 24.04.2 LTS

Hi Stephane,

I see the following issue in EclipseLink: Sorting not honored with JPA and Oracle · Issue #2301 · eclipse-ee4j/eclipselink · GitHub
Looks like it’s fixed.

We are going to upgrade EclipseLink in June 2025 release, see Update Jmix 2.x eclipselink fork to 4.0.5 · Issue #4278 · jmix-framework/jmix · GitHub. I hope it will bring the fix to Jmix.

Regards,
Konstantin

Thank you, I’ll follow that.