NHibernate and MySql Keywords

Posted by jalchr on Stack Overflow See other posts from Stack Overflow or by jalchr
Published on 2010-04-17T20:55:14Z Indexed on 2010/04/17 21:13 UTC
Read the original article Hit count: 175

Filed under:
|
|

Why Nibernate HQL can not handle the following query:

from Deal D where (D.ApprovalDate + INTERVAL 1 Year) < current_timestamp() <  (D.RenewalDate + INTERVAL -1 Year) 

knowing that INTERVAL and YEAR are keywords in MySQL, so this is kind of mixing Sql within Hql (unless Hql can handle date functions like so and I don't know) . The dialect is MySQLDialect

Its perfectly valid to execute this query

  SELECT '2005-01-01' + INTERVAL 1 Year;

© Stack Overflow or respective owner

Related posts about hql

Related posts about nhibernate