Update existing records in Hibernate ManyToMany Relation
问题 In my database I have two tables Book and Label with ManyToMany relation between them. I have mapped them successfully in Hibernate using annotation of ManyToMany with CascadeALL . Now consider this scenario. When I add a new Book with labels list. The list of label contain existing and new labels both. When the book is saved in the database it creates duplicate entries of existing labels. [Means each time a new label will be created (even for existing labels)with different primary key,rather