在Hibernate2.x里Hql支持 not is null 也支持 is not null 但是你打印出SQL语句就可以发现两者到最后生成的SQL语句都就变成了 is not null
但是在Hibernate3.x里Hql就不支持 not is null 的写法了,这是公司系统从Hibernate2.x升级到Hibernate3.x时候发现的,所以在Hibernate2.x里还是不要写成 not is null,
免得升到Hibernate3的时候麻烦
本文讨论了Hibernate中HQL查询语言关于NULL条件处理的变化。在Hibernate 2.x中,not is null 和 is not null 均被支持且最终生成相同的SQL。然而,在Hibernate 3.x中不再支持not is null语法。建议开发者使用is not null以确保代码向前兼容。
在Hibernate2.x里Hql支持 not is null 也支持 is not null 但是你打印出SQL语句就可以发现两者到最后生成的SQL语句都就变成了 is not null
但是在Hibernate3.x里Hql就不支持 not is null 的写法了,这是公司系统从Hibernate2.x升级到Hibernate3.x时候发现的,所以在Hibernate2.x里还是不要写成 not is null,
免得升到Hibernate3的时候麻烦

被折叠的 条评论
为什么被折叠?