Announcement Announcement Module
Collapse
No announcement yet.
SDN Node scanning is picking up JPA @Entity Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SDN Node scanning is picking up JPA @Entity

    Why would Spring Data Neo4j domain scanning also picking up @Entity for JPA

    I get

    Code:
    Caused by: java.lang.IllegalArgumentException: Invalid Domain Class class com.hdpoker.account.domain.user.AccountSecurity neither Node- nor RelationshipEntity
    	at org.springframework.data.neo4j.repository.GraphRepositoryFactory.getRepositoryBaseClass(GraphRepositoryFactory.java:96)
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepositoryInformation(RepositoryFactorySupport.java:173)
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:133)
    	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:125)
    	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:41)
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
    Of course it isn't a Node or Relationship entity. It is not annotated with either of those annotations. It is annotated with @Entity and @Table. I do not have any crossstore jars in my path. JPA scans only for @Entity so it doesn't pick up my Noe4j @NodeEntity. Why the other way around.

    I have in a domain package domain classes mixed with SDN annotations in one class, and JPA annotations in other classes. But none combined.

    Mark

  • #2
    Just chalk it up to having the repositories from JPA and Neo4j in the same package. I would think when it scans it would check to see if the type is GraphRepository versus JpaRepository.

    So, I moved them into two different subpackages, but still had the problem. Then saw that I did a fat finger there and had a "," instead of a "." when adding the new subpackage.

    Mark

    Comment


    • #3
      So I created a Jira issue on the scanning a package that has different types of Spring Data Repositories.

      https://jira.springsource.org/browse/DATAGRAPH-326

      Thanks

      Mark

      Comment


      • #4
        Issue is resolve when Oliver pointed out to me that it accepts include and exclude filters.

        Mark

        Comment

        Working...
        X