用于从表中获取数据的HQL查询

时间:2013-04-23 04:12:41

标签: hibernate hql

我想像这样编写一个hql

Select * from tableName where columnName= null or columnName=0

我是新手,请帮帮我

2 个答案:

答案 0 :(得分:0)

你可以尝试这样的事情。

select column1, column2,....
from tableName
where (columnName = null or columnName = 0)

下面有一些有用的教程:

http://www.tutorialspoint.com/hibernate/hibernate_query_language.htm http://www.roseindia.net/hibernate/index.shtml http://dev.wavemaker.com/wiki/bin/Dev/HqlTutorial#HHQLWHEREClause

答案 1 :(得分:0)

你可以简单地写

FROM PojoName pojo WHERE pojo.property is null or  pojo.property=0