Hi,
I am trying to run the Hibernate unit tests with Informix. Here is one problem I have come across. Informix changes all column and alias names to lowercase.
In the connection string you can specify one of two modes depending on the DELIMIDENT parameter:
- Allow quoted identifiers for column names etc. This is necessary to pass various Hibernate tests as quoted identifiers are used a lot. In this case the JDBC driver does not do any mapping in the ResultSet.findColumn, so you can only find columns if you refer to them with lowercase names.
- Do not allow quoted identifiers. In this case when you request a column by name from a ResultSet, the JDBC driver changes it to lowercase before passing it on to Informix, which means that ResultSet retrievals of columns by name will work fine. But you can't use quoted identifiers, which means lots of Hibernate tests would fail.
For instance, with DELIMIDENT=1 set to allow quoted identifiers:
select foo as FooBar from bar;
You will get:
- ResultSet.findColumn("foobar") succeeds
- ResultSet.findColumn("FooBar") fails
- So the unit tests fail (specifically ParentChildTest can't find column nullBlob0_)
select foo as "FooBar" from bar;
You will get:
- ResultSet.findColumn("foobar") fails
- ResultSet.findColumn("FooBar") succeeds
- Unit test would now succeed
So my question is: is there a way to tell Hibernate to use quotes around all references to columns/aliases? Could this be controlled by the dialect? Is there a better solution (I'd rather not hack the JDBC driver).
Versions:
Hibernate 2.1.4
Informix 9.4 UC2 on RedHat
JDBC 2.21JC5
JRockit 1.4.2_04
Thanks,
Marko
|