问题
I'm using Neo4J-2.0.1 and SDN - 3.0.0.RELEASE.
I have a NodeEntity as follow:
@NodeEntity
public class Group {
@GraphId
Long id;
@Indexed(unique = true, indexType = IndexType.SIMPLE)
public String name;
public String property1;
public String property2;
public Group() {
}
public Group(String str) {
name = str;
}
}
I have a groups repository :
public interface GroupsRepository extends GraphRepository<Group> {
Group getGroupByName(String name);
}
After the getGroupByName(...)
method is invoked, the
ExecutingRestAPI.getNodeById(...)
method is invoked as the number of the properties that the Group has.
How can I avoid this kind of behaviour?
Are there any additional queries being executed under the hood?
回答1:
You cannot avoid this behavior at the moment, it loads the dependent entities individually. The REST integration is currently not at all optimized.
来源:https://stackoverflow.com/questions/22065697/neo4j-sdn-3-0-0-executingrestapi-getnodebyid-is-invoced-repeatedly