I have a class Book annotated with @Entity and
@ManyToOne
private BookStore bookStore;
I also have a class BookStore with this code
@OneToMany(mappedBy = "bookStore",fetch = FetchType.EAGER)
private List<Book> books;
But I get an error in the BookStore class that states: 'One To Many' attribute value type should not be 'Book'. How do I fix this?
I tried adding mappedBy = "bookStore" and both of the classes are annotated with @Data and @Entity.