title: How to use prepared statement in JPA
body: <p>I am a play framework application Developer.I am using createNativeQuery method in JPA. In this example i want to use prepared statement. Please anyone help me?
  Here is the code without JPA. I need help to convert it to Prepared statement.</p>
  
  <pre><code>Query query = JPA.em().createNativeQuery("select count(*) from truck t inner join" +
      "box b where t.truck_id=b.truck_id and t.shipment_upc='" + code + "'");
  
  BigInteger val = (BigInteger)query.getSingleResult();
  System.out.println(val);
  </code></pre>