2017-01-06 2 views
0

spring-data-neo4j-4.2.0.RC1 및 neo4j-ogm-core-2.1.0.jar을 사용하고 있습니다.
다음 도메인 개체가 있음
사용자 -> 역할 -> 권한GraphRepository는 2 수준 관계에서 메서드를 찾습니다.

public class User extends BaseEntity{ 
     private String firstName; 
     private String lastName; 

     @Relationship(type="ROLE") 
     private Role role; 
} 
@NodeEntity 
public class Role extends BaseEntity{ 

    private String name; 

    @Relationship(type="PRIVILEDGE") 
    private Priviledge priviledge; 
} 
@NodeEntity 
public class Priviledge extends BaseEntity { 

    private String name; 
} 

public interface UserRepository extends GraphRepository<User> { 

    User findByRolePriviledgeName(String name); 
} 

특정 권한 이름이있는 모든 사용자를 찾고 싶습니다. 위의 쿼리는 JPA와 스프링 저장소에서 작동했지만 GraphRepository에서는 예상 결과를 반환하지 않습니다.
버그인지/지원되지 않는지 아니면 잘못했는지 확실하지 않음

답변

1

이것은 SDN 파생 쿼리에서 지원되지 않지만 하나의 중첩 수준 만 지원하지만 사용자는 두 가지 (역할, 권한)를 사용합니다. 이 경우 사용자 정의 @Query을 쓸 수 있습니다.

+0

SDN 4 GraphRepository는 countBy 쿼리를 아래와 같이 지원합니다. 'public interface UserRepository extends GraphRepository { Long countByName (문자열 이름); } ' –

+0

예 지원됩니다. – Luanne