From JPA 2.1 specification:
... ... If the target type is not a subtype (proper or improper) of the static type of the first argument, the query is invalid.