title: Nestjs one to many relationship save issue
body: <p>I have a service where I'm trying to save an entity with relation entities(one to many).What I have is:</p>
  <p>Payment entity:</p>
  <pre><code>@Entity('payment')
  export class PaymentEntity {
  
   @PrimaryColumn()
   id: number;
  
   @OneToMany(type =&gt; PaymentExamEntity, paymentExam =&gt; paymentExam.payment,  { cascade: true })
   paymentExams: PaymentExamEntity[];
  
    ... 
  }
  </code></pre>
  <p>PaymentExamEntity:</p>
  <pre><code>@Entity('payment_exam')
  export class PaymentExamEntity {
    
    @PrimaryColumn()
    id: number;
  
    @ManyToOne(type =&gt; PaymentEntity, payment =&gt; payment.paymentExams)
    @JoinColumn({name: 'payment_id'})
    payment: PaymentEntity;
  
    ....
  }
  </code></pre>
  <p>PaymentService:</p>
  <pre><code>@Injectable()
  export class PaymentService {
      constructor(@InjectRepository(PaymentEntity) private paymentRepo: Repository&lt;PaymentDTO&gt;,
                  @InjectRepository(PaymentExamEntity) private paymentExamRepo: Repository&lt;PaymentExamDTO&gt;) {  }
  
      async create(data: PaymentDTO) {  
          const payment = this.paymentRepo.create(data);
          await this.paymentRepo.save(payment);
  
          for(let item of data.paymentExams){
              item.payment = payment;
  
              const paymentExams = this.paymentExamRepo.create(data.paymentExams);
              this.paymentExamRepo.save(data.paymentExams);
          }
          
          return payment;
      }
  </code></pre>
  <p>I can see that the payment entity is saved but the paymentExams entities failed to saved due to missing foreign key value.</p>
  <pre><code>[Nest] 11545   - 01/01/2021, 12:15:52 AM   [ExceptionsHandler] ER_NO_DEFAULT_FOR_FIELD: Field 'payment_id' doesn't have a default value
  </code></pre>
  <p>The problem is that the payment object does not updated with auto generated id from database after save.Thus the assignment of foreign key is null. Is there any other solution for this. How can I store child entities?</p>
  <p>Thanks in advance</p>