I am working with Spring Boot JPA. I have a model for Authors and Books:
In Author.java
@ManyToMany
@JsonIgnore
@JoinTable(
name = "authors_write",
joinColumns = @JoinColumn(name = "author_id"),
inverseJoinColumns = @JoinColumn(name = "book_id"))
Set<Book> works;
Book.java
In Book.java
@ManyToMany(mappedBy = "works")
@EqualsAndHashCode.Exclude
Set<Author> authors;
and when inserting (via postman for example) data into Book table with an Author Object entries do not get updated.
How do I insert data into authors_write when posting into Book table?