Java 案例..在hql中查询时
我必须对照条目检查Java 案例..在hql中查询时,java,hql,Java,Hql,我必须对照条目检查null。 我有一个address in person对象,所以我尝试按如下方式获取它 select new map(person.id as id, case when person.address is not empty then person.address.city end as city) from Person person where person.id=:id case..when使用where
null
。
我有一个address in person对象,所以我尝试按如下方式获取它
select new map(person.id as id,
case when person.address is not empty
then person.address.city end as city)
from Person person where person.id=:id
case..when
使用where
子句吗
但是没有错误和结果。试试这个:
select new map(person.id as id,coalesce(person.address,person.address.city )as city) from Person person
可能重复的