Q:

JPA and ManyToMany recursive relationship makes a bad query

In Hibernate version 5 I have a simple Entity with a recursive ManyToMany and when I do a join fetch on the relationship I get a query with two joins. I think only one join is needed. Any idea why two joins are getting generated or how to fix it?
@Entity
public class Employee implements Comparable<Employee> {
    @Id Integer id;    
    @ManyToMany
    protected Set<Employee> opinionCitations;
    // getters, setters
}

and 
em.createQuery("select distinct e from Employee e left join fetch e.opinionCitations").getSingleResult();

gives me
select distinct 
    employee0_.id as id1_0_0_, 
    employee2_.id as id1_0_1_, 
    opinioncit1_.Employee_id as Employee1_1_0__, 
    opinioncit1_.opinionCitations_id as opinionC2_1_0__ 
from 
    Employee employee0_ 
    left outer join Employee_Employee opinioncit1_ on employee0_.id=opinioncit1_.Employee_id 
    left outer join Employee employee2_ on opinioncit1_.opinionCitations_id=employee2_.id

A:

No there's nothing wrong. It joins Employee table with the link table Employee_Employee and then back to Employee. Just like you'd expect with a @ManyToMany.
With a @OneToMany you could get away with a single join, as it doesn't require a link table, but then you'd have a tree structure which probably isn't what you want.

