Estou tendo esse erro repository.save e nao estou conseguindo descobrir o por que ` package br.com.alura.codechella.infra.gateways;
import br.com.alura.codechella.application.gateways.UserRepository; import br.com.alura.codechella.domain.entities.user.User; import br.com.alura.codechella.infra.persistence.UserEntity; import java.util.List;
public class JPAUserRepositories implements UserRepository {
private final UserRepository repository;
private final UserEntityMapper mapper;
public JPAUserRepositories(UserRepository repository, UserEntityMapper mapper) {
this.repository = repository;
this.mapper = mapper;
}
@Override
public User registerUser(User usuario) {
UserEntity entity = mapper.toEntity(usuario);
repository.save(usuario);
return mapper.toDomain(entity);
}
@Override
public List<User> listAll() {
// return List.of(); return null; } } `
package br.com.alura.codechella.application.gateways;
import br.com.alura.codechella.domain.entities.user.User;
import br.com.alura.codechella.infra.persistence.UserEntity;
import java.util.List;
public interface UserRepository {
User registerUser(User usuario);
List<User> listAll();
}