fix(account): findTagsByEntryIds Map key 소문자로 통일 + null guard
JDBC driver마다 column alias의 대소문자를 다르게 반환할 수 있어 entryId → entry_id, tagName → tag_name 으로 소문자 통일. NPE 방지를 위한 null 체크도 추가. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
79fc8fea16
commit
511843f1b6
@@ -60,8 +60,10 @@ public class AccountService {
|
||||
List<Long> ids = entries.stream().map(AccountEntry::getId).toList();
|
||||
Map<Long, List<String>> tagsByEntry = new HashMap<>();
|
||||
for (Map<String, Object> row : mapper.findTagsByEntryIds(ids)) {
|
||||
Long eid = ((Number) row.get("entryId")).longValue();
|
||||
String name = (String) row.get("tagName");
|
||||
Object rawId = row.get("entry_id");
|
||||
String name = (String) row.get("tag_name");
|
||||
if (rawId == null || name == null) continue;
|
||||
Long eid = ((Number) rawId).longValue();
|
||||
tagsByEntry.computeIfAbsent(eid, k -> new ArrayList<>()).add(name);
|
||||
}
|
||||
return entries.stream()
|
||||
|
||||
Reference in New Issue
Block a user