We have an entity formula that requires today's date at midnight in order to calculate itself properly.
Code:
DATEADD(DD, DATEDIFF(DD, 0, GETDATE()), 0)
Hibernate transforms this into:
Code:
DATEADD(mytablename0_.DD, DATEDIFF(mytablename0_.DD, 0, GETDATE()), 0)
I have tried both Day and DD. I have double checked that my dialect is SQLServerDialect. I have also tried to trick hibernate into doing it correctly by setting
Code:
hibernate.query.substitutions
to
Code:
Day=DD
Is there any way to get hibernate to treat either Day or DD as a keyword?