title: How do I create Named Queries in a Separate file
body: <p>I need to keep the all the named queries in a separate file. For example </p>
  
  <pre><code>@javax.persistence.NamedQueries({
      @NamedQuery(name = "Employee.findAll", query = "SELECT e FROM Employee e")})
  
  public class AllNamedQueries {
  
  }
  </code></pre>
  
  <p>Now that much in itself causes an Error "Named queries can only be defined in Entity or MappedSuperClass class". </p>
  
  <p>How do I create Named Queries in a Separate file? By separate I mean files other than entity file.</p>