title: @OneToOne unidirectional and bidirectional
body: <p>I have two examples that first is @OneToOne unidirectional mapping and second bidirectional. In unidirectional mapping, the owning-side table must contain a join column that refers to the other table's id; then in bidirectional both of them must contain a foreign key column for each other. But after generating the database schema with autogenerate strategy, two examples have the same effect on database schema. Unidirectional mapping is normal but the bidirectional example only contains one foreign key column, but it must be involve each other's foreign key!</p>
  
  <p><strong>Unidirectional Mapping</strong></p>
  
  <pre><code>@Entity
  public class Customer43 {
  
  @Id
  @GeneratedValue
  private Long id;
  private String firstName;
  private String lastName;
  private String email;
  private String phoneNumber;
  @OneToOne
  @JoinColumn(name = "address_fk")
  private Address43 address;
  
  // Getters, Setters and Constructors.
  }
  
  @Entity
  public class Address43 {
  
  @Id
  @GeneratedValue
  private Long id;
  private String street1;
  private String street2;
  private String city;
  private String state;
  private String zipcode;
  private String country;
  
  // Getters, Setters and Constructors.
  }
  </code></pre>
  
  <p><strong>Bidirectional Mapping</strong></p>
  
  <pre><code>@Entity
  public class Customer44 {
  
  @Id
  @GeneratedValue
  private Long id;
  private String firstName;
  private String lastName;
  private String email;
  private String phoneNumber;
  @OneToOne
  @JoinColumn(name = "address_fk")
  private Address43 address;
  
  // Getters, Setters and Constructors.
  }
  
  @Entity
  public class Address44 {
  
  @Id
  @GeneratedValue
  private Long id;
  private String street1;
  private String street2;
  private String city;
  private String state;
  private String zipcode;
  private String country;
  @OneToOne(mappedBy = "address")
  private Customer44 customer;
  
  // Getters, Setters and Constructors.
  }
  </code></pre>
  
  <p>Why is the database schema output the same and why does bidirectional mapping act like unidirectional?</p>