类型不匹配:无法从元素类型java.awt.print.Book转换为Book

时间:2019-06-01 16:48:00

标签: java spring eclipse spring-boot

@Service
public class LMSService {

    @Autowired
    private BookInterface a;

    private Collection<Books1> findBooks(){
    List<Books1> books=new ArrayList<Books1>();
    for(Books1 booke : a.findAll())
    {
        books.add(booke);
    }
    return books;
} 

@Repository
public interface BookInterface extends CrudRepository<Books1,Long>{

}

a.findAll()方法给出错误

1 个答案:

答案 0 :(得分:-1)

您需要添加通用参数

CrudRepository<Books1, Integer>