Hi All,
I am trying to get Informix working with NHibernate on windows 7. I have a connection string that works fine with informix now, it is this,
Database=db;Server=server:port;uid=username;password=password;pooling=false
I am using the IBM.Data.Informix .NET provider version 9.0.0.2.
We have a number of different applications that work fine using this provider with the Informix servers that we are running.
My nhibernate application is connecting to the informix server now, but the problem is the form of the SQL that it is producing.
If my nhibernate code looks like this,
using (ISession session = Config.SessionFactory.OpenSession())
{
return session
.CreateCriteria<DBTable>()
.Add(Restrictions.Eq("FieldValue", true))
.List<DBTable>();
}
I am new to Informix, but if I am not wrong the correct SQL would be this,
select * from DBTable where fieldValue = 'T'
But instead the SQL is it producing is,
select * from DBTable where fieldValue = True
Which is not working. I tried adding stuff like this to the nhibernate config file,
<property name="query.substitutions">True=T,False=F</property>
<property name="query.substitutions">True 'T',False 'F'</property>
<property name="query.substitutions">True='T',False='F'</property>
<property name="query.substitutions">True T,False F</property>
but that just doesn't seem to work. I couldn't find consistent documentation as to how to use the query.substitutions, and it seemed to differ depending on what database type you are using.