1

the following query :

SELECT P FROM Project P WHERE :currentUser IN(P.assignedUsers)

throws the following error :

org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement: "...."; expected "NOT, EXISTS, INTERSECTS, SELECT, FROM";

Am i using the IN operator wrong, or am i supposed to do it differently.

Project.assignedUsers : is a list containing users (a OneToMany Relationship). and the currentUser parameter is a valid user.

Morty
  • 3,463
  • 4
  • 17
  • 21

1 Answers1

3

You cannot use implicit joins for this purpose; you probably want to utilize the member of operator:

SELECT P FROM Project P WHERE :currentUser MEMBER OF P.assignedUsers
Community
  • 1
  • 1
Dragan Bozanovic
  • 23,102
  • 5
  • 43
  • 110