title: Does JPA use entity equals for comparison in queries
body: <p>If I do a comparison between two objects in a JPA query. Ex</p>
  
  <pre><code>select user.id where user = :user
  </code></pre>
  
  <p>Does JPA use the equals method on the User class to compare the two or does it use something like PK?</p>