0
我試圖用以下結構實現部分資源庫:部分實現倉庫和Spring數據Neo4j的4
public interface ExampleCustomRepository {
Iterable<Example> findExamplesByUserId(Long id);
}
@Repository
@Transactional
public class ExampleCustomRepositoryImpl implements ExampleCustomRepository {
@Autowired
private Neo4jTemplate template;
@Override
public Iterable<Example> findExamplesByUserId(final Long id) {
// implementation
}
}
public interface ExampleRepository extends GraphRepository<Example>, ExampleCustomRepository {
}
出於某種原因,RepositoryFactory
要爲這個實現的方法創建一個DerivedGraphRepositoryQuery
和失敗:
org.springframework.data.mapping.PropertyReferenceException: No property userId found for type Example!
它甚至有可能部分實現與SDN4存儲庫?如果是這樣,我做錯了什麼?
您的類示例是否具有屬性UserId?最後一行如何編譯? – jny
不,Eaxmple類不具有userId,但它與用戶(具有)有關係。哪一條最後一行? – endrec
'公共接口ExampleRepository擴展GraphRepository,ExampleCustomRepository { }' –
jny