我在hql中使用select查询。但我不能在我的API中使用。HQL查询中的语法错误“意外令牌”
收到错误为:
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token:
有人可以告诉我笏是我的HQL
代码,供大家参考错误:
Session session = SessionUtil.getSession();
Query query = session.createQuery("SELECT a.mobile, a.email, p.patientId FROM (SELECT l "
+ "from login l where email= :email and password= :password) a INNER JOIN patientprofile p ON a.loginId= p.loginId");
query.setParameter("email", email);
query.setParameter("password", password);
List<Login> logins = query.list();
session.close();
return logins;
你可以分享完整的错误@mree请 –
org.hibernate.hql.internal.ast.QuerySyntaxException:意外的标记:(靠近第1行,第44列[SELECT a.mobile,a.email,p.patientId FROM( SELECT l.LoginId,l.email,l.mobile from com.innovellent.hibernate.restapi.model.Login l where email =:email and password =:password)INNER JOIN com.innovellent.hibernate.restapi.model.PatientProfile p ON a.loginId = p.loginId] – mehul