title: Spring JPA REST sort by nested property
body: <p>I have entity <code>Market</code> and <code>Event</code>. <code>Market</code> entity has a column:</p>
  
  <pre><code>@ManyToOne(fetch = FetchType.EAGER)
  private Event event;
  </code></pre>
  
  <p>Next I have a repository:</p>
  
  <pre><code>public interface MarketRepository extends PagingAndSortingRepository&lt;Market, Long&gt; {
  }
  </code></pre>
  
  <p>and a projection:</p>
  
  <pre><code>@Projection(name="expanded", types={Market.class})
  public interface ExpandedMarket {
      public String getName();
      public Event getEvent();
  }
  </code></pre>
  
  <p>using REST query <code>/api/markets?projection=expanded&amp;sort=name,asc</code> I get successfully the list of markets with nested event properties ordered by market's name:</p>
  
  <pre><code>{
      "_embedded" : {
          "markets" : [ {
              "name" : "Match Odds",
              "event" : {
                  "id" : 1,
                  "name" : "Watford vs Crystal Palace"
              },
              ...
          }, {
              "name" : "Match Odds",
              "event" : {
                  "id" : 2,
                  "name" : "Arsenal vs West Brom",
              },
              ...
          },
          ...
      }
  }
  </code></pre>
  
  <p>But what I need is to get list of markets ordered by <strong>event's name</strong>, I tried the query <code>/api/markets?projection=expanded&amp;sort=event.name,asc</code> but it didn't work. What should I do to make it work?</p>