title: Typeorm relationships - save by id
body: <p>I've been kinda confused by the relationships as I'm used to save relationship by id, while docs and examples I found suggest to get the entire object and use that instead (Isn't this strange???)</p>
  
  <p>I found this on github addressing this issue ( <a href="https://github.com/typeorm/typeorm/issues/447" rel="noreferrer">https://github.com/typeorm/typeorm/issues/447</a> ) , where they suggest to use an object with just the id property, but it's from 2017. Is that a good way to do it ? And is it still the only way to do it ? (I find it pretty lame tbh)</p>
  
  <pre class="lang-js prettyprint-override"><code>async create( @Body() product: Product) {
      product.category = &lt;any&gt;{ id: product.category };
      return { payload: await this.repository.persist(product) };
  }
  </code></pre>
  
  <p>Another one suggested to name the column as categoryId and it would work as expected (with id instead of object) but WHY? What does the name have to do with that ??</p>
  
  <pre class="lang-js prettyprint-override"><code>@Entity()
  class Product {
  
       @Column({ type: "int", nullable: true })
       categoryId: number;
  
       @ManyToOne(type =&gt; Category)
       @JoinColumn({ name: "categoryId" })
       category: Category;
  
  }
  </code></pre>
  
  <p>I'm just confused, help ^_^</p>