0

我想加入我拥有的两个表,但出现错误。我使用了这个语法:

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 )*])

我怎样才能加入这两个表?

4

1 回答 1

0

您的两个表之间缺少逗号OfPlanifie o, Operateur w

此外,如果要从中选择所有列OfPlanifie,则必须这样做SELECT o.*而不是SELECT o

于 2013-08-28T10:29:22.373 回答