title: How to filter entities by their parents in ManyToOne side in Google App Engine
body: <p>I use Google App Engine. When I try to do a JPA query like this: </p>
  
  <pre><code>SELECT p FROM Participant p 
  WHERE p.party.id = :partyKey AND p.name=:participantName 
  </code></pre>
  
  <p>I get the following error </p>
  
  <pre><code>Caused by: org.datanucleus.store.appengine.FatalNucleusUserException: 
  SELECT FROM Participant p WHERE p.party.id = :partyKey AND p.name=:participantName: 
  Can only reference properties of a sub-object if the sub-object is embedded.
  </code></pre>
  
  <p>I gave the key of the Party object as a parameter to the "partyKey" named parameter.</p>
  
  <p>The model is like this: Party has multiple Participants. </p>
  
  <p>I want to query a participant based on the party and the name of the participant. I just can't figure out how to filter using the party. What options do I have?</p>
  
  <p>I've also tried the following query:</p>
  
  <pre><code>SELECT FROM Participant p 
  WHERE p.party = :party AND p.name=:participantName
  </code></pre>
  
  <p>but it results in the following error:</p>
  
  <pre><code>Caused by: org.datanucleus.store.appengine.FatalNucleusUserException: 
  SELECT FROM Participant p WHERE p.party = :party AND p.name=:participantName: 
  Key of parameter value does not have a parent.
  </code></pre>