求助!!!sql语句转成HQL后运行出错

1、sql语句运行正常:
SELECT
M.id,
U.name AS applyname,
T.name,
U2.name AS frist_approvername,
U3.name AS second_approvername
FROM
mgr_business AS M
LEFT JOIN mgr_business_type AS T ON M.business_type_id = T.id
LEFT JOIN ac_user AS U ON M.apply_user_id = U.id
LEFT JOIN ac_user AS U2 ON M.first_approve_user_id = U2.id
LEFT JOIN ac_user AS U3 ON M.second_approve_user_id = U3.id

2、转HQL后运行出错:
SELECT
Mgr.Id,
U. NAME AS applyName,
T. NAME AS TypeName,
U2. NAME AS fristapprovername,
U3. NAME AS secondapprovername,

FROM
TMgrBusiness AS Mgr
LEFT JOIN TType AS T WITH Mgr.businesstypeId = T.Id
LEFT JOIN TAcUser AS U WITH Mgr.applyuserId = U.Id
LEFT JOIN TAcUser AS U2 WITH Mgr.firstapproveruserId = U2.Id
LEFT JOIN TAcUser AS U3 WITH Mgr.secondapproveruserId = U3.Id

3、报错内容:
严重: Servlet.service() for servlet [default] in context with path [/wlgw] threw exception [org.springframework.orm.hibernate3.HibernateQueryException: Path expected for join! [ SELECT Mgr.Id FROM com.model.TMgrBusiness AS Mgr LEFT JOIN TType AS T WITH Mgr.businesstypeId = T.Id LEFT JOIN TAcUser AS U WITH Mgr.applyuserId = U.Id LEFT JOIN TAcUser AS U2 WITH Mgr.firstapproveruserId = U2.Id LEFT JOIN TAcUser AS U3 WITH Mgr.secondapproveruserId = U3.Id ]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Path expected for join! [ SELECT Mgr.Id FROM com.model.TMgrBusiness AS Mgr LEFT JOIN TType AS T WITH Mgr.businesstypeId = T.Id LEFT JOIN TAcUser AS U WITH Mgr.applyuserId = U.Id LEFT JOIN TAcUser AS U2 WITH Mgr.firstapproveruserId = U2.Id LEFT JOIN TAcUser AS U3 WITH Mgr.secondapproveruserId = U3.Id ]] with root cause
org.hibernate.hql.ast.QuerySyntaxException: Path expected for join! [ SELECT Mgr.Id FROM com.model.TMgrBusiness AS Mgr LEFT JOIN TType AS T WITH Mgr.businesstypeId = T.Id LEFT JOIN TAcUser AS U WITH Mgr.applyuserId = U.Id LEFT JOIN TAcUser AS U2 WITH Mgr.firstapproveruserId = U2.Id LEFT JOIN TAcUser AS U3 WITH Mgr.secondapproveruserId = U3.Id ]
请问该如何处理? 谢谢!!!!

1个回答

SELECT Mgr.Id FROM com.model.TMgrBusiness AS Mgr LEFT JOIN TType AS T WITH Mgr.businesstypeId = T.Id LEFT JOIN TAcUser AS U WITH Mgr.applyuserId = U.Id LEFT JOIN TAcUser AS U2 WITH Mgr.firstapproveruserId = U2.Id LEFT JOIN TAcUser AS U3 WITH Mgr.secondapproveruserId = U3.Id中 com.model.TMgrBusiness 映射文件配置有问题

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问