Spring 5.0 +Jpa,使用@Query实现 自定义查询报错:
java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: student is not mapped [select id,name,createtime,sex,age from student s]
原因是查询语句中 from 后面写的是实体类名,而不是表名。
Spring 5.0 +Jpa,使用@Query实现 自定义查询报错:
java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: student is not mapped [select id,name,createtime,sex,age from student s]
原因是查询语句中 from 后面写的是实体类名,而不是表名。
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。