Thank you for your answer, but I think a feature request towards IBM to change this will probably take quite a while, and the chances are probably slim. I don't think we can wait for that.
Original Message:
Sent: Wed June 11, 2025 01:38 PM
From: Andreas Legner
Subject: Informix with Hibernate 6.X anyone?
Hi Øyvind,
apart from the question whether or how these two queries could be considered equivalent, selecting NULL without any type information currently isn't allowed in Informix (whether "syntax error" is the best possible error for this might be a separate question.) Unfortunately we cannot conclude any type information from such NULL's position in the projection clause, as that might be the writer's intention only in some cases.
I can see that other RDBMS do handle such syntax, even more complex ones where type info is more relevant, like
SELECT 1.234 AS a, NULL AS b
FROM dual
UNION
SELECT NULL AS a, 1234 AS b
FROM dual;
But it's hard to anticipate in what all contexts this had to be made working, or what implications this might be having on client code.
Anyway, a feature request shouldn't hurt!
Further thoughts?
BR,
Andreas
------------------------------
Andreas Legner
Informix Dev
HCL Software
------------------------------
Original Message:
Sent: Wed June 11, 2025 04:22 AM
From: Øyvind Gjerstad
Subject: Informix with Hibernate 6.X anyone?
SQL Query generated by Hibernate version 5.x.x:
select
varestrom0_.varestr_kode as varestr_1_641_0_,
varestrom0_.beskr as beskr2_641_0_,
varestrom0_.edi_varestr_kode as edi_vare3_641_0_
from
varestrommer varestrom0_
where
varestrom0_.varestr_kode=?
Which works completely fine....
SQL Query generated by Hibernate version 6.x.x:
select
null,
v1_0.beskr,
v1_0.edi_varestr_kode
from
varestrommer v1_0
where
v1_0.varestr_kode=?
Which doesn't work and gives SQLGrammarException: could not prepare statement [A syntax error has occurred.]
The primary key here is varestr_kode, this is a char(3) field, and is an assigned key with Hibernate.
We are still using the legacy hbm.xml based mappings rather than annotation based mappings. The mapping for this table is as follows (package names changed):
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd" >
<hibernate-mapping>
<class
name="com.example.dal.tgprod.domain.Varestrom"
table="varestrommer"
lazy="false"
>
<meta attribute="class-description" inherit="false">
@hibernate.class
table="varestrommer"
</meta>
<id
name="varestrKode"
type="com.example.hibernate.type.TrimmedString"
column="varestr_kode"
>
<meta attribute="field-description">
@hibernate.id
generator-class="assigned"
type="com.example.hibernate.type.TrimmedString"
column="varestr_kode"
</meta>
<generator class="assigned" />
</id>
<property
name="beskr"
type="com.example.hibernate.type.TrimmedString"
column="beskr"
length="70"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="beskr"
length="70"
</meta>
</property>
<property
name="ediVarestrKode"
type="com.example.hibernate.type.TrimmedString"
column="edi_varestr_kode"
length="5"
>
<meta attribute="use-in-tostring">true</meta>
<meta attribute="field-description">
@hibernate.property
column="edi_varestr_kode"
length="5"
</meta>
</property>
<!-- Associations -->
</class>
</hibernate-mapping>
------------------------------
Øyvind Gjerstad
Developer/Architect
PostNord AS
Original Message:
Sent: Tue June 03, 2025 09:03 AM
From: Marcus Haarmann
Subject: Informix with Hibernate 6.X anyone?
Hi,
we have used the version from the community dialects package without any issues,
but as far as I know from our development, they are using an inherited / slightly modified
dialect anyway. Anyway it always depends on the features being used for the application.
We are pretty much using basically standard without any fancy types / very limited usage of
stored procedures.
What kind of issues are you having with the original version ?