Inferred type ‘S’ for type parameter ‘S’ is not within its bound; should extend …

  开发

springboot 2下:

    @Override
    public Editor findOne(int id) {
        return repository.findOne(id);
    }

报错:

Inferred type ‘S’ for type parameter ‘S’ is not within its bound; should extend ‘com.test.markdown.domain.Editor’

解决方法:
repository.findOne(id); 改为
repository.findById(id).orElse(null);repository.findById(id).get();

LEAVE A COMMENT

Captcha Code