Open vahid-forghani opened 2 years ago
it can be done like:
@ManyToMany List<User> likes;
in manyToMany case there is gonna be a middle table which holds user_id, article_id so if you also wanna keep other information you can have them inside this table
there is information when the like was created. I always use one-to-many tables instead of many to many because I don't know what data might appear in the middle table. if necessary i can change to many to many
Fixed
https://github.com/amezenin/encyclopedia-kn/blob/c71915518d43bdb8942f420fb19acd7cd83ed6c5/src/main/java/com/knits/product/model/VoteArticle.java#L14
it can be done like:
in manyToMany case there is gonna be a middle table which holds user_id, article_id so if you also wanna keep other information you can have them inside this table