How can I get Entity by name in JPA?
<p>I have entity</p>

<pre><code>@Entity
@Table(name = "USER")
public class CrmUser implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String username;
    ...
</code></pre>

<p>And I have DAO with <code>EntityManager</code> How can I get user by <code>username</code>?</p>

<pre><code>@Override
    public User getUser(String login) throws Exception {
        User crmUser = (User) userJpaDao.getEntityManager()..............
        return crmUser;
    }
</code></pre>