0

I am using Spring data Neo4j project while my nodes contains relations properties using @RelatedTo , @RelatedToVia annotations, I don't want any of them to be fetched eagerly so these properties ain't marked with @Fetch annotations.

When node is fetched all his other relations are partly fetched ( each fetched related node only with id the rest of the properties are null) this happens in nested way also for the relations of the relations.

There is way to prevent this overhead? using include/exclude fields like in spring data mongo db?

Thanks

4

1 回答 1

0

您可以在这里查看以更好地了解 Spring Data Neo4j 中的延迟/急切加载是如何工作的: spring data neo4j 中的延迟加载

但是你必须记住的是,一般来说,你没有用@Fetch注释标记的东西你必须自己用neo4jTemplate.fetch().
这意味着您自己发现了什么,如果您使用@RelatedTo注释获取属性,那么您必须使用fetch使用@RelatedTo注释获取该属性的属性

据我所知,你没有办法避免这种情况。

于 2012-12-24T12:15:54.090 回答