You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Territory membership and application roles are mapped as two owners of one join table #297
Describe the bug Territory.members and Territory.memberOf both own STM_GRP_TER. The join columns are swapped. Neither side uses mappedBy. Both cascade MERGE and PERSIST. Application.availableRoles and Role.applications both own STM_APP_ROL the same way.
The territory form writes members and memberOf through separate tabs. A type that is neither top nor bottom shows both tabs, and each tab calls substituteAllRelation. The application form writes availableRoles. The role form writes applications. If both collections are initialized and one side is empty or stale, flush deletes the join rows for that owner and writes the in-memory set back.
To Reproduce
Load a territory whose type shows both membership tabs, with one tab's relation left empty or stale.
Save.
Read STM_GRP_TER for that territory.
Repeat from the application form and the role form for STM_APP_ROL.
Expected behavior
Each join table has one owning side. Saving one form does not delete links that the other side still holds.
Additional context Territory.members, Territory.memberOf, Application.availableRoles, Role.applications. Schema primary key of STM_GRP_TER is (GTE_TERMID, GTE_TERID).
The reported data loss cannot be reproduced. Each association PUT writes its own join-table key, and replacing one side leaves the other side's rows. Both owners stay.
Activity
test: lock both owners of membership and role joins (#297) (#352)
fjlopez commentedon Oct 22, 2026
Both join owners stay. PUT on each side still writes its own rows, and replacing one side leaves the other side's row. Locked on dev by #352.
fjlopez commentedon Oct 22, 2026
The reported data loss cannot be reproduced. Each association PUT writes its own join-table key, and replacing one side leaves the other side's rows. Both owners stay.
#352 locks that behavior on dev.