I have read its definition but not able to understand fully.
According to http://www.objectdb.com/java/jpa/query/named A named query is a statically defined query with a predefined unchangeable query string. Using named queries instead of dynamic queries may improve code organization by separating the JPQL query strings from the Java code. It also enforces the use of query parameters rather than embedding literals dynamically into the query string and results in more efficient queries.
Here is an Example, You should import
import javax.persistence.NamedQueries; import javax.persistence.NamedQuery;
@NamedQueries({
@NamedQuery(name = "Tenantdata.findAll", query = "SELECT c FROM Tenantdata c"),
@NamedQuery(name = "Tenantdata.findById", query = "SELECT c FROM Tenantdata c WHERE c.id = :id")
}
)