Intellij IDEA是否支持@RooJpaRepository?

时间:2013-10-14 03:43:49

标签: spring intellij-idea spring-roo spring-data

IntelliJ 12.1.6 Ultimate,启用了以下插件:

  • AspectJ支持
  • AspectJ Weaver
  • Spring Support
  • Spring Data
  • Spring AOP和@AspectJ

我有一个Spring Roo项目,它使用Spring Data存储库API。以下是代码段:

存储库类

package my.package;

@RooJpaRepository(domainType = Thing.class) 
public interface ThingRepository {
}

Roo生成的方面文件

privileged aspect ThingRepository_Roo_Jpa_Repository {
    declare parents: ThingRepository extends JpaRepository<Thing, Long>;

    declare parents: ThingRepository extends JpaSpecificationExecutor<Thing>;

    declare @type: ThingRepository: @Repository;
}

Spring JPA config

<repositories base-package="my.package" />

但是在xml文件中,IntelliJ告诉我

No matching beans found

所以每当我在IntelliJ中使用find / save之类的方法时,它都会被标记为“无法解析方法”

enter image description here

然而,IntelliJ和Maven都没有任何问题编译,只是在编辑器中无法解析的方法。可能是什么问题?

1 个答案:

答案 0 :(得分:3)

坏消息,我认为你必须等待这个功能。见:

http://youtrack.jetbrains.com/issue/IDEA-59138

简而言之:现在Intellij不支持AspectJ声明父母,也没有声明优先级

自Intellij 11以来,Intellij开发人员一直在使用此功能(请参阅有关No technical block, just lack of resources的评论)

这个问题在Intellij 14上得到解决。这有多长?看到Intellij 13.1计划在Q2 of 2014上发布,所以需要一段时间。

相关问题