1 Reply Latest reply on Sep 1, 2008 10:15 AM by zergspirit

    entitymanager

    tonyukuk
      How can I add to variables to my query

      this.getEntityManager().createQuery("select salesPrice from Price where depotname = :depotname" and where productname=:productname).setParameter("depotname", depotname).getSingleResult().toString();

      setParameter function allow me to add only one variable "depotname" to the query but I need a second one to get the result that I want. Is there any way to do this?
        • 1. Re: entitymanager
          zergspirit

          As simple as that:



          this.getEntityManager().createQuery("select salesPrice from Price where depotname = :depotname" and where productname=:productname).setParameter("depotname", depotname).setParameter("productname", productname).getSingleResult().toString();