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
Commit ed2ce98
Browse filesBrowse the repository at this point in the historyBrowse files
jdbcTemplate.update("DELETE FROM COLOR_ROLE_MEMBERS WHERE ROLE_ID=? AND USER_ID=?", roleId, memberId);
57
96
}
58
97
98
+
/**
99
+
* Removes a role from the database if it has no members.
100
+
*
101
+
* Callers should make sure to actually delete the role if this method returns {@code true}.
102
+
* @param roleId The ID of the role to possibly remove
103
+
* @return {@code true} if the role is registered as removed due to not having any members, else {@code false}
104
+
*/
105
+
@CheckReturnValue
59
106
publicbooleancleanRoleIfNoMembers(longroleId) {
60
107
returnjdbcTemplate.update("DELETE FROM COLOR_ROLES WHERE ROLE_ID=? AND (SELECT COUNT(*) FROM COLOR_ROLE_MEMBERS WHERE ROLE_ID=?)=0", roleId, roleId) > 0;
0 commit comments