I've written a query that works good if used into MySql Workbench, but it won't compile if used in my Java EE project!
Here's the query :
@NamedQuery(name = "Book.findByCourse", query = "SELECT b FROM Book b WHERE b.teaching IN (SELECT T.id FROM Teaching T, Course C WHERE T.course = C.id AND C.id = :course)")
The query works fine, but I've got this error in my Java EE project :
Error compiling the query [...], line 0, column 0: invalid IN expression argument [SubqueryNode Left: null Right: null], expected argument of type [entity.Teaching].
What's wrong with it?