There is 1 update.
 
 
Holiday Request / cid:jira-generated-image-avatar-71b62eb1-8ab2-4cef-bc69-ec6f9d3e4ebc HOLIDAYREQ-44 Open

The JSON service compares the start and end dates with strings

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-f0790e3c-6e1f-4007-93a6-19c106d30da0 Changes by Thomas Mortagne on 17/Nov/26 15:35
 
Description: {{HolidayRequest.HolidayRequestJSON}} compares the start and end date properties of the requests with strings:

{noformat}
startDate.value <= '${end}' and endDate.value >= '${start}'
{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.

On Oracle, this already depends on the date format of the database session ({{NLS_DATE_FORMAT}}).

Bind the dates as {{java.util.Date}} query parameters instead (which also avoids injecting request parameters in the query). This works with all the databases and all the Hibernate versions.


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