Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql SQL到HQL的语法如何?或者我可以直接使用SQL,但我也希望结果是JSON?_Mysql_Hibernate_Hql - Fatal编程技术网

Mysql SQL到HQL的语法如何?或者我可以直接使用SQL,但我也希望结果是JSON?

Mysql SQL到HQL的语法如何?或者我可以直接使用SQL,但我也希望结果是JSON?,mysql,hibernate,hql,Mysql,Hibernate,Hql,我想将此SQL查询转换为HQL: SELECT count(*) as count, b.* FROM resource_view as a, resource as b where b._id = a.resource_id and a.class_id = '$id_class' group by a.resource_id order by count desc limit 5 那么我必须做什么呢?检查下面的示例,转换的解决方案是可用的 检查下面的示例,可以使用转换解决方案 将

我想将此SQL查询转换为HQL:

SELECT count(*) as count, b.* 
FROM resource_view as a, 
resource as b 
where b._id = a.resource_id 
and a.class_id = '$id_class'
group by a.resource_id 
order by count desc limit 5

那么我必须做什么呢?

检查下面的示例,转换的解决方案是可用的


检查下面的示例,可以使用转换解决方案


将hibernate实体类添加到帖子中将hibernate实体类添加到帖子中