I have the following namedquery over my entity \"Intervention \":
@NamedQuery(name = \"Intervention.findNextMission\", query = \" SELECT i FROM Intervention i
setParameter
accepts either (int position,Object value)
or (String parameterName,Object value)
. So your code could look as:
Date aDate=....
Long anId=....
List ListOfInterventions = em.createNamedQuery("Intervention.findNextMission")
.setParameter("DateToBeSpecified",aDate,avax.persistence.TemporalType,DATE)
.setParameter("idAgent",anId).getResultList();
Note that when you use a Date
you should specify the TemporalType
intended.