Hey Jakob Braeuchi, ANSI SQL supports queries like "WHERE (X, Y, ...) in ((A, B, ...), (C, D), ...)", including variations using a subquery. Unfortunately, MySQL is one of the DBs that doesn't handle certain forms of those queries. In this case, using the explicit join is the only option.
Note that the JPA spec (4.6.13, Collection Member Expressions) even states that:
Expressions that evaluate to embeddable types are not supported in collection member expressions. Support for use of embeddables in collection member expressions may be added in a future release of this specification.
That obviously doesn't mean that ORM can't do so (and we do, if the SQL construct is supported by the DB), but it's not typically supported/used.
|