Hot get List of objects with Hibernate, when Entity mapped as Many To One
<p>I have a class <code>User</code>, that contains List of <code>Contacts</code>
User class:</p>

<pre><code>@Entity
@Table(name = "profile")
public class User implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(unique = true)
    private String login;

    @OneToMany(mappedBy = "owner", cascade = CascadeType.ALL)
    private List&lt;Contact&gt; contacts;
    ...
    ...
}
</code></pre>

<p>Contact class:</p>

<pre><code>@Entity
@Table
public class Contact implements Serializable {
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private int id;

        @ManyToOne
        @JoinColumn(name = "user_profile_id")
        private User owner;
        ...
        ...
    }
</code></pre>

<p>how may i get List of Contacts by User.id field?</p>