Hi all,
I'm using Hiberbate 3.0.5 and Firebird 1.5.2.
I need a sql that returns the first day of a month. I wrote the follow HQL:
Code:
select ccb.data - day(ccb.data) + 1 from CompraCombustivel ccb
The translation is perfect and SQL is executed by Firebird with no error. But when I try to get the result:
Code:
ScrollableResults sr = query.scroll();
while ( sr.next() ) {
...
the program throws:
Code:
22:05:13,984 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: 07006
22:05:13,984 ERROR [JDBCExceptionReporter] Error converting to int.
java.lang.RuntimeException: org.hibernate.exception.SQLGrammarException: could not read next row of results
What is happing? Is Hibernate "thinking" this SQL returns a integer because the day() function? Is there a way to avoid this?
Rgds,
Leandro