Search code examples
springintellij-ideaspring-roospring-data

Does Intellij IDEA support @RooJpaRepository?


IntelliJ 12.1.6 Ultimate, with following plugins enabled :

  • AspectJ Support
  • AspectJ Weaver
  • Spring Support
  • Spring Data
  • Spring AOP and @AspectJ

I have a Spring Roo project, which use Spring Data repository API. Following are snippet codes :

Repository class

package my.package;

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

Roo generated aspect file

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" />

But in xml file, IntelliJ told me

No matching beans found

So whenever I use method like find/save in IntelliJ, it will be marked as "Cannot resolve method"

enter image description here

However, both IntelliJ and Maven compiles without any problem, just the method not resolvable in editor. What could be the problem?


Solution

  • Bad news, I think you must wait for that functionality. See this:

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

    In short: Nowadays Intellij doesn't support AspectJ declare parents nor declare precedence

    Intellij developers have been playing around with this feature since Intellij 11 (See the comments about No technical block, just lack of resources)

    The issue is marked to be resolved on Intellij 14. How long is that? See that Intellij 13.1 is planned to be released on Q2 of 2014, so it will take a while.