title: Primary key of Parent Entity not stored as Foreign Key in Child Entity
body: <p>I am using OneToMany relationship in spring data Jpa and testing the api using postMan </p>
  
  <pre><code>@Entity
  @Table(name = "book_category")
  public class BookCategory {
  ParentEntity
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "bookCat_id")
      private Long id;
  
      private String name;
  
      @OneToMany(cascade = CascadeType.ALL, mappedBy="bookCategory")
      private Set&lt;Book&gt; books;
  
      public BookCategory(String name, Set&lt;Book&gt; books) {
          this.name = name;
          this.books = books;
      }
  
  // getter and setter
  
  }
  
  ChildEntity
  
  
      @Entity
      @Table(name = "book")
      public class Book {
  
          @Id
          @GeneratedValue(strategy = GenerationType.IDENTITY)
          @Column(name = "book_id")
          private Long bookId;
  
          private String name;
  
          @ManyToOne(cascade = CascadeType.PERSIST)
          @JoinColumn(name = "bookCat_id")
          BookCategory bookCategory;
  
          public Book() {
  
          }
  
      //getter  and Setter
  
      }
  </code></pre>
  
  <p>ControllerClass</p>
  
  <pre><code>@RestController
  @RequestMapping(value = "/bookCategory")
  public class BookController {
  
      @Autowired
      BookCategoryRepository bookCategoryRepository;
  
      @Autowired
      BookRepository bookRepository;
  
      @PostMapping("/addBookCategory")
      public BookCategory savePerson(@Valid @RequestBody BookCategory bookCategory){
          return bookCategoryRepository.save(bookCategory);
      }
  }
  </code></pre>
  
  <p>calling Rest Api from postman and passing json as</p>
  
  <pre><code>{
  
      "name":"Category 1",
      "books":[
            {"name" : "Hello Koding 1"},
            {"name":"Hello Koding 2"}
          ]
  } 
  </code></pre>
  
  <p>Following Query is executing by hibernate query is also correct while i am calling rest point the thing
  Hibernate: insert into book_category (name) values (?)
  Hibernate: insert into book (book_cat_id, name) values (?, ?)</p>
  
  <p>it is not inserting book_cat_id,  in book_cat_id it is passing null so null is getting store</p>
  
  <p>Data stored in database
  <a href="https://i.stack.imgur.com/fhkfs.png" rel="nofollow noreferrer"> book_category Parent Table in database</a></p>
  
  <p>book(ChildTable) 
  <a href="https://i.stack.imgur.com/F5m7e.png" rel="nofollow noreferrer">book(ChildTable)</a>
  I want to get Child Table Like
  <a href="https://i.stack.imgur.com/HrqOb.png" rel="nofollow noreferrer">I want my table like this</a></p>