title: @OneToOne is failing for Null @JoinColumn JPA
body: <p>While inserting the employee record through Postman, i am getting following exception. </p>
  
  <p>I have following tables:
  1. emp_boarding_detail -> Has subcon_id coulmn and subcon_id can be null.
  2. suncon_details table - Having subcon_id as Primary Key 
  3. Some other tables also</p>
  
  <p><strong>Exception:</strong>
  "org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : com.boarding.preboardingentities.Empboardingdetails.subcondetails -> com.boarding.preboardingentities.Subcondetails; nested exception is java.lang.IllegalStateException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : com.boarding.preboardingentities.Empboardingdetails.subcondetails -> com.boarding.preboardingentities.Subcondetails"</p>
  
  <p>In EmpboardingDetails entity class, I have defined relationship as following<a href="https://i.stack.imgur.com/A8yoS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A8yoS.png" alt="enter image description here"></a>:</p>
  
  <p>And this is my SubconDetails entity class:</p>
  
  <p><a href="https://i.stack.imgur.com/KdORb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KdORb.png" alt="enter image description here"></a></p>
  
  <p>As subcon_id can be null, so I have added new column id in SubconDetail class. Is it the right approach? I am getting below exception when I am not passing SubconDetail as following: </p>
  
  <p>Part of my Post Request(Postman):
   "sub_con_id" : {
      "sub_con_id" : "",
      "subcontractor_or_companyname" : "",
      "w2payer_company" : ""
    },</p>