pletzma wrote:
Hello,
despite I read
http://www.hibernate.org/hib_docs/v3/re ... yhql-where it is not clear for me how hibernate handles sql-functions in hql-where clause.
E.g. we use to_date('2004/10/10','YYYY/MM/DD'). I guess to_date() is non standard SQL at any DB.
So I want to know if I am barking up the right tree.
My clue is:
Hibernate passes sql-functions to the underlying DB without converting or translating. True or False?
How does hibernate detect sql-functions?
Thanks for help.
greets,
martin
For functions that aren't predefined, you can extend the Dialect you are using and register the new functions.
in your case it might be something like
Code:
registerFunction( "to_date", new SQLFunctionTemplate(Hibernate.STRING, "to_date(?1,'YYYY/MM/DD')") );