Hello,
My problem is quite easy. I need to get a database date/time to using query like this: SELECT now() or SELECT CURRENT_TIMESTAMP.
HQL treats now() or CURRENT_TIMESTAMPS as aliases (I don't know how to tell him to pass these to sql). That's why I tried using createSQLQuery function, however it requires specyfing return class. What class should I use? I was trying different combinations, for example:
Code:
session.createSQLQuery("select CURRENT_TIMESTAMP {time}", "time", GregorianCalendar.class).list()
however it gives following exception:
Code:
net.sf.hibernate.MappingException: No persister for: java.util.GregorianCalendar
This seems strange to me as I don't have to map library classes.
I suppose the solution is straightforward and it's just my incompetence that causes problems :)
Help! :)
julius