Skip to content

Instantly share code, notes, and snippets.

@ssinganamalla
Created August 16, 2013 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssinganamalla/6246159 to your computer and use it in GitHub Desktop.
Save ssinganamalla/6246159 to your computer and use it in GitHub Desktop.
find the single record.
public User findByEmail(String email) {
Query query = this.em.createQuery("SELECT user FROM User u where u.email= :theemail");
query.setParameter("theemail", email);
return (User) query.getSingleResult();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment