Hibernate version: 2.1.8
Name and version of the database you are using:Oracle 8i
Oracle allows subtracting two dates, it returns a floating point number which represents the days (and fractions of a day) between the two dates.
I can't convince Hibernate 2.1.8 to pass the date subtraction through to oracle. Is it possible? Is it possible in Hibernate3?
Here is a very simple example:
Code:
SELECT hg.closedDate-hg.createdDate FROM TicketStats hg
And the ensuing traceback:
Code:
Caused by: net.sf.hibernate.QueryException: , expected in SELECT [SELECT hg.closedDate-hg.createdDate FROM com.verisign.mss.storage.TicketStats hg]
at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:169)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114)
at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:295)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1571)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1542)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at com.verisign.mss.storage.hibernate.StatsHgramRowBasedHDAO.getCountsOverTime(StatsHgramRowBasedHDAO.java:158)
... 14 more