Q:

Duplicate Vertices and Edges in OrientDB

I am making a code that will fetch data from a remote database and store it in orientdb server.  So for example if the vertex is not present it should be created else it should be overwritten.  Similar support is needed for the edges.  I am using Java API for this(Graph API) .  Can someone tell me the best method to do this. Thanks is advance. 

A:

I found an easy way to do this:
Iterable<Vertex> vv=graph.getVertices("name", "C++");
Iterator it=vv.iterator();
if(it.hasNext())
 {
   result="Exists";
 }
else
   result="Not Exists";

It basically checks for the Iterator size.