title: Join Two table in Criteria Query
body: <p>I have three tables one is ItemCategory,ItemMaster and Price. I am referring  itemaCategoryId in ItemMaster table and like that referring itemmasterid in price. Now i have to display contents of price order by itemcategory id. This is my  criteria query.</p>
  
  <pre><code>CriteriaBuilder cb = entityManager.getCriteriaBuilder();
      CriteriaQuery&lt;Price&gt; cq = cb.createQuery(Price.class);
      Root&lt;Price&gt; root = cq.from(Price.class);
      Root&lt;ItemMaster&gt; itemMasterRoot = cq.from(ItemMaster.class);
      Root&lt;ItemCategory&gt; itemCategoryRoot = cq.from(ItemCategory.class);
      Join&lt;ItemMaster, ItemCategory&gt; s=itemMasterRoot.join(ItemMaster_.category);     
      Join&lt;Price,ItemMaster&gt; y=root.join(Price_.itemMaster);
  
      Path&lt;Long&gt; itemMasterId=root.get(Price_.itemMasterId);
      cq.select(root).where(cb.equal(root.get(Price_.priceMasterId), priceMasterId))
      .orderBy(cb.asc(itemMasterId));
  
      TypedQuery&lt;Price&gt; q = entityManager.createQuery(cq);
  </code></pre>
  
  <p>Above my criteria Query</p>