解析一个条件成为符合Hibernate的Junction的实例条件

@param condition
@param junction
342483
public static void parseConditionToJunction(Condition condition,
			Junction junction, Class<?> persistentClass) {
		// 子条件
		List<Condition> subConditions = condition.getSubConditions();

		// 有子条件则进行遍历获取最终的条件
		if (null != subConditions && !subConditions.isEmpty()) {
			// 子条件当中的and条件集合
			List<Condition> andConditions = condition.getAndConditions();
			if (null != andConditions && !andConditions.isEmpty()) {
				// 创建一个and条件集合
				Conjunction conj = Restrictions.conjunction();
				// 添加到父条件中
				junction.add(conj);
				for (Condition andCondition : andConditions) {
					/*
					 * 把每个条件看做是一个大的条件(包含 and 和 or 2个部分),
					 * 然后使用disjunction连接条件集合来组合这个大条件的(and项 和 or项);
					 * 因为and项和or项都已经被分为2个部分
					 * ,而且又是用disjunction来组合,所以可以保证一个大条件只会被or连接符分隔成2个部分
					 */
					Disjunction dj = Restrictions.disjunction();
					conj.add(dj);
					parseConditionToJunction(andCondition, dj, persistentClass);
				}
			}

			// 子条件当中的or条件集合
			List<Condition> orConditions = condition.getOrConditions();
			if (null != orConditions && !orConditions.isEmpty()) {
				// 创建一个or条件集合
				Disjunction disj = Restrictions.disjunction();
				// 添加到父条件中
				junction.add(disj);
				for (Condition orCondition : orConditions) {
					// 这里的实现原理与上面的andCondition的处理相同
					Disjunction dj = Restrictions.disjunction();
					disj.add(dj);
					parseConditionToJunction(orCondition, dj, persistentClass);
				}
			}
		} else {
			// 条件为最终条件，转换为符合Hibernate的条件，然后条件到条件集合中
			junction.add(condition.getCriterion(persistentClass));
		}
	}
844249
public SqlBuilder where(final Collection<Condition> cons) {
    conditions.addAll(cons);
    return params(Conditions.getParamMap(cons));
  }
1196239
private List<Condition> conditionsOf(JsonNode conditionNodes) {

        List<Condition> conditionList = new LinkedList<Condition>();
        Iterator<Map.Entry<String, JsonNode>> mapOfConditions = conditionNodes
                .fields();

        Entry<String, JsonNode> condition;
        while (mapOfConditions.hasNext()) {
            condition = mapOfConditions.next();
            convertConditionRecord(conditionList, condition.getKey(),
                    condition.getValue());
        }

        return conditionList;
    }
1128422
public Optional<AlertCondition> add(Entity entity, long conditionId)
    {
        return add(entity.getId(), entity.getType(), conditionId);
    }
673745
private void paintCondition(final Condition condition, final XmlStringBuilder xml) {
		if (condition instanceof And) {
			xml.appendTag("ui:and");

			for (Condition operand : ((And) condition).getConditions()) {
				paintCondition(operand, xml);
			}

			xml.appendEndTag("ui:and");
		} else if (condition instanceof Or) {
			xml.appendTag("ui:or");

			for (Condition operand : ((Or) condition).getConditions()) {
				paintCondition(operand, xml);
			}

			xml.appendEndTag("ui:or");
		} else if (condition instanceof Not) {
			xml.appendTag("ui:not");
			paintCondition(((Not) condition).getCondition(), xml);
			xml.appendEndTag("ui:not");
		} else if (condition instanceof AbstractCompare) {
			AbstractCompare compare = (AbstractCompare) condition;
			xml.appendTagOpen("ui:condition");
			xml.appendAttribute("controller", compare.getTrigger().getId());
			xml.appendAttribute("value", compare.getComparePaintValue());
			xml.appendOptionalAttribute("operator", getCompareTypeName(compare.getCompareType()));
			xml.appendEnd();
		} else {
			throw new SystemException("Unknown condition: " + condition);
		}
	}
1208947
public static ConditionEvaluationReport find(BeanFactory beanFactory) {
		if (beanFactory != null && beanFactory instanceof ConfigurableBeanFactory) {
			return ConditionEvaluationReport
					.get((ConfigurableListableBeanFactory) beanFactory);
		}
		return null;
	}
