[英]HQL query for fetching data from a table
I want to write a hql as like this 我想这样写一个hql
Select * from tableName where columnName= null or columnName=0
As i am new to this please help me out 由于我是新手,请帮帮我
You could try something like this. 您可以尝试这样的事情。
select column1, column2,....
from tableName
where (columnName = null or columnName = 0)
There are some useful tutorials below: 以下是一些有用的教程:
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 http://www.tutorialspoint.com/hibernate/hibernate_query_language.htm http://www.roseindia.net/hibernate/index.shtml http://dev.wavemaker.com/wiki/bin/Dev/HqlTutorial#HHQLWHEREC条款
你可以简单地写
FROM PojoName pojo WHERE pojo.property is null or pojo.property=0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.