title: Hibernate select id of join column without join
body: <p>The problem is I need to select an object from database which has a join column inside, and I need the Id of that foreign object. But hibernate joins those two tables or if in lazy mode , It queries again on my database. 
  How do I access that Id with no other join or query than the primary select query.</p>
  
  <p>Note that I am using Hibernate version +5 and I want an approach via <code>JPA</code> <code>CriteriaBuilder</code>.</p>
  
  <p>Thank you in advance.</p>