title: How would I use jpa to query for a parameter IN a list of jpa objects
body: <p>I don't know exactly how to phrase this question unfortunately.</p>
  
  <p>I have two tables that are only loosely related, PERSON and ASSIGNMENT.</p>
  
  <pre><code>public class Person {
  
      @EmbeddedId
      @Column
      PersonPK id;
  
      @Column
      String otherStuff;
  }
  
  public class PersonPK {
  
      @Column
      long personNumber;
  
      @Column
      Date hireDate;
  
      @Column
      Date terminationDate;
  }
  
  public class Assignment {
      @Id
      @Column
      long id;
  
      @Column
      long personId;
  
      @Column
      boolean active;
  
      @Column
      String otherStuff;
  }
  </code></pre>
  
  <p>The PERSON one is easy to get with <code>FROM Person p WHERE [current date in between hire and termination]</code></p>
  
  <p>But i need to do a second query for assignments and I'd like to just pass the list of Persons back in instead of stripping out the id. So something like <code>FROM Assignment a WHERE a.personId IN :persons.id.id AND a.active = true</code></p>
  
  <p>Is this possible with a JPA query?</p>