title: JPA query many to one association
body: <p>I want to build the following pseudo query</p>
  
  <p><code>Select a From APDU a where a.group.id= :id</code></p>
  
  <p>group is a field in APDU class of the type APDUGroup.class.</p>
  
  <p>I just want to get a list of APDUs based on APDUGroup's id.</p>
  
  <p>How do i do that using a standard JPA query?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Yes, I have tried the above query and tried other variations for hours before posting in S/O. Here is the generated SQL for the query above:</p>
  
  <pre><code>SELECT t1.ID, t1.status, t1.type, t1.modified, t1.response, t1.expectedSize, t1.created, t1.description, t1.sequence, t1.name, t1.command, t1.recurring, t1.auth, t1.createdBy, t1.APDUGroup, t1.modifiedBy FROM APDUGroup t0, APDU t1 WHERE ((t0.ID = ?) AND (t0.ID = t1.APDUGroup))
  </code></pre>
  
  <p>The query looks okay but nothing get selected from my table.
  There are at least 100 APDUs with APDUGroup = 1 in my test database.</p>
  
  <p>I'm using eclipselink as the JPA provider.</p>