What is named queries in Hibernate?
In Hibernate named query is define the query in the model class or mapping itself. For example:
@NamedQuery(name="allStudentRecords",query="SELECT st FROM Student st WHERE st.sroll > ?1"),
You can use the named query in your program as shown below:
Query query=em.createNamedQuery("allStudentRecords"); query.setParameter(1, 100);
Read more at JPA Named Queries.