I found the same issue after upgrading hibernate. This document https://docs.jboss.org/hibernate/orm/6.4/querylanguage/html_single/Hibernate_Query_Language.html#datetime-literals shows how to format the stirng literal.
In your example
wt.endDate = '9999-12-31 23:59:00'
should look like
wt.endDate = {ts '9999-12-31 23:59:00' }