首页 > 代码库 > could not resolve property: name of:

could not resolve property: name of:


spring date jpa 错误:could not resolve property: name of:


在写 查询的时候,把实体类的属性写错了,即 sql 语句中字段与实体类中属性没有对应,造成无法解析。


@Query("from Product p where p.id.productName like :name")
	List<Product> getInfoByName(@Param("name")String name,Pageable pageable);
其中,把 id.productName  写成 name了


could not resolve property: name of: