I\'m using the Criteria API basically the first time. It\'s about abstracting queries for a generic builder:
public TypedQuery newQuery( Manager,T&
.from(class) does not use an INNER join for all relationships, it only queries the class.
A relationship will only be queried if you use the join() or fetch() API, to use an outer join use join() with a JoinType.LEFT.
https://en.wikibooks.org/wiki/Java_Persistence/Criteria#Join
I'm not sure why you are seeing joins if you are not calling join(). Some JPA providers automatically join fetch all EAGER relationships, this may be what you are seeing. I have always though this odd, perhaps your JPA provider has a away to be configured not to do this, or you can make the relationships LAZY.
I had the same issue... After investigation the conclusion is That you hâve to handle this with left join in your jpql See that: http://www.objectdb.com/java/jpa/query/jpql/path#Navigation_through_a_NULL_value_