Hibernate version: 3.5.3-Final
DB: Firebird 2.1
Using org.hibernate.dialect.FirebirdDialect, JPA 2.0
I am having a problem with the SQL generated for one of my JPQL queries - here is an excerpt from the where clause:
Code:
date(timestamp_column)<=date_column
This obviously got generated because timestamp_column is annotated @Temporal(TemporalType.Timestamp) while date_column is @Temporal(TemporalType.Date)
The trouble is that Firebird does not understand this syntax, it should be parsed as
Code:
CAST(timestamp_column AS DATE)<=date_column
I thought it is an issue with the dialect and was trying to subclass the FirebirdDialect to override this behaviour. But I could not find any place in the dialect that would be responsible for this concrete piece of SQL. Thought even about doing some regex replacement in Dialect.transformSelectString, but it turns out it does not work as I supposed (ie. it is not called on every query sent to DB)
Does anyone have an idea where does the date() function come from and what can I tweak to get it working?
Thanks a lot
Martin Cerny