Created
November 8, 2021 16:43
-
-
Save cr0wst/7def325b7a05d0b224e0eb22f3f8ea90 to your computer and use it in GitHub Desktop.
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
// Finding a single user using a specification | |
val filteredUser = userRepository.findOne(specification).orElseThrow { UserNotFoundException() } | |
// Finding a single user using a specification with nullable | |
val filteredUser = userRepository.findOneOrNull(specification) ?: throw UserNotFoundException() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment