public
void
testWhereClause(){
String hql=
" from Country as country where country.cname is not null";
Session session=
CustomSessionFactory.getSession();
Query query=session.createQuery(hql);
List<Country> list=query.list();
for(Country country:list){
System.
out.println(
"编号:"+country.getCcode()+"
名称:"+country.getCname());
}
CustomSessionFactory.closeSession();
}
一、范围运算:
二、字符匹配运算:
三、逻辑运算
四、集合运算
五、四则预算
六、查询单个对象