Informix Boolean legacy support
Activity
Show:
Vladimír Kuruc June 5, 2024 at 10:54 AM
I don't need to differentiate based on the database version. Rather, the point is that when I want to map tables with a legacy smallint column in a new database (I don't have the ability to alter the table), then I have that option. I can achieve this using @Converter.
Christian Beikov June 5, 2024 at 10:37 AM
If you want to maintain support for such old versions of Informix, please add the appropriate version checks e.g.
@Override
public int getPreferredSqlTypeCodeForBoolean() {
return getVersion().isSameOrAfter( 8 ) ? super.getPreferredSqlTypeCodeForBoolean() : Types.BIT;
}
@Override
public void appendBooleanValueString(SqlAppender appender, boolean bool) {
if ( getVersion().isSameOrAfter( 8 ) ) {
appender.appendSql( bool ? "'t'" : "'f'" );
}
else {
appender.appendSql( bool ? "1" : "0" );
}
}
Vladimír Kuruc June 5, 2024 at 10:15 AM
I suggest closing the issue as a solution has been found based on the proposal from the discussion in issue
https://hibernate.atlassian.net/browse/HHH-17655.
@Converter(autoApply = true)
public class ShortBooleanConverter implements StandardBooleanConverter<Short> {
...
This solution works for me since version 6.5
Christian Beikov April 4, 2024 at 1:54 PM
Please provide a PR with a fix for this. This is a community dialect, so the Hibernate team does not spend any effort on maintaining or testing it.
Won't Fix
Details
Details
Assignee
Unassigned
UnassignedReporter
Vladimír Kuruc
Vladimír KurucComponents
Priority
Created June 18, 2020 at 12:17 PM
Updated June 5, 2024 at 11:04 AM
Resolved June 5, 2024 at 11:04 AM
After changes in https://hibernate.atlassian.net/browse/HHH-9894#icft=HHH-9894, Informix Boolean type is supported. Hibernate InformixDialect declares support for Informix version 7.3, when this data type was not supported.
Guide to SQL Syntax Version 73
I propose SMALLINT data type column mapping support for Informix 7.3 and legacy database schemas via a variable as in SAP HANA Driver ("hibernate.dialect.informix.use_legacy_boolean_type")