我想加入两张桌子,但我收到了错误。 我使用了这种语法:
Query qrec2=em.createQuery("Select o from OfPlanifie o Operateur w where o.idOpe =: w.idOpe");
但我收到了这个错误:
Caused by: Exception [EclipseLink-8025] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Syntax error parsing the query [Select o from OfPlanifie o Operateur w where o.idOpe =: w.idOpe], line 1, column 27: unexpected token [Operateur].
Internal Exception: NoViableAltException(80@[()* loopback of 477:9: (node= join )*])
我如何加入这两张桌子?
答案 0 :(得分:0)
您在两个表OfPlanifie o, Operateur w
此外,如果您要从OfPlanifie
中选择所有列,则必须执行SELECT o.*
而不是SELECT o