title: annotation to filter results of a @OneToMany association
body: <p>I have parent/child relationship between two tables, and the corresponding mapping in my Java classes. The tables roughly look like that:</p>
  
  <pre><code>A (ref number, stuff varchar2(4000))
  B (a_ref number, other number, foo varchar2(200))
  </code></pre>
  
  <p>and the Java code:</p>
  
  <pre><code>@Entity
  class A {
      @Id
      @Column(name = "REF")
      private int ref;
  
      @OneToMany
      @JoinColumn(name = "A_REF", referencedName = "REF")
      private Set&lt;B&gt; bs;
  }
  
  @Entity
  class B {
      @Id
      @Column(name = "A_REF")
      private int aRef;
  
      @Id
      @Column(name = "OTHER")
      private int other;
  }
  </code></pre>
  
  <p>This works fine, but I'd like to add a filter on the rows that I retrieve from the child table. The query that is generated looks like:</p>
  
  <pre><code>select a_ref, other, foo from B where a_ref = ?
  </code></pre>
  
  <p>And I'd like it to be:</p>
  
  <pre><code>select a_ref, other, foo from B where a_ref = ? and other = 123
  </code></pre>
  
  <p>The additional filter would be only a column name and a hard-coded value. Is there a way to do that using hibernate annotations?</p>
  
  <p>I've looked at <code>@JoinFormula</code>, but with that I always have to reference a column name from the parent table (in the <code>name</code> attribute of the JoinFormula).</p>
  
  <p>Thanks in advance for any advice.</p>