Cannot make a static reference to the non-static method queryProductsByPage(Integer, Integer) from the type ProductMapper ProductServiceImpl.java
问题:
解析:
private ProductMapper productMapper;
List pList=ProductMapper.queryProductsByPage(start,rows);
ProductMapper是类,所以这里相当于是用ProductMapper类调用方法,就是静态方法调用非静态方法了;
ProductMapper是对象,用对象调用是非静态,非静态调用非静态方法,不报错。
静态只能调静态