SQL语句如下:
select * from yx_news_type
where typecode='005'
union
select * from yx_news_type
where typecode='005001'
union
select * from yx_news_type
where typecode='005001004'
union
select * from yx_news_type
where typecode='005001004003'
问题:如果用SQL语句直接查询数据库时,得到的结果是4个值,可是用Hibernte查询的时间,为什么出来的结果只有一个?
select * from yx_news_type
where typecode='005'
union
select * from yx_news_type
where typecode='005001'
union
select * from yx_news_type
where typecode='005001004'
union
select * from yx_news_type
where typecode='005001004003'
问题:如果用SQL语句直接查询数据库时,得到的结果是4个值,可是用Hibernte查询的时间,为什么出来的结果只有一个?
使用 createSQLQuery()