Is it ok for a Repository to return boolean values based on objects it (virtually) contains?
For example:
if (userRepository.checkCredentials(username, password))
{
// ...
Or is it a better approach to do it the verbose way:
user = userRepository.findByUsername(username);
if (user != null && user.checkPassword(password)) {
{
// ...