-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate Doesn't Treats SQL Server Dateparts as Keywords
PostPosted: Mon Apr 02, 2012 10:51 am 
Newbie

Joined: Mon Apr 02, 2012 10:20 am
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.