I'm working on a Spring Boot shop and I have a ManyToMany relation between a User table and the Products table. When someone is clicking multiple times on the same product the relation is not created because it exists yet. Is it possible to add a counter variable in the user_product table that give me the possibility to get the amount of same relations? I need to add to the cart the products even when someone clicks on the same product multiple times.
Any possibilities or other solutions? Thanks