There is 1 update.
 
 
Wiki Analyzer / cid:jira-generated-image-avatar-124cbf37-ebce-408d-b5cd-cb488b47c024 WANALYZER-1 Open

The statistics compare the hidden flag of the pages with a number

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-ea98b99f-eac1-49fd-aae2-b06a7a5f7ab4 Changes by Thomas Mortagne on 17/Nov/26 15:35
 
Description: {{WikiAnalyzer.Statistics}} compares the hidden flag of the pages with a number, in an HQL and an XWQL query:

{noformat}
doc.hidden <> 1
{noformat}

Since Hibernate 6, HQL checks the types of both sides of a comparison when the query is parsed, and rejects incompatible ones ({{SemanticException: Cannot compare left expression of type ... with right expression of type ...}}). XWiki is moving to Hibernate 7 (XWIKI-19708), where these queries will fail on every database. With Hibernate 5 the literal is copied as is in the SQL, so the queries rely on the database converting it implicitly, which not all databases do.

This probably already fails on PostgreSQL, where the hidden flag is stored in a {{boolean}} column which can't be compared with an integer.

Compare it with a boolean instead ({{doc.hidden <> true}}). This works with all the databases and all the Hibernate versions.


PS: This post was co-written with Claude Code.