Created
March 3, 2021 17:35
-
-
Save RobbeVW/89faedb21cdc974772cee97b07f02aab to your computer and use it in GitHub Desktop.
a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public List<User> findByIds(Set<Long> ids) { | |
if (ids.isEmpty()) { | |
return List.of(); | |
} | |
var query = "SELECT * FROM users WHERE id IN (" + "?,".repeat(ids.size() -1 ) + "?) ORDER BY name"; | |
return template.query(query, userMapper, ids.toArray()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment