hibernate - org.hibernate.hql.ast.QuerySyntaxException:期待关闭,发现
问题描述
我正在执行休眠查询。它会产生以下错误。当从 SQL 工作台执行查询时,它会产生预期的结果。
List<Object[]> studentResult = new ArrayList<Object[]>();
String queryStudentResult = "select sd.student_id,sd.name,sd.email_address,sd.phone_number,sd.dob,sd.gender ,st.test_score,CAST(st.test_score AS DECIMAL(4,2))/CAST(st.total_max_score AS DECIMAL(4,2))*100 AS testscore,std.percentage,std.college_name,std.college_city,std.college_state,rd.Degree,rb.branch_Name,se.10_percentage,se.12_percentage " +
" from student_details sd " +
"inner join student_test_completion st on sd.student_id=st.student_id " +
"inner join student_login sl on sl.student_id=sd.student_id " +
"inner join test_details td on td.test_id =sl.test_id " +
"inner join category c on c.category_id =td.category_id " +
"inner join student_degree_details std on std.stu_degree_id = (select stu_degree_id from student_degree_details where student_id= st.student_id LIMIT 1 ) " +
"inner join registration_degree rd on rd.Degree_ID= std.degree " +
"inner join registration_branch rb on rb.branch_Id= std.branch " +
"inner join student_education se on se.student_id=sd.student_id " +
"where CAST(st.date_of_test as date) between ? and ? and st.college_name=? " +
"and c.category_name='Assessment' and std.isCurrent_degree=1 ";
Object[] queryParam = {date1,date2,testdetails.getCollege_name()};
studentResult = template.find(queryStudentResult, queryParam);
student_id LIMIT 1 ) rd.Degree_ID 上的内连接registration_degree rd=std.degree 内连接registration_branch rb 上的rb.branch_Id= std.branch 内连接student_education se on se.student_id=sd.student_id 其中CAST(st.date_of_test as date) 之间? 和 ?和 st.college_name=? 和 c.category_name='Assessment' 和 std.isCurrent_degree=1 ] 在 org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54) 在 org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java :47)
解决方案
推荐阅读
- unity3d - 如何使爆炸仅影响 x 轴而不影响 y 轴统一
- python - 创建带有输出的条件循环
- c# - 以编程方式在本地 Azure DevOps 服务器工作项注释中为 Active Directory 用户帐户添加 @提及(2021 年 1 月)
- amazon-web-services - AWS Cognito Post 身份验证触发器获取身份 ID
- python - Django - 我如何返回 json 响应错误?
- javascript - JavaScript:使用 .forEach 到 html 内容的 JSON 属性
- python - 在不使用内置函数的情况下循环遍历和排序 pandas 中的行
- node.js - 无法使用 Node.js 将图像发布到 aws-s3 服务
- flutter - 在 Flutter 中通过邮件发送文件附件
- react-native - Yarn Workspaces 是仅存在于一个工作空间中的提升模块