Spring Boot のエラー(超入門編)
JPAのサンプルを作成していたら少し嵌ったので、書き起こす。
バージョン情報
Spring Boot 2.0.1
エラー箇所
public Optional<Student> findOne(Long id){ return studentRepository.findOne(id); }
findOne(E)でダメらしい。
エラーメッセージ
Inferred type 'S' for type parameter 'S' is not within its bound; should extends xxxxxx
対処
Spring Boot の1.5.15まで下げる。
findById(id) を使用する。
→採用
最後に
Spring Bootのよさげなサンプルコードないかな。
バージョンが違うと動かないなど、超初心者には厳しい。
少し思うように作成できるようになってきたら、ブログにまとめる。