I have a table having a oneToMany relation with another table
public class UserDetails {
@Id
@Column(nullable = false)
private String userId;
@OneToMany(targetEntity = Books.class,
cascade = CascadeType.ALL,
orphanRemoval = true,
fetch = FetchType.EAGER)
@JoinColumn(name = "userId",
referencedColumnName = "userId",
updatable = true,
insertable = true)
private List<Books> books = new ArrayList<>();
}
where my Books entity is
public class Books {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@JsonIgnore
private Long id;
@Column(nullable = false)
private String bookName;
@Column(nullable = false)
private Double bookPrice;
}
My entities:
I can have different prices for the same book for different users.
Are my entities normalised?
If not what changes I can make?

](https://i.stack.imgur.com/8XHq7.png)](https://i.stack.imgur.com/u6kB5.png)
Your approach look good but i have one suggestion for you, don't use
FetchType.Eagerfor more details please read next ones articles how to avoid it and why it's not a good ideea to use it.FetchType.Eager code smell
Hibernate 6 guide read about eager fetch type