有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java需要标识,找到“:”

我正在为我的Spring项目构建一个本地查询。有人知道问题是什么吗

@Query(value = "SELECT e.first_name as firstName, e.last_name as lastName, jh.start_date as startDate, jh.end_date as endDate, " +
                "j.job_title as jobName, d.department_name as departmentName FROM JOB_HISTORY jh " +
                "JOIN JOBS j ON jh.JOB_ID = j.JOB_ID " +
                "JOIN DEPARTMENTS d ON JH.DEPARTMENT_ID = d.DEPARTMENT_ID " +
                "JOIN EMPLOYEES e ON jh.EMPLOYEE_ID = e.EMPLOYEE_ID " +
                "ORDER BY jh.:sortBy :orderBy")
        List<EmployeeJobView> getAllEmployeeJob(String sortBy, String orderBy);

org.hibernate.hql.internal.ast.QuerySyntaxException: expecting IDENT, found ':' near line 1, column 348 [SELECT e.first_name as firstName, e.last_na me as lastName, jh.start_date as startDate, jh.end_date as endDate, j.job_title as jobName, d.department_name as departmentName FROM JOB_HISTORY jh JOIN JOBS j ON jh.JOB_ID = j.JOB_ID JOIN DEPARTMENTS d ON JH.DEPARTMENT_ID = d.DEPAR TMENT_ID JOIN EMPLOYEES e ON jh.EMPLOYEE_ID = e.EMPLOYEE_ID ORDER BY jh.:sortBy :orderBy]


共 (0) 个答案