本文整理汇总了Java中com.taobao.tddl.optimizer.core.expression.IBooleanFilter.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java IBooleanFilter.getValue方法的具体用法?Java IBooleanFilter.getValue怎么用?Java IBooleanFilter.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taobao.tddl.optimizer.core.expression.IBooleanFilter
的用法示例。
在下文中一共展示了IBooleanFilter.getValue方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addJoinFilter
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
private void addJoinFilter(IBooleanFilter filter) {
ISelectable left = (ISelectable) filter.getColumn();
ISelectable right = (ISelectable) filter.getValue();
if (!this.joinColumnsAndFilter.containsKey(left)) {
this.joinColumnsAndFilter.put(left, new HashMap());
}
this.joinColumnsAndFilter.get(left).put(right, filter);
// add by shenxun : 这里应该进行对调,map中应该维持左->右这个关系
IBooleanFilter ibfnew = convertJoinOnColumns(filter);
if (!this.joinColumnsAndFilter.containsKey(right)) {
this.joinColumnsAndFilter.put(right, new HashMap());
}
this.joinColumnsAndFilter.get(right).put(left, ibfnew);
}
示例2: buildBooleanFilter
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
protected void buildBooleanFilter(IBooleanFilter filter) {
if (filter == null) {
return;
}
Object column = filter.getColumn();
Object value = filter.getValue();
if (column instanceof ISelectable) {
filter.setColumn(this.buildSelectable((ISelectable) column));
}
if (value instanceof ISelectable) {
filter.setValue(this.buildSelectable((ISelectable) value));
}
if (value != null && value instanceof IFunction && ((IFunction) value).getArgs().size() > 0) {
Object arg = ((IFunction) value).getArgs().get(0);
if (arg instanceof QueryTreeNode) {
}
}
}
示例3: buildColumnRefered
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
private void buildColumnRefered() {
List<ISelectable> columnRefered = new ArrayList();
columnRefered.addAll(this.getNode().getColumnsSelected());
for (IBooleanFilter f : this.getNode().getJoinFilter()) {
ISelectable left = (ISelectable) f.getColumn();
ISelectable right = (ISelectable) f.getValue();
if (!columnRefered.contains(left)) {
columnRefered.add(left);
}
if (!columnRefered.contains(right)) {
columnRefered.add(right);
}
}
}
示例4: setIntoRowSet
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
private void setIntoRowSet(ICursorMeta cursorMetaNew, IBooleanFilter bf, IRowSet rowSet,
ColumnEQProcessor columnProcessor) {
IColumn col = ExecUtils.getIColumn(bf.getColumn());
Object val = bf.getValue();
// if (col.getDataType() == DATA_TYPE.DATE_VAL) {
// if (val instanceof Long) {
// val = new Date((Long) val);
// }
// }
val = processFunction(val);
val = columnProcessor.process(val, col.getDataType());
Integer inte = cursorMetaNew.getIndex(col.getTableName(), col.getColumnName());
if (inte == null) inte = cursorMetaNew.getIndex(col.getTableName(), col.getAlias());
rowSet.setObject(inte, val);
}
示例5: buildColumnRefered
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
private void buildColumnRefered() {
List<ISelectable> columnRefered = new ArrayList();
columnRefered.addAll(this.getNode().getColumnsSelected());
for (IBooleanFilter f : this.getNode().getJoinFilter()) {
ISelectable left = (ISelectable) f.getColumn();
ISelectable right = (ISelectable) f.getValue();
if (!columnRefered.contains(left)) {
columnRefered.add(left);
}
if (!columnRefered.contains(right)) {
columnRefered.add(right);
}
}
for (IColumn c : this.columnInAggregate) {
if (!columnRefered.contains(c)) {
columnRefered.add(c);
}
}
this.getNode().setColumnsRefered(columnRefered);
}
示例6: setIntoRowSet
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
protected void setIntoRowSet(ICursorMeta cursorMetaNew, IBooleanFilter bf, IRowSet rowSet,
ColumnEQProcessor columnProcessor) {
IColumn col = ExecUtils.getIColumn(bf.getColumn());
Object val = bf.getValue();
val = processFunction(val);
val = columnProcessor.process(val, col.getDataType());
Integer inte = cursorMetaNew.getIndex(col.getTableName(), col.getColumnName(), col.getAlias());
rowSet.setObject(inte, val);
}
示例7: getValueName
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
private static String getValueName(IBooleanFilter bf, int inden, boolean needTable, boolean isIn) {
if (bf == null) {
return null;
}
if (needTable) {
if (isIn) {
return bf.getValues().toString();
} else {
if (bf.getValue() instanceof QueryTreeNode) {
return "\n" + ((QueryTreeNode) bf.getValue()).toString(inden);
} else {
return bf.getValue().toString();
}
}
} else {
List args = bf.getArgs();
if (args.size() == 2) {
Object obj = args.get(1);
if (obj instanceof ISelectable) {
return ((ISelectable) obj).getColumnName();
} else if (obj instanceof Comparable) {
return obj.toString();
}
}
return null;
}
}
示例8: getJoinKeysWithColumnJoin
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
/**
* 找到join的列条件的所有列信息,必须是a.id=b.id的情况,针对a.id=1返回为null
*/
private static ISelectable[] getJoinKeysWithColumnJoin(IBooleanFilter filter) {
if (filter.getColumn() instanceof IColumn && filter.getValue() instanceof IColumn) {
if (OPERATION.EQ.equals(filter.getOperation())) {
return new ISelectable[] { (ISelectable) filter.getColumn(), (ISelectable) filter.getValue() };
}
}
return null;
}
示例9: isMatchJoinFilter
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
/**
* 判断是否是join条件中的一个字段,可能是左表或右边的字段
*/
private static boolean isMatchJoinFilter(List<IBooleanFilter> joinFilters, ISelectable column) {
for (IBooleanFilter joinFilter : joinFilters) {
ISelectable leftJoinColumn = (ISelectable) joinFilter.getColumn();
ISelectable rightJoinColumn = (ISelectable) joinFilter.getValue();
if (leftJoinColumn.equals(column) || rightJoinColumn.equals(column)) {
return true;
}
}
return false;
}
示例10: equals
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof IBooleanFilter)) {
return false;
}
IBooleanFilter other = (IBooleanFilter) obj;
if (getOperation() != other.getOperation()) {
return false;
}
if (getColumn() == null) {
if (other.getColumn() != null) {
return false;
}
} else if (!getColumn().equals(other.getColumn())) {
return false;
}
if (getValue() == null) {
if (other.getValue() != null) {
return false;
}
} else if (!getValue().equals(other.getValue())) {
return false;
}
if (getValues() == null) {
if (other.getValues() != null) {
return false;
}
} else if (!getValues().equals(other.getValues())) {
return false;
}
return true;
}
示例11: isConstFilter
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
/**
* 判断是否为常量的filter
*/
public static boolean isConstFilter(IBooleanFilter f) {
if (f.getColumn() instanceof IColumn || f.getColumn() instanceof IFunction) {
return false;
}
if (f.getValue() instanceof IColumn || f.getValue() instanceof IFunction) {
return false;
}
return true;
}
示例12: buildBooleanFilter
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
protected void buildBooleanFilter(IBooleanFilter filter, boolean findInSelectList) {
if (filter == null) {
return;
}
if (filter.getColumn() instanceof ISelectable) {
filter.setColumn(this.buildSelectable((ISelectable) filter.getColumn(), findInSelectList));
}
if (filter.getColumn() instanceof QueryTreeNode) {
// subQuery,比如WHERE ID = (SELECT ID FROM A)
((QueryTreeNode) filter.getColumn()).build();
}
if (filter.getValue() instanceof ISelectable) {
filter.setValue(this.buildSelectable((ISelectable) filter.getValue(), findInSelectList));
}
if (filter.getValue() instanceof QueryTreeNode) {
// subQuery,比如WHERE ID = (SELECT ID FROM A)
((QueryTreeNode) filter.getValue()).build();
}
if (filter.getOperation() == OPERATION.IN) {
List<Object> values = filter.getValues();
if (values != null && !values.isEmpty() && values.get(0) instanceof QueryTreeNode) {
// in的子查询
((QueryTreeNode) values.get(0)).build();
}
}
}
示例13: getValue
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
protected Comparable getValue(IBooleanFilter f) {
return (Comparable) f.getValue();
}
示例14: buildJoinKeys
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
private void buildJoinKeys() {
if (this.getNode().isUedForIndexJoinPK()) {
return;
}
List<IBooleanFilter> otherJoinOnFilters = new ArrayList(this.getNode().getJoinFilter().size());
for (IBooleanFilter f : this.getNode().getJoinFilter()) {
ISelectable leftKey = null;
if (f.getColumn() != null && f.getColumn() instanceof ISelectable) {
leftKey = this.getColumnFromOtherNode((ISelectable) f.getColumn(), this.getNode().getLeftNode());
}
ISelectable rightKey = null;
if (f.getValue() != null && f.getValue() instanceof ISelectable) {
rightKey = this.getColumnFromOtherNode((ISelectable) f.getValue(), this.getNode().getRightNode());
}
// 可能顺序调换了,重新找一次
if (leftKey == null || rightKey == null) {
if (f.getValue() != null && f.getValue() instanceof ISelectable) {
leftKey = this.getColumnFromOtherNode((ISelectable) f.getValue(), this.getNode().getLeftNode());
}
if (f.getColumn() != null && f.getColumn() instanceof ISelectable) {
rightKey = this.getColumnFromOtherNode((ISelectable) f.getColumn(), this.getNode().getRightNode());
}
}
if (leftKey == null || rightKey == null) {
// 可能有以下情况
// id=1,s.id=s.key_id
IFilter otherJoinOnFilter = this.getNode().getOtherJoinOnFilter();
otherJoinOnFilter = FilterUtils.and(otherJoinOnFilter, f);
this.getNode().setOtherJoinOnFilter(otherJoinOnFilter);
otherJoinOnFilters.add(f);
continue;
}
/**
* 如果是回表操作,不能把索引的joinKey添加到temp中,否则如果有merge,这个列会被加到sql的select中,
* 而导致找不到列
*/
if (!this.getNode().isUedForIndexJoinPK()) {
f.setColumn(buildSelectable(leftKey));
f.setValue(buildSelectable(rightKey));
}
}
this.getNode().getJoinFilter().removeAll(otherJoinOnFilters);
this.buildFilter(this.getNode().getOtherJoinOnFilter(), false);
}