I don’t understand table relationship between cart & user.
@ManyToOne(targetEntity = User.class, fetch = FetchType.EAGER)
@JoinColumn(nullable = false, name = "user_id")
private User user;
The relationship between User is ManyToOne to Cart entity.
Does It means users can have one same cart?
I think It should be OneToOne relationship because I think It makes sense one user can have only one cart and a cart can belong to only one user at the same time.