Automatically create a join from a node and a join class.

This will automatically get the left and right hand refs
and will construct a new join specified by the type using reflection.

It will also add an parsed location to the join.

@node
@type00
436409
private void join(ParserRuleContext ctx, Class<? extends Join> type)
  {
    QueryNode left = relationChain.get(relationIdx);
    QueryNode right = relationChain.get(relationIdx+1);

    try
    {
      Constructor<? extends Join> c = type.getConstructor(QueryNode.class);
      Join newJoin = c.newInstance(right);
      left.addOutgoingJoin(addParsedLocation(ctx, newJoin));
      
    }
    catch (NoSuchMethodException ex)
    {
      log.error(null, ex);
    }
    catch (InstantiationException ex)
    {
      log.error(null, ex);
    }
    catch (IllegalAccessException ex)
    {
      log.error(null, ex);
    }
    catch (InvocationTargetException ex)
    {
      log.error(null, ex);
    }

  }
642446
protected void joinInputs(DiGraphNode<N, Branch> node) {
    FlowState<L> state = node.getAnnotation();
    if (isForward()) {
      if (cfg.getEntry() == node) {
        state.setIn(createEntryLattice());
      } else {
        List<DiGraphNode<N, Branch>> inNodes = cfg.getDirectedPredNodes(node);
        if (inNodes.size() == 1) {
          FlowState<L> inNodeState = inNodes.get(0).getAnnotation();
          state.setIn(inNodeState.getOut());
        } else if (inNodes.size() > 1) {
          List<L> values = new ArrayList<>(inNodes.size());
          for (DiGraphNode<N, Branch> currentNode : inNodes) {
            FlowState<L> currentNodeState = currentNode.getAnnotation();
            values.add(currentNodeState.getOut());
          }
          state.setIn(joinOp.apply(values));
        }
      }
    } else {
      List<DiGraphNode<N, Branch>> inNodes = cfg.getDirectedSuccNodes(node);
      if (inNodes.size() == 1) {
        DiGraphNode<N, Branch> inNode = inNodes.get(0);
        if (inNode == cfg.getImplicitReturn()) {
          state.setOut(createEntryLattice());
        } else {
          FlowState<L> inNodeState = inNode.getAnnotation();
          state.setOut(inNodeState.getIn());
        }
      } else if (inNodes.size() > 1) {
        List<L> values = new ArrayList<>(inNodes.size());
        for (DiGraphNode<N, Branch> currentNode : inNodes) {
          FlowState<L> currentNodeState = currentNode.getAnnotation();
          values.add(currentNodeState.getIn());
        }
        state.setOut(joinOp.apply(values));
      }
    }
  }
21688
public <P> Q leftJoin(Path<? extends Collection<P>> target, Path<P> alias) {
        getMetadata().addJoin(JoinType.LEFTJOIN, createAlias(target, alias));
        return queryMixin.getSelf();
    }
1191064
Node createConstructorCall(@Nullable JSType classType, Node callee, Node... args) {
    Node result = NodeUtil.newCallNode(callee, args);
    if (isAddingTypes()) {
      checkNotNull(classType);
      FunctionType constructorType = checkNotNull(classType.toMaybeFunctionType());
      ObjectType instanceType = checkNotNull(constructorType.getInstanceType());
      result.setJSType(instanceType);
    }
    return result;
  }
395925
public QueryBuilder<T, ID> join(String localColumnName, String joinedColumnName,
			QueryBuilder<?, ?> joinedQueryBuilder, JoinType type, JoinWhereOperation operation) throws SQLException {
		addJoinInfo(type, localColumnName, joinedColumnName, joinedQueryBuilder, operation);
		return this;
	}
330065
public QueryBuilder<T, ID> leftJoinOr(QueryBuilder<?, ?> joinedQueryBuilder) throws SQLException {
		addJoinInfo(JoinType.LEFT, null, null, joinedQueryBuilder, JoinWhereOperation.OR);
		return this;
	}
1314880
function getS() {
  const type = NodeType.SType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = joinValues(pos, tokens[pos].ws_last);

  pos = tokens[pos].ws_last + 1;

  return newNode(type, content, line, column);
}
130056
private void setJoin(T model) {
        for (JoinParam joinParam : joinParams) {
            try {
                Object leftValue = AnimaUtils.invokeMethod(
                        model,
                        getGetterName(joinParam.getOnLeft()),
                        AnimaUtils.EMPTY_ARG);

                String sql = "SELECT * FROM " + AnimaCache.getTableName(joinParam.getJoinModel()) +
                        " WHERE " + joinParam.getOnRight() + " = ?";

                Field field = model.getClass()
                        .getDeclaredField(joinParam.getFieldName());


                if (field.getType().equals(List.class)) {
                    if (AnimaUtils.isNotEmpty(joinParam.getOrderBy())) {
                        sql += " ORDER BY " + joinParam.getOrderBy();
                    }
                    List<? extends Model> list = this.queryList(joinParam.getJoinModel(), sql, new Object[]{leftValue});
                    AnimaUtils.invokeMethod(model, getSetterName(joinParam.getFieldName()), new Object[]{list});
                }

                if (field.getType().equals(joinParam.getJoinModel())) {
                    Object joinObject = this.queryOne(joinParam.getJoinModel(), sql, new Object[]{leftValue});
                    AnimaUtils.invokeMethod(model, getSetterName(joinParam.getFieldName()), new Object[]{joinObject});
                }
            } catch (NoSuchFieldException e) {
                log.error("Set join error", e);
            }
        }
    }
