title: Spring Data Rest: How to search by another object's key?
body: <p>In Spring-Data-Rest an object's ID is the URI returned with the object. For example, if I have a User, it might have a URI like:</p>
  
  <pre><code>http://example.com/users/1
  </code></pre>
  
  <p>In an authentic REST api, this URI is the id of the object, you are not supposed to use just '1' as the id.</p>
  
  <p>Give that, how do I search for all Orders that belong to that User?</p>
  
  <pre><code>http://example.com/orders/search/findByUser?user={{XXX}}
  </code></pre>
  
  <p>Specifically, what do I use for {{XXX}}?</p>
  
  <p>I know I could do the opposite search:</p>
  
  <pre><code>http://example.com/users/1/orders
  </code></pre>
  
  <p>But in my case I need to search for matching jobs so I can add additional parameters which are also keys.</p>
  
  <p>I can export <code>/orders/search/findByUser</code> by creating this function definition on OrderRepository:</p>
  
  <p>List findByUser(User user);</p>
  
  <p>and <code>findByUser</code> will be exported by Spring-Data-REST, but how do I specify the <code>User</code> as a GET parameter?</p>
  
  <p>Again, I'm specifically looking for the pure REST solution, since the Spring Data Rest project is trying to encourage purity.</p>