Hi I have an interface and a corresponding implementation class like:
public interface IActor extends VertexFrame {
@Property(ActorProps.nodeClass)
public String getNodeClass();
@Property(ActorProps.nodeClass)
public void setNodeClass(String str);
@Property(ActorProps.id)
public String getId();
@Property(ActorProps.id)
public void setId(String id);
@Property(ActorProps.name)
public String getName();
@Property(ActorProps.name)
public void setText(String text);
@Property(ActorProps.uuid)
public String getUuid();
@Property(ActorProps.uuid)
public void setUuid(String uuid);
@Adjacency(label = RelClasses.CoActors, direction = Direction.OUT)
public Iterable<IActor> getCoactors();
}
And I use OrientDB with it that looks something like that. I had similar implementation with Neo4j as well:
Graph graph = new OrientGraph("remote:localhost/actordb");
FramedGraph<Graph> manager = new FramedGraphFactory().create(graph);
IActor actor = manager.frame(((OrientGraph)graph).getVertexByKey("Actor.uuid",uuid), IActor.class);
Above works but the problem is that in this case or similar, because there is a relationship between two vertices of class Actor, there could be potentially a graph loop. Is there a way to define either by Annotation or some other way (e.g through Manager) to stop after x steps for a specific @Adjacency so this won't go forever? If @GremlinGroovy (https://github.com/tinkerpop/frames/wiki/Gremlin-Groovy) annotation is the answer could you please give an example ?
I'm not sure I understand the question/problem. (You say "potentially", but haven't actually proven that there's a problem!)
As I understand it, the Pipelines will
lazy-load
objects (only load then when required). The frames (I imagine) only load adjacent frames when requested. Basically, as far as I can tell, theres no problem.Example (Groovy)