title: Hibernate: Extra cross join for order by field in spring jpa repository
body: <p>I have a problem with a Spring JPARepository, when add sort of nested field object.</p>
  
  <p>In controller it's called a method with param Pageable, contained sort == '<code>parent.shortDescription ASC and shortDescription ASC</code>'. After Pageable go to <code>mapObjectDao.findByType(...)</code>, hibernate construct wrong sql-query (with cross join).</p>
  
  <p>//controller</p>
  
  <pre><code>public Page&lt;MeteoInfoDto&gt; list(MeteoInfoFilter filter, Pageable pageable) {
      mapObjectDao.findByType(MapObjectType.Meteo, pageable);
  }
  </code></pre>
  
  <p>//repository</p>
  
  <pre><code>@Query(value = "select m from MapObject as m left join fetch m.parent as parent left join fetch m.road as road left join fetch m.parentRegion as parentRegion left join fetch m.parentOrganization as parentOrganization where m.type = :type", countQuery = "select count(m.dbid) from MapObject m where m.type = :type")
  Page&lt;MapObject&gt; findByType(@Param("type") MapObjectType type, Pageable pageable);
  </code></pre>
  
  <p>//HQL</p>
  
  <pre><code>select m from MapObject as m left join fetch m.parent as parent left join fetch m.road as road left join fetch m.parentRegion as parentRegion left join fetch m.parentOrganization as parentOrganization where m.type = :type order by m.parent.shortDescription asc, m.shortDescription asc
  </code></pre>
  
  <p>//hibernate sql output</p>
  
  <pre><code>select
          mapobject0_.dbid as dbid1_27_0_,
          ....
          mapobject4_.parent_org_id as parent_15_27_4_ 
      from
          map_object mapobject0_ 
      left outer join
          map_object mapobject1_ 
              on mapobject0_.parent_id=mapobject1_.dbid 
      left outer join
          map_object mapobject2_ 
              on mapobject0_.road_id=mapobject2_.dbid 
      left outer join
          map_object mapobject3_ 
              on mapobject0_.parent_region_id=mapobject3_.dbid 
      left outer join
          map_object mapobject4_ 
              on mapobject0_.parent_org_id=mapobject4_.dbid 
  
      cross join map_object mapobject5_
  
      where
          mapobject0_.parent_id=mapobject5_.dbid 
          and mapobject0_.type=? 
      order by
          mapobject5_.short_description asc,
          mapobject0_.short_description asc limit ?
  </code></pre>
  
  <p>//model</p>
  
  <pre><code>public class MapObject extends DomainObject {
  
      private UUID id;
      private MapObjectType type;
      ...
      private MapObject parent;
      private MapObject parentRegion;
      private MapObject parentOrganization;
      private MapObject road;
      ...
      private Set&lt;MapObject&gt; children;
      private Set&lt;MapObject&gt; childrenRegion;
      private Set&lt;MapObject&gt; childrenOrganization;
  }
  </code></pre>
  
  <p>Why it add <code>cross join map_object mapobject5_</code> for sort <code>parent.shortDescription</code>?</p>