我正在尝试使用 JPARepository 使用以下查询,但它抛出
org.hibernate.QueryException:意外的字符:'`'”
例外。
这是我的命名查询:
@NamedQuery(name = "shift_planner.fetchThisWeekShiftDetails",
query =
"SELECT r.resouce_name,s.shift_name,sp.plan_date
FROM elias.shift_planner sp, elias.resources r, elias.shifts s
WHERE sp.resource_id=r.resource_id and sp.shift_id=s.shift_id
AND YEARWEEK(`plan_date`, 1) = YEARWEEK(CURDATE(), 1)"
)
Run Code Online (Sandbox Code Playgroud)