public TraversalFieldAccessor(final Neo4jPersistentProperty property, Neo4jTemplate template) {
this.property = property;
this.template = template;
final GraphTraversal graphEntityTraversal = property.findAnnotation(GraphTraversal.class);
this.target = resolveTarget(graphEntityTraversal,property);
this.params = graphEntityTraversal.params();
this.fieldTraversalDescriptionBuilder = createTraversalDescription(graphEntityTraversal);
}
private Class<?> resolveTarget(GraphTraversal graphTraversal, Neo4jPersistentProperty property) {
if (!graphTraversal.elementClass().equals(Object.class)) return graphTraversal.elementClass();