There is 1 comment.
 
 
XWiki Platform / cid:jira-generated-image-avatar-29bef890-0e09-4d75-bbcf-e455d2152be0 XWIKI-21155 Open

Allow sorting by specified field for Document Tree macro

 
View issue   ยท   Add comment
 

1 comment

 
cid:jira-generated-image-avatar-85241b8c-8adf-4b77-9f83-aeb0798e0517 Marius Dumitru Florea on 05/Nov/24 10:52
 

The problem is that the document tree uses named native queries, for the reasons explained in https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-index/xwiki-platform-index-tree/xwiki-platform-index-tree-api/src/main/resources/org/xwiki/index/tree/internal/nestedpages/query/queries.hbm.xml#L31 . I see that:

So until we upgrade to Hibernate 6+, the only option is to duplicate the named queries (i.e. have a different named query for each sort variant). I tried to search for a way to reuse named query fragments to reduce duplication, but I couldn't find any good result. So it's doable, but for now it implies adding some code (query) duplication.