How to write code with many-to-many relationship without using jpa @manytomany
annotation? For example for two classes Software and for Tags. When i delete Tag - it removes all software. I tried to do it with @manytomany
annotation using various approaches but it does not work. I have seen something similar to my question in this site but any gives the code sample. (I guess it should be @OneToMany
relationships in both sides, but it would be great to take a code).
Or how to do it with using @manytomany
if it possible.
More info: if we have soft1, soft2 <--> tag1, and soft2 <--> tag2, and we delete tag1, then only soft1 should be deleted. Does hibernate can handle it?