started to implement project tagging, was interrupted.

next on: saving tags for user = null
This commit is contained in:
2025-07-28 08:49:44 +02:00
parent 0aa7aa67dc
commit 382eae000c
7 changed files with 74 additions and 22 deletions

View File

@@ -130,8 +130,12 @@ CREATE TABLE IF NOT EXISTS "{0}" (
public void save(Collection<Long> userIds, String module, long entityId, Collection<String> tags) {
try {
var query = replaceInto(TABLE_TAGS,USER_ID,MODULE,ID,TAG);
for (var userId : userIds) {
for (var tag : tags) query.values(userId,module,entityId,tag);
for (var tag : tags) {
if (userIds == null) { // tags not assigned to a user are available to all users
query.values(null, module, entityId, tag);
} else for (var userId : userIds) {
query.values(userId,module,entityId,tag);
}
}
query.execute(db).close();
} catch (SQLException e){