A simple JPQL query produces an unnecessary table join.
Please refer to the attached testcase (NetBeans project).
, in(emp.projects) proj
proj = roject
The generated native SQL is:
employee0_.id as id2_,
employee0_.name as name2_
The generated SQL should have only one join, in other words the project table should not be included.
Please refer to the attached testcase if this is useful - you need to set up the required libraries.
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing)