I have a problem about the spring data neo4j model mapping.
There is a domain model like that
If use the neo4jTemplate.findOne({id},Kn.class), then I will got a Kn object with all fields. But on some web pages, it's unnecessary to get a whole object. For example, on a Kn navigator page, I just need a Kn with only [id,name] properties. And I know that I can use the cypher query like below
If use this method, spring-data-neo4j could not map the query result to a Kn object automatically(Maybe has, but I don't see it yet, and I am so glad to hear some good news from anyone).
So far, I know that I can use method like ResultConverter, or write some constructors or other converters by myself to do this model mapping stuff. I will do that if there are indeed no solutions.
please assist on this case with many thanks. Forgive my poor English writing, if you nice guys are confused with the awkward English grammer or the problem itself, please raise it without any hesitate.
There is a domain model like that
Code:
class Kn {
@GraphId Long id;
String name;
String title;
String content;
}
Code:
START n=node(1) RETURN ID(n), n.name;
So far, I know that I can use method like ResultConverter, or write some constructors or other converters by myself to do this model mapping stuff. I will do that if there are indeed no solutions.
please assist on this case with many thanks. Forgive my poor English writing, if you nice guys are confused with the awkward English grammer or the problem itself, please raise it without any hesitate.