title: How to set parameters for a Named Query
body: <p>Hi I have a Named Query         </p>
  
  <pre><code>@NamedQuery(name = "StudyplanCategory.findByStatusAndLimit",
              query = "SELECT s FROM StudyplanCategory s WHERE 
              s.status =:status LIMIT s.start=:start,s.end=end")
  </code></pre>
  
  <p>I want to set the limit like this:</p>
  
  <pre><code>@NamedQuery(name = "StudyplanCategory.findByStatusAndLimit", 
              query = "SELECT s FROM StudyplanCategory s WHERE 
              s.status =:status LIMIT s.start=:start,s.end=end")
  </code></pre>
  
  <p>But this is showing error at the start up of the Server.
  I am using the below code to call the query in the DAO class:</p>
  
  <pre><code>Query query = entityManager.createNamedQuery("StudyplanCategory.findByStatusAndLimit");
  int end=(start*pageNumber);
  query.setParameter("status", status);
  query.setParameter("start", start);
  query.setParameter("end", end);
  return (List&lt;StudyplanCategory&gt;) query.getResultList();
  </code></pre>
  
  <p>Start and End Parameters needs to be set. Please Help.</p>