Switch to @SelectKey for id generation in createPrivilegedUser and remove unused @Nullable import.

This commit is contained in:
akastijn 2025-11-08 17:58:03 +01:00
parent e83d109012
commit 5ab81ee66e

View File

@ -1,7 +1,6 @@
package com.alttd.altitudeweb.database.web_db; package com.alttd.altitudeweb.database.web_db;
import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.*;
import org.jetbrains.annotations.Nullable;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@ -106,6 +105,6 @@ public interface PrivilegedUserMapper {
INSERT INTO privileged_users (uuid) INSERT INTO privileged_users (uuid)
VALUES (#{uuid}) VALUES (#{uuid})
""") """)
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id") @SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "id", before = false, resultType = int.class)
int createPrivilegedUser(UUID uuid); int createPrivilegedUser(UUID uuid);
} }