Spring JPA存储库@query无法解析对象名和参数名

时间:2014-11-13 07:32:27

标签: java spring jpa spring-data-jpa

我正在编写一个JpaCrmProfile是我的实体类的接口:

public interface JpaCrmProfileRepository extends JpaRepository<JpaCrmProfile, Long> {
    @Query("SELECT c FROM JpaCrmProfile c WHERE c.domain_id = :domainId AND c.name = :name")
    JpaCrmProfile findOneByDomain(@Param(domainId) Long domainId, @Param(name) String name);
}

在IDE中,查询中的对象名称JpaCrmProfile和@param中的domainId以红色显示,并显示错误消息msg无法解析符号

1 个答案:

答案 0 :(得分:0)

尝试根据JpaCrmProfile类中的名称更改“domain_id”和“name”。

为了获得更好的帮助,我需要您的JpaCrmProfile类的代码。 你也可以在这里看一下: http://docs.spring.io/spring-data/jpa/docs/1.7.1.RELEASE/reference/html/#jpa.query-methods

PS。我现在有同样的问题。但我的应用程序运行良好。

相关问题