Skip to content

Instantly share code, notes, and snippets.

@aziz781
Created November 3, 2011 13:01
Show Gist options
  • Save aziz781/1336420 to your computer and use it in GitHub Desktop.
Save aziz781/1336420 to your computer and use it in GitHub Desktop.
java: Hibernate String How to execute named query
public boolean dealerExists(String agentNumber) {
return getSessionFactory().getCurrentSession()
.getNamedQuery("myapp.namedquery").setParameter(0, agentNumber)
.list().get(0) != null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment