Hibernate version:
NHibernate 1.2.1
And underlaying Database system is SQL Server 2000
Hi all,
Base on hibernate setting
"hibernate.query.substitutions" value="true 1, false 9, yes 'Y', no 'N'"
The situations is when I issue following HQL thing will be fine.
Code:
string hql = "select k.SubjectId from KBUser as k where k.Disabled=false";
Then it could be observed(via profiler within SQLServer toolset) that hibernate translate to SQL
Code:
exec sp_executesql N'select kbuser0_.SUBJECT_ID as x0_0_ from KBUSER kbuser0_ where (kbuser0_.DISABLED=@p0 )', N'@p0 bit', @p0 = 9
It's okay and it all I want, but if I change HQL like following
Code:
string hql = "select k.SubjectId from KBUser as k where k.Disabled=?";
and set the parameter to false(yes the .Net boolean type)
Code:
session.Find(hql, false)
I got hibernate translate to SQL
Code:
exec sp_executesql N'select kbuser0_.SUBJECT_ID as x0_0_ from KBUSER kbuser0_ where (kbuser0_.DISABLED=@p0 )', N'@p0 bit', @p0 = 0
It seems that Hibernate does not substitute the false parameter value to 9 and by default using 0 to do translation.
How can I fix such problem? Is a bug or is my misunderstanding?
Please help on this.
Thanks in advance!