727793
public SqlBuilder on(LogicalOperator logicalOperator, Condition... conditions) {
		if (ArrayUtil.isNotEmpty(conditions)) {
			if (null != wrapper) {
				// 包装字段名
				conditions = wrapper.wrap(conditions);
			}
			on(buildCondition(logicalOperator, conditions));
		}

		return this;
	}
876986
@Override
    public boolean hasOuterJoin() {
        assert(m_leftNode != null && m_rightNode != null);
        return m_joinType != JoinType.INNER ||
                m_leftNode.hasOuterJoin() || m_rightNode.hasOuterJoin();
    }
887311
function (status, condition) {
        var that = this._connection;
        if (this._autoService && status === Strophe.Status.CONNECTED) {
            this.service =  'pubsub.'+Strophe.getDomainFromJid(that.jid);
            this.jid = that.jid;
        }
    }
417109
public function join($table, $condition = null, $type = 'LEFT')
    {
        settype($table, 'array');

        $data = array(
            'table'     => current($table),
            'condition' => $condition,
            'type'      => $type
        );

        if (is_string(key($table))) {
            $this->join[key($table)] = $data;
        } else {
            $this->join[] = $data;
        }

        return $this;
    }
699303
public Map<String, Object> queryObjJoinByBizId(String tableName,Object bizId,String condition) {

		//String tableName=changeTableNameCase(otableName);
		String where="where "+condition+"=?";
		String limitStr="";
		String tempType=calcuDbType();
		if(tempType!=null && tempType.equals("mysql")){		
		//if(dbType!=null && dbType.equals("mysql")){
			limitStr="limit 1";
		}else{
			limitStr="and rownum=1";
		}		
		

		String select="select * from "+tableName+" "+where+" "+limitStr;
		String sql=select+" ";
		logger.debug(sql);
		Object[] paramArray=new Object[1];
		paramArray[0]=bizId;
		List infoList=queryObjJoinByCondition(sql,paramArray);
		//init by null
		Map retMap0=null;
		if(infoList!=null && infoList.size()>0){
			retMap0=(Map) infoList.get(0);
		}		
		//add 201807 ning
		//Map retMap=changeOutKeyCase(retMap0);	
		
		//add 201902 ning
		Map retMap=ignoreKeyCase(retMap0);
		
		return retMap;
	}
1190753
public SqlBuilder join(String tableName, Join join) {
		if (StrUtil.isBlank(tableName)) {
			throw new DbRuntimeException("Table name is blank !");
		}

		if (null != join) {
			sql.append(StrUtil.SPACE).append(join).append(" JOIN ");
			if (null != wrapper) {
				// 包装表名
				tableName = wrapper.wrap(tableName);
			}
			sql.append(tableName);
		}
		return this;
	}
764209
function LeftJoin(Table $table, Condition $condition, $prepend = false)
    {
        return $this->Join($table, JoinType::Left(), $condition, $prepend);
    }
728101
public static Criteria parseConditionToCriteria(Condition condition,
			Criteria criteria, Class<?> persistentClass) {
		// 创建一个Or的连接条件集合
		Disjunction disjunction = Restrictions.disjunction();
		parseConditionToJunction(condition, disjunction, persistentClass);
		return criteria.add(disjunction);
	}
691735
public boolean waitForCondition(Condition condition, int timeout){
		final long endTime = SystemClock.uptimeMillis() + timeout;

		while (true) {
			final boolean timedOut = SystemClock.uptimeMillis() > endTime;
			if (timedOut){
				return false;
			}

			sleeper.sleep();

			if (condition.isSatisfied()){
				return true;
			}
		}
	}
1326195
public void setConditions(java.util.Collection<Condition> conditions) {
        if (conditions == null) {
            this.conditions = null;
            return;
        }

        this.conditions = new java.util.ArrayList<Condition>(conditions);
    }
369848
public boolean indexAppliesTo( JoinCondition condition ) {
        if (condition instanceof ChildNodeJoinCondition) {
            return indexAppliesTo((ChildNodeJoinCondition)condition);
        }
        if (condition instanceof DescendantNodeJoinCondition) {
            return indexAppliesTo((DescendantNodeJoinCondition)condition);
        }
        if (condition instanceof EquiJoinCondition) {
            return indexAppliesTo((EquiJoinCondition)condition);
        }
        if (condition instanceof SameNodeJoinCondition) {
            return indexAppliesTo((SameNodeJoinCondition)condition);
        }
        return false;
    }