I'm using Hibernate 3.3.2GA against an Informix 11.5 database.
Records are begin- and end-dated in this database, so I want to define where clauses for a few classes to limit the retrieval to only active records, which would look like this:
Code:
<class name="ClassName" table="table_name" schema="informix"
where="begin_dt <= TODAY AND (end_dt IS NULL OR end_dt > TODAY)">
...
This makes use of the Informix built-in function TODAY which returns the current date (it also has CURRENT which returns current datetime). However, Hibernate is considering this to be a column and is therefore prepending its table prefix to it to treat it like another column of this table. This results in an error:
Column (today) not found in any table in the query (or SLV is undefined)Can someone tell me if...
1.) there's some generic Hibernate way of referencing the database current date, or
2.) there's someplace I can tweak the Hibernate code so that I can prevent it from prepending the table prefix to the TODAY or CURRENT Informix functions?
Thanks!
-Jeff