640135
function createLNodeObject(type, currentView, parent, native, state, queries) {
    return {
        native: native,
        view: currentView,
        nodeInjector: parent ? parent.nodeInjector : null,
        data: state,
        queries: queries,
        tNode: null,
        dynamicLContainerNode: null
    };
}
1225813
function _join(table, first) {
    var join;
    var joinType = this._joinType();
    if (typeof first === 'function') {
      join = new JoinClause(table, joinType);
      first.call(join, join);
      this._statements.push(join);
      return this;
    }
    if (joinType === 'raw') {
      join = new JoinClause(this.client.raw(table, first), 'raw');
      this._statements.push(join);
      return this;
    }

    join = new JoinClause(table, joinType);
    if (arguments.length > 1) {
      join.on.apply(join, normalizeArr.apply(null, arguments).slice(1));
    }
    this._statements.push(join);
    return this;
  }
454349
@SuppressWarnings("unchecked")
    public static <T, K> Join<T, K> findJoinedType(Root<T> root, Class<T> rootClass, Class<K> joinClass) {
        Join<T, K> join = null;
        for (Join<T, ?> j : root.getJoins()) {
            if (j.getJavaType().equals(joinClass)) {
                join = (Join<T, K>) j;
            }
        }
        return join;
    }
226960
function buildLeftJoinRelations () {
    // if no left joins specified do nothing
    if (!this.args.left || !this.args.left.join) {
        return
    }
    // get join as array
    var joins = Array.isArray(this.args.left.join) ? this.args.left.join : [this.args.left.join]
    // add each join
    _.each(joins, join => {
        // join may be passed as string that is name of relation to join on
        if (typeof join === 'string') {
            join = {
                relation: join,
            }
        }
        // require join to be object
        assert.ok(join && typeof join === 'object', 'left join must be string or object')
        // set the left join flag to true
        join.left = true
        // add join to query
        this.buildJoinRelation(join)
    })
}
21760
private void buildJoinTree(Criteria crit)
    {
        Enumeration e = crit.getElements();

        while (e.hasMoreElements())
        {
            Object o = e.nextElement();
            if (o instanceof Criteria)
            {
                buildJoinTree((Criteria) o);
            }
            else
            {
                SelectionCriteria c = (SelectionCriteria) o;
                
                // BRJ skip SqlCriteria
                if (c instanceof SqlCriteria)
                {
                    continue;
                }
                
                // BRJ: Outer join for OR
                boolean useOuterJoin = (crit.getType() == Criteria.OR);

                // BRJ: do not build join tree for subQuery attribute                  
                if (c.getAttribute() != null && c.getAttribute() instanceof String)
                {
					//buildJoinTreeForColumn((String) c.getAttribute(), useOuterJoin, c.getAlias(), c.getPathClasses());
					buildJoinTreeForColumn((String) c.getAttribute(), useOuterJoin, c.getUserAlias(), c.getPathClasses());
                }
                if (c instanceof FieldCriteria)
                {
                    FieldCriteria cc = (FieldCriteria) c;
					buildJoinTreeForColumn((String) cc.getValue(), useOuterJoin, c.getUserAlias(), c.getPathClasses());
                }
            }
        }
    }
324083
static MemberMap createNew(int version, MemberImpl... members) {
        Map<Address, MemberImpl> addressMap = createLinkedHashMap(members.length);
        Map<String, MemberImpl> uuidMap = createLinkedHashMap(members.length);

        for (MemberImpl member : members) {
            putMember(addressMap, uuidMap, member);
        }

        return new MemberMap(version, addressMap, uuidMap);
    }
1015528
function buildJoinRelations () {
    // if no joins specified then do nothing
    if (!defined(this.args.join)) {
        return
    }
    // get join as array
    var joins = Array.isArray(this.args.join) ? this.args.join : [this.args.join]
    // add each join
    _.each(joins, join => {
        // join may be passed as string that is name of relation to join on
        if (typeof join === 'string') {
            join = {
                relation: join,
            }
        }
        // require join to be object
        assert.ok(join && typeof join === 'object', 'left join must be string or object')
        // add join to query
        this.buildJoinRelation(join)
    })
}
252653
public M joinsWith(String separator, Object... join) {
		this.delegate = Optional.of(joinWith(separator, join));
		return THIS();
	}
1301743
public function join($table, $first, $operator = null, $second = null, $type = 'inner', $where = false)
	{
		$join = new JoinClause($this, $type, $table);

		// If the first "column" of the join is really a Closure instance the developer
		// is trying to build a join with a complex "on" clause containing more than
		// one condition, so we'll add the join and call a Closure with the query.
		if ($first instanceof Closure)
		{
			call_user_func($first, $join);
			$this->joins[] = $join;
			$this->addBinding($join->getBindings(), 'join');
		}

		// If the column is simply a string, we can assume the join simply has a basic
		// "on" clause with a single condition. So we will just build the join with
		// this simple join clauses attached to it. There is not a join callback.
		else
		{
			$method = $where ? 'where' : 'on';
			$this->joins[] = $join->$method($first, $operator, $second);
			$this->addBinding($join->getBindings(), 'join');
		}

		return $this;
	}