网站首页
Java
站长
开源
框架
理论
JS
Linux
DB
服务器
网络编程
生活
软件
PHP
其他
您的位置:首页 > 开源 > org.hibernate.hql.internal.ast.QuerySyntaxException
org.hibernate.hql.internal.ast.QuerySyntaxException
2015-7-20    14940    0

SpringJPA自定义查询时报错:

org.hibernate.hql.internal.ast.QuerySyntaxException


这是代码中发生了一些不匹配的情况,请对比一下写法,检查自己的代码:


@Query(value="select a.id as id,a.game_Name as gameName from co_smsfee_Temp a",nativeQuery = true)
public List<Map<String,Object>> findAllGetName();


注意的是:

1:字段名和表名都是按照数据库实际情况来写,而不是实体的字段。

2:要标注nativeQuery属性,告诉SpringJPA执行SQL查询。

上一篇: 常用SpringJPA主键生成策略,UUID和自增
下一篇: Web测试调试插件RESTClient和HttpRequester
发表评论:
您的网名:
个人主页:
编辑内容: