@Test public void testCreateEntity(){ }
public GraphMutationResult createEntity(NewEntity newEntity) { String entityId = newEntity.getEntityID().toString(); Map<Attribute.Name, Object> attributes = newEntity.getAttributes(); String entityProperty = attributes.entrySet().stream() .map(e -> String.format(GraphOperations.ENTITY_PROPERTY_FORMAT, e.getKey(), e.getValue())) .collect(Collectors.joining()); StringBuilder sb = new StringBuilder(); Attribute.Name labelKey = Attribute.Name.valueOf("dse.vertex.Label"); if (attributes.containsKey(labelKey)) { sb.append(String.format(GraphOperations.ADD_ENTITY_WITH_LABEL, (String) attributes.get(labelKey))); } else { sb.append(GraphOperations.ADD_ENTITY); } sb.append(String.format(GraphOperations.ENTITY_PROPERTY_FORMAT, ENTITY_ID.toString(), entityId)); sb.append(entityProperty); GraphResultSet result = executeGraphQuery(sb); return extractGraphQueryResult(result); }
GraphEntityOperations extends GraphOperations { public GraphMutationResult createEntity(NewEntity newEntity) { String entityId = newEntity.getEntityID().toString(); Map<Attribute.Name, Object> attributes = newEntity.getAttributes(); String entityProperty = attributes.entrySet().stream() .map(e -> String.format(GraphOperations.ENTITY_PROPERTY_FORMAT, e.getKey(), e.getValue())) .collect(Collectors.joining()); StringBuilder sb = new StringBuilder(); Attribute.Name labelKey = Attribute.Name.valueOf("dse.vertex.Label"); if (attributes.containsKey(labelKey)) { sb.append(String.format(GraphOperations.ADD_ENTITY_WITH_LABEL, (String) attributes.get(labelKey))); } else { sb.append(GraphOperations.ADD_ENTITY); } sb.append(String.format(GraphOperations.ENTITY_PROPERTY_FORMAT, ENTITY_ID.toString(), entityId)); sb.append(entityProperty); GraphResultSet result = executeGraphQuery(sb); return extractGraphQueryResult(result); } }
GraphEntityOperations extends GraphOperations { public GraphMutationResult createEntity(NewEntity newEntity) { String entityId = newEntity.getEntityID().toString(); Map<Attribute.Name, Object> attributes = newEntity.getAttributes(); String entityProperty = attributes.entrySet().stream() .map(e -> String.format(GraphOperations.ENTITY_PROPERTY_FORMAT, e.getKey(), e.getValue())) .collect(Collectors.joining()); StringBuilder sb = new StringBuilder(); Attribute.Name labelKey = Attribute.Name.valueOf("dse.vertex.Label"); if (attributes.containsKey(labelKey)) { sb.append(String.format(GraphOperations.ADD_ENTITY_WITH_LABEL, (String) attributes.get(labelKey))); } else { sb.append(GraphOperations.ADD_ENTITY); } sb.append(String.format(GraphOperations.ENTITY_PROPERTY_FORMAT, ENTITY_ID.toString(), entityId)); sb.append(entityProperty); GraphResultSet result = executeGraphQuery(sb); return extractGraphQueryResult(result); } GraphEntityOperations(DSEConnectionManager connectionManager,
			GraphRelationshipOperations relationshipOperations); }
GraphEntityOperations extends GraphOperations { public GraphMutationResult createEntity(NewEntity newEntity) { String entityId = newEntity.getEntityID().toString(); Map<Attribute.Name, Object> attributes = newEntity.getAttributes(); String entityProperty = attributes.entrySet().stream() .map(e -> String.format(GraphOperations.ENTITY_PROPERTY_FORMAT, e.getKey(), e.getValue())) .collect(Collectors.joining()); StringBuilder sb = new StringBuilder(); Attribute.Name labelKey = Attribute.Name.valueOf("dse.vertex.Label"); if (attributes.containsKey(labelKey)) { sb.append(String.format(GraphOperations.ADD_ENTITY_WITH_LABEL, (String) attributes.get(labelKey))); } else { sb.append(GraphOperations.ADD_ENTITY); } sb.append(String.format(GraphOperations.ENTITY_PROPERTY_FORMAT, ENTITY_ID.toString(), entityId)); sb.append(entityProperty); GraphResultSet result = executeGraphQuery(sb); return extractGraphQueryResult(result); } GraphEntityOperations(DSEConnectionManager connectionManager,
			GraphRelationshipOperations relationshipOperations); GraphMutationResult createEntity(NewEntity newEntity); VisitOperationResult getEntitiesByID(List<ID> entityIDs); GraphResultSet getEntityById(Entity.ID entityId); VisitOperationResult selectEntities(com.intuit.ugc.api.Relationship.Name relationName,
			Direction direction, Predicate predicate, QueryResult<Entity, Relationship> context); GraphResultSet getEntityByProperty(GetEntityByProperty operation); void deleteEntity(Entity entity); VisitOperationResult updateEntity(Entity entity, GraphAttributeOperations operations); QueryResultImpl createQueryResult(GraphResultSet result); List<Entity> filterEntity(List<Entity> entityResponse,
            List<Name> nameList, List<Family> namespaceList); }
GraphEntityOperations extends GraphOperations { public GraphMutationResult createEntity(NewEntity newEntity) { String entityId = newEntity.getEntityID().toString(); Map<Attribute.Name, Object> attributes = newEntity.getAttributes(); String entityProperty = attributes.entrySet().stream() .map(e -> String.format(GraphOperations.ENTITY_PROPERTY_FORMAT, e.getKey(), e.getValue())) .collect(Collectors.joining()); StringBuilder sb = new StringBuilder(); Attribute.Name labelKey = Attribute.Name.valueOf("dse.vertex.Label"); if (attributes.containsKey(labelKey)) { sb.append(String.format(GraphOperations.ADD_ENTITY_WITH_LABEL, (String) attributes.get(labelKey))); } else { sb.append(GraphOperations.ADD_ENTITY); } sb.append(String.format(GraphOperations.ENTITY_PROPERTY_FORMAT, ENTITY_ID.toString(), entityId)); sb.append(entityProperty); GraphResultSet result = executeGraphQuery(sb); return extractGraphQueryResult(result); } GraphEntityOperations(DSEConnectionManager connectionManager,
			GraphRelationshipOperations relationshipOperations); GraphMutationResult createEntity(NewEntity newEntity); VisitOperationResult getEntitiesByID(List<ID> entityIDs); GraphResultSet getEntityById(Entity.ID entityId); VisitOperationResult selectEntities(com.intuit.ugc.api.Relationship.Name relationName,
			Direction direction, Predicate predicate, QueryResult<Entity, Relationship> context); GraphResultSet getEntityByProperty(GetEntityByProperty operation); void deleteEntity(Entity entity); VisitOperationResult updateEntity(Entity entity, GraphAttributeOperations operations); QueryResultImpl createQueryResult(GraphResultSet result); List<Entity> filterEntity(List<Entity> entityResponse,
            List<Name> nameList, List<Family> namespaceList);  }