title: Circular Dependecy of Pojo in Hibernate project
body: <p>I typical hibernate pojo class looks </p>
  
  <pre><code>public class User {
  
      private String username;
      .
      .
      .
      private Address address;
  
  }
  
  public classs Address {
  
      private String line1
      .
      .
      .
      private User user;
  
  }
  </code></pre>
  
  <p>i.e 1-1 dependency means one user has one address and vise verse one address belong to one user.</p>
  
  <p>Now this dependency expressed through composition is very difficult to modularize.</p>
  
  <p>As when project gets big, I would like to use multi-module dependency of maven and split the pojos/ domain objects in different modules/ projects.</p>
  
  <p>But this causes circular dependency and we do like wise all the classes are inter-related. </p>
  
  <p>And because we are using them in orm of hibernate we need them to be strictly composite of each other.</p>
  
  <p>Any suggestion where we can split these in independent
  1. user module
  2. address module</p>
  
  <p>Allowing me to use only one which is required.</p>
  
  <p>I read through some post which suggests to use templates/ interfaces but I doubt it will work with hibernate behind the scenes.</p>