Hi!
I am facing a small problem with Spring Graph database APIs. I am not sure
how to get a NodeBacked object from Node. For example, say I created a
traversal description, as a result I get Node object and not the NodeBacked
entity, which in my case is Product
@NodeEntity
public class Product {
String id;
....
}
public Iterator<Node> getProducts(){
TraversalDescription traversal = new TraversalDescriptionImpl()
.breadthFirst()
.relationships(withName("INTERESTED_IN"), Direction.BOTH));
final org.neo4j.graphdb.traversal.Traverser traverser = traversal
.traverse(product.getPersistentState());
final Iterator<Node> it = traverser.nodes().iterator();
return it;
}
In simple words I want getProducts() method to return Iterator<Product>
instead of Iterator<Node>. How do I convert Node to NodeBacked 'Product'?
Many Thanks,
Sambodhi
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user