下面sql怎么改为hql,多谢
阅读
select adusername,count(adusername) as nnum from news_content where uptime >='"+st+"' and uptime <= '"+et+"' group by adusername union select username as adusername,(select count(id) from news_content where uptime >='"+st+"' and uptime <= '"+et+"' and news_content.adusername = news_admin.username) as nnum from news_admin
------解决方案--------------------
我给你个sample:
select * from dual where id = ?1
然后有个setPre,也就是赋值的.把对应的参数放进去就好..上面的HQL语句,只是把参数换成了?1 占位符,
这样的sample.你可以在网上百度下的.
------解决方案--------------------
From 类名 对象名 where 对象.属性=? 应该用map追加参数,不要用'"++"',那样输入'会报错的
------解决方案--------------------
------解决方案--------------------
阅读
上一篇:hibernate注解配置集合映射list,该如何处理 下一篇:返回列表