delears.setProperties("ID", "1"); delears.setProperties("Name", "name1"); delears.setProperties("Address", "address1"); superMarket.setProperties("Item", "item1"); superMarket.setProperties("Code", "2"); superMarket.setProperties("Quantity", "5");
@Override public void initCommunityProperty() { int communityCounter = 0; for (Vertex v : graph.getVertices()) { ((OrientVertex) v).setProperties(NODE_COMMUNITY, communityCounter, COMMUNITY, communityCounter); ((OrientVertex) v).save(); communityCounter++; } }
OrientGraphFactory ogf = new OrientGraphFactory( "plocal:/home/paulkalkbrenner/Dokumente/odb/databases/ConnectER", "admin", "admin"); OrientGraph og = ogf.getTx(); OClass cl=og.createVertexType("Person", "V"); cl.createProperty("LastName", OType.STRING); OrientVertex v1=og.addVertex("class:Person"); v1.setProperties("Lastname","Alessandro"); for (Vertex v : og.getVertices()) { System.out.println(v.getProperty("Lastname")); } og.shutdown();
vVertice1.setProperties("prop1", Integer.toString(i)); vVertice1.setProperties("prop2", "22"); vVertice1.setProperties("prop3", "3333"); vVertice2.setProperties("prop1", Integer.toString(i + j / 1000)); vVertice2.setProperties("prop2", "22"); vVertice2.setProperties("prop3", "3333");
@Override public int reInitializeCommunities() { Map<Integer, Integer> initCommunities = new HashMap<Integer, Integer>(); int communityCounter = 0; for (Vertex v : graph.getVertices()) { int communityId = v.getProperty(COMMUNITY); if (!initCommunities.containsKey(communityId)) { initCommunities.put(communityId, communityCounter); communityCounter++; } int newCommunityId = initCommunities.get(communityId); ((OrientVertex) v).setProperties(COMMUNITY, newCommunityId, NODE_COMMUNITY, newCommunityId); ((OrientVertex) v).save(); } return communityCounter; }
/** * Creates a temporary vertex. The vertex is not saved and the transaction * is not started. * * @param iClassName * Vertex's class name * @param prop * Varargs of properties to set * @return */ public OrientVertex addTemporaryVertex(final String iClassName, final Object... prop) { this.autoStartTransaction(); final OrientVertex vertex = new OrientVertex(this, iClassName); vertex.setProperties(prop); return vertex; }
protected OrientVertex(final OrientBaseGraph graph, String className, final Object... fields) { super(graph, null); if (className != null) className = checkForClassInSchema(OrientBaseGraph .encodeClassName(className)); rawElement = new ODocument(className == null ? CLASS_NAME : className); setProperties(fields); }
v.setProperties(vertexProps);