报错语句
@Query(value = "select distinct(stockname) from tb_instock", nativeQuery = true)
public List<Instock> getStocknames();
原因是因为我从数据库中查询的数据字段只有 stockname, 没有Instock实体类中的其它字段,所以报错
修改:由Instock实体类改成String
@Query(value = "select distinct(stockname) from tb_instock", nativeQuery = true)
public List<String> getStocknames();