title: Passing two parameters to a named query
body: <p>I have the following namedquery over my entity "Intervention ": </p>
  
  <pre><code> @NamedQuery(name = "Intervention.findNextMission", query = " SELECT i FROM Intervention  i       WHERE i.heureDebut&gt; :DateToBeSpecified and i.idAgent= :idAgent")`
  </code></pre>
  
  <p>i dont know how to call this query in my code by passing two parameters : date,id. Normally it should be like this :</p>
  
  <pre><code>List &lt;Intervention&gt; ListOfInterventions = em.createNamedQuery("Intervention.findNextMission").setParameter().getResultList();
  </code></pre>
  
  <p>what to put between the parentheses of setParameter() ??</p>
  
  <p>here follow the code of my entity Intervention :</p>
  
  <pre><code>    @Entity
  @Table(name = "intervention")
  @XmlRootElement
  @NamedQueries({
      @NamedQuery(name = "Intervention.findAll", query = "SELECT i FROM Intervention i"),
      @NamedQuery(name = "Intervention.findByIdIntervention", query = "SELECT i FROM Intervention i WHERE i.idIntervention = :idIntervention"),
      @NamedQuery(name = "Intervention.findByHeureDebut", query = "SELECT i FROM Intervention i WHERE i.heureDebut = :heureDebut"),
      @NamedQuery(name = "Intervention.findByHeureFin", query = "SELECT i FROM Intervention i WHERE i.heureFin = :heureFin"),
      @NamedQuery(name = "Intervention.findNextMission", query = " SELECT i FROM Intervention i WHERE i.heureDebut&gt; :DateToBeSpecified and i.idAgent= :idAgent")})
  public class Intervention implements Serializable {
      private static final long serialVersionUID = 1L;
      @Id
      @Basic(optional = false)
      @NotNull
      @Size(min = 1, max = 50)
      @Column(name = "IdIntervention", nullable = false, length = 50)
      private String idIntervention;
      @Basic(optional = false)
      @NotNull
      @Column(name = "HeureDebut", nullable = false)
      @Temporal(TemporalType.TIMESTAMP)
      private Date heureDebut;
      @Basic(optional = false)
      @NotNull
      @Column(name = "HeureFin", nullable = false)
      @Temporal(TemporalType.TIMESTAMP)
      private Date heureFin;
      @Lob
      @Size(max = 65535)
      @Column(name = "NotesGeneral", length = 65535)
      private String notesGeneral;
      @JoinColumn(name = "IdValidation", referencedColumnName = "IdValidation", nullable = false)
      @ManyToOne(optional = false)
      private Tablevalidation idValidation;
      @JoinColumn(name = "IdNatureIntervention", referencedColumnName =  "IdNatureIntervention", nullable = false)
      @ManyToOne(optional = false)
      private Tablenatureintervention idNatureIntervention;
      @JoinColumn(name = "IdAgent", referencedColumnName = "IdAgent", nullable = false)
      @ManyToOne(optional = false)
      private Agent idAgent;
      @JoinColumn(name = "RefContrat", referencedColumnName = "RefContrat", nullable = false)
      @ManyToOne(optional = false)
      private Projet refContrat;
  
      public Intervention() {
      }
      //getters and setters 
  }
  </code></pre>