Home >Database >Mysql Tutorial >couldnotresolveproperty:nameof:

couldnotresolveproperty:nameof:

WBOY
WBOYOriginal
2016-06-07 16:12:211162browse

spring date jpa 错误:could not resolve property: name of: 在写 查询的时候,把实体类的属性写错了,即 sql 语句中字段与实体类中属性没有对应,造成无法解析。 @Query(from Product p where p.id.productName like :name)ListProduct getInfoByName(@Pa

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了

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn