简体   繁体   中英

Spring JPA and remove entries from @ManyToMany

As touched on in the following:

when removing entries from @ManyToMany mappings, there is an element of manual tweaking involved to remove the foreign keys.

I have been using my own JPA CRUD for years and have a nice solution for this: CrudDao eg NoteDao .

But I've been recently very impressed by Spring JPA and the ability to autogenerate Cruds by declaring an interface and then creating similarly named namedQuery s on the @Entity .

But how do I fix the @ManyToMany remove problem? I'll essentially have remove methods on my Crud that expose this "feature" of JPA.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM