| EntityGraph defines join implicitly, and I think that
Order order2 = cb.asc(root.get("chair").get("room").get("name"));
should reuse this defined joins, than creating new ones. Even more if I define join explicitly
Join roomJoin = root.join("chair", JoinType.LEFT).join("room", JoinType.LEFT);
Order doesn’t use this joins. Only workaround is to use order like that:
Order order1 = cb.asc(roomJoin.get("name"));
But there is a problem with spring data repositories, which does’t use joins in orders, it create sorting path like root.get.get…. |