title: Hibernate mapping many to one with condition
body: <p>I have two tables, a user table and an address table. A user has many addresses. But the address has a column that says is primary or not:</p>
  
  <pre><code>User table: Id,Name
  Address table: Id, fkUserId, AddressLine,isPrimary
  </code></pre>
  
  <p>I want to have in my hbm an user class, for the table User, with just the primary address, but I don't know how to set the Address class in the user mapping with the condition ("filter" by the fkUserId and isPrimary=true</p>
  
  <p>Someone knows how can I do this?</p>
  
  <p>Thanks</p>