title: one-to-one mapping using unique constraint not working as expected
body: <p>I'm trying this simple uni-directional one-to-one relationship </p>
  
  <p>Person ----> Address</p>
  
  <p>using many-to-one mapping with unique constraint.</p>
  
  <p>This is how my mapping looks like in Person.hbm.xml:</p>
  
  <pre><code>&lt;class name="Person" table="PERSON"&gt;
  &lt;many-to-one name="address" column="ADDRESS_ID" cascade="all" not-null="true" unique="true"/&gt;
  </code></pre>
  
  <p>I think this should allow only one unique Address per Person - no two Persons can share a common address. </p>
  
  <p>So, the following code should fail. But in this code Hibernate allows both the Johns to stay at same address.</p>
  
  <pre><code>    Session session = HibernateUtil.getSessionFactory().openSession();
      Transaction transaction = session.beginTransaction();
      Address address = new Address("Bond Street", "London", 121212);
      Person person1 = new Person("John Doe", address);
      Person person2 = new Person("John McClane", address);
      session.save(person1);
      session.save(person2);
      transaction.commit();
      session.close();
  </code></pre>
  
  <p>Please let me know what am I missing here?    </p>