java - Spring JPA and remove entries from @ManyToMany -
as touched on in following:
- cascade on delete using unidirectional many-to-many mapping
- how remove entity manytomany relationship in jpa (and corresponding join table rows)?
- jpa jpql: select items when attribute of item (list/set) contains item
when removing entries @manytomany
mappings, there element of manual tweaking involved remove foreign keys.
i have been using own jpa crud years , have nice solution this: cruddao e.g. notedao.
but i've been impressed spring jpa , ability autogenerate cruds declaring interface , creating named namedquery
s on @entity
.
but how fix @manytomany
remove problem? i'll have remove
methods on crud expose "feature" of jpa.
i appear have solved using @preremove
, noted in https://stackoverflow.com/a/14911910/1041691
Comments
Post a Comment