title: JPA ManyToMany where annotation
body: <p>I'm using JPA / EclipseLink 2.5.2 and want to add an additional where clause to my ManyToMany Mapping. The SQL Code would look like this:</p>
  
  <pre><code>SELECT * FROM Friends f
  INNER JOIN User u ON f.friend_id = u.id 
  WHERE f.verified=1; 
  </code></pre>
  
  <p>So I managed to do the JoinMapping with:</p>
  
  <pre><code>@Entity
  @NamedQueries({
      @NamedQuery(name="User.findAll", query="SELECT u FROM User u"),
      @NamedQuery(name="User.login", query="SELECT a FROM User a WHERE a.username = :name and a.password = :password"),
      @NamedQuery(name="User.findId", query="SELECT a FROM User a WHERE a.id = :id"),
      @NamedQuery(name="User.findName", query="SELECT a FROM User a WHERE a.username = :name")
  
  })
  public class User implements Serializable {
  ...
  @ManyToMany
  @JoinTable(
      name="Friends"
      , joinColumns={
          @JoinColumn(name="user_id")
          }
      , inverseJoinColumns={
          @JoinColumn(name="friend_id")
          }
      )
  List&lt;User&gt; friends;
  }
  </code></pre>
  
  <p>But I dont know how to add the <code>WHERE f.verified=1</code></p>
  
  <p>How can this be realized?</p>
  
  <p>Thanks in advance,
  Cassidy</p>