title: search on Long value in Database with CriteriaBuilder
body: <p>im trying to search for an "Order" in my "Order"-table in my database, and i'm not finding it because of the get() method, which accepts just strings and not long values. 
  Here is the code:</p>
  
  <pre><code>  public List&lt;OrderItemEntity&gt; findOrderItem(OrderItem orderitem){
      long id = orderitem.getId();
      EntityManager em = emf.createEntityManager();
      try {
          CriteriaBuilder cb = em.getCriteriaBuilder();
          CriteriaQuery&lt;OrderItemEntity&gt; cq = cb.createQuery(OrderItemEntity.class);
          Root&lt;OrderItemEntity&gt; root = cq.from(OrderItemEntity.class);
          cq.where(cb.equal(root.get("id"), String.valueOf(id))); &lt;&lt;---- THIS LINE!!
          TypedQuery query = em.createQuery(cq);
          List&lt;OrderItemEntity&gt; result = query.getResultList();
          System.out.println("orderID found is: " + result.get(0).getId());
          return result;
      } finally {
          em.close();
      }
  }
  </code></pre>
  
  <p>can anyone help? How could I cast that "id" in a string value?</p>
  
  <p>Thanks! </p>