title: How to map these classes with Hibernate?
body: <p>Suppose I've these 2 classes:</p>
  
  <pre><code>class A{
  
      B ref1 = null; //Can both be null
      B ref2 = null;
  
  }
  
  class B{
  
      ..
  }
  </code></pre>
  
  <p>I'm omitted the getters and setters for ref1 and ref2. Of course I want to add ids... Anyway what I want is to have hibernate handle automatic persistence of these two references... and to have automatic deletion of B objects. I thought of using one-to-one between each property ref* of A and B. But I got lost :) Can you give suggestions? I want to use SchemaExport.</p>
  
  <p>Thank you.</p>