Package com.tinkerpop.blueprints.impls.orient

Examples of com.tinkerpop.blueprints.impls.orient.OrientBaseGraph


  public OSQLFunctionLabel() {
    super(NAME, 0, 0);
  }

  public Object execute(Object iThis, final OIdentifiable iCurrentRecord, final Object iCurrentResult, final Object[] iParameters, OCommandContext iContext) {
    final OrientBaseGraph graph = OGraphCommandExecutorSQLFactory.getGraph(false);

    if (iCurrentResult != null) {
      return OSQLEngine.foreachRecord(new OCallable<Object, OIdentifiable>() {
        @Override
        public Object call(final OIdentifiable iArgument) {
View Full Code Here


    super(NAME, 2, 3);
  }

  public Object execute(Object iThis, final OIdentifiable iCurrentRecord, Object iCurrentResult, final Object[] iParams,
      final OCommandContext iContext) {
    final OrientBaseGraph graph = OGraphCommandExecutorSQLFactory.getGraph(false);

    final ORecord record = (ORecord) (iCurrentRecord != null ? iCurrentRecord.getRecord() : null);

    Object source = iParams[0];
    if (OMultiValue.isMultiValue(source)) {
      if (OMultiValue.getSize(source) > 1)
        throw new IllegalArgumentException("Only one sourceVertex is allowed");
      source = OMultiValue.getFirstValue(source);
    }
    OrientVertex sourceVertex = graph.getVertex(OSQLHelper.getValue(source, record, iContext));

    Object dest = iParams[1];
    if (OMultiValue.isMultiValue(dest)) {
      if (OMultiValue.getSize(dest) > 1)
        throw new IllegalArgumentException("Only one destinationVertex is allowed");
      dest = OMultiValue.getFirstValue(dest);
    }
    OrientVertex destinationVertex = graph.getVertex(OSQLHelper.getValue(dest, record, iContext));

    if (sourceVertex.equals(destinationVertex)) {
      final List<ORID> result = new ArrayList<ORID>(1);
      result.add(destinationVertex.getIdentity());
      return result;
View Full Code Here

    super(NAME, 3, 4);
  }

  public LinkedList<OrientVertex> execute(Object iThis, OIdentifiable iCurrentRecord, Object iCurrentResult,
      final Object[] iParams, OCommandContext iContext) {
    final OrientBaseGraph graph = OGraphCommandExecutorSQLFactory.getGraph(false);

    final ORecord record = (ORecord) (iCurrentRecord != null ? iCurrentRecord.getRecord() : null);

    Object source = iParams[0];
    if (OMultiValue.isMultiValue(source)) {
      if (OMultiValue.getSize(source) > 1)
        throw new IllegalArgumentException("Only one sourceVertex is allowed");
      source = OMultiValue.getFirstValue(source);
    }
    paramSourceVertex = graph.getVertex(OSQLHelper.getValue(source, record, iContext));

    Object dest = iParams[1];
    if (OMultiValue.isMultiValue(dest)) {
      if (OMultiValue.getSize(dest) > 1)
        throw new IllegalArgumentException("Only one destinationVertex is allowed");
      dest = OMultiValue.getFirstValue(dest);
    }
    paramDestinationVertex = graph.getVertex(OSQLHelper.getValue(dest, record, iContext));

    paramWeightFieldName = OStringSerializerHelper.getStringContent(iParams[2]);
    if (iParams.length > 3)
      paramDirection = Direction.valueOf(iParams[3].toString().toUpperCase());
View Full Code Here

TOP

Related Classes of com.tinkerpop.blueprints.impls.orient.OrientBaseGraph

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.