title: Using entity id as a reference in Hibernate
body: <p>I would like to hold a ref of some other entity using its identifier. </p>
  
  <p>The object model which I am working on is huge and related entities hold lot of data. Also few pieces are cyclic in nature and I suspect that holding objects directly will be a problem.</p>
  
  <p>So consider following as an example say there are two entities A &amp; B:</p>
  
  <pre><code>Class A
  {
  private String id;
  private String name;
  private String type;
  private String b_id // A reference to instance of B without holding direct instance
  }
  
  Class B
  {
  private String id;
  private String name;
  private String type;
  }
  </code></pre>
  
  <p>How do I achieve this using Hibernate framework? </p>