本文整理汇总了Java中com.taobao.tddl.optimizer.core.expression.IBooleanFilter.getValues方法的典型用法代码示例。如果您正苦于以下问题:Java IBooleanFilter.getValues方法的具体用法?Java IBooleanFilter.getValues怎么用?Java IBooleanFilter.getValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taobao.tddl.optimizer.core.expression.IBooleanFilter
的用法示例。
在下文中一共展示了IBooleanFilter.getValues方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: manageToBooleanRangeCursor
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
protected ISchematicCursor manageToBooleanRangeCursor(ExecutionContext executionContext, ISchematicCursor cursor,
IRepository repo, IFilter keyFilter) throws TddlException {
IBooleanFilter bf = (IBooleanFilter) keyFilter;
IColumn c = ExecUtils.getColumn(bf.getColumn());
OPERATION op = bf.getOperation();
if (op == OPERATION.IN) {
List<Object> values = bf.getValues();
if (values == null) {
throw new IllegalArgumentException("values is null ,but operation is in . logical error");
} else {
return repo.getCursorFactory().inCursor(executionContext, cursor, cursor.getOrderBy(), c, values, op);
}
}
try {
cursor = repo.getCursorFactory().rangeCursor(executionContext, cursor, keyFilter);
} catch (Exception e) {
throw new RuntimeException(e);
}
return cursor;
}
示例2: findBooleanFilter
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
private static void findBooleanFilter(IBooleanFilter filter, Parameters parameters) {
if (filter == null) {
return;
}
findObject(filter.getColumn(), parameters);
findObject(filter.getValue(), parameters);
if (filter.getOperation() == OPERATION.IN) {
List<Object> values = filter.getValues();
if (values != null && !values.isEmpty()) {
for (int i = 0; i < values.size(); i++) {
findObject(values.get(i), parameters);
}
}
}
}
示例3: manageToBooleanRangeCursor
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
protected ISchematicCursor manageToBooleanRangeCursor(ISchematicCursor cursor, IRepository repo, IFilter keyFilter,
ExecutionContext executionContext) throws TddlException {
IBooleanFilter bf = (IBooleanFilter) keyFilter;
IColumn c = ExecUtils.getColumn(bf.getColumn());
OPERATION op = bf.getOperation();
if (op == OPERATION.IN) {
List<Object> values = bf.getValues();
if (values == null) {
throw new IllegalArgumentException("values is null ,but operation is in . logical error");
} else {
return repo.getCursorFactory().inCursor(executionContext, cursor, cursor.getOrderBy(), c, values, op);
}
}
try {
cursor = repo.getCursorFactory().rangeCursor(executionContext, cursor, keyFilter);
} catch (Exception e) {
throw new RuntimeException(e);
}
return cursor;
}
示例4: expandIn
import com.taobao.tddl.optimizer.core.expression.IBooleanFilter; //导入方法依赖的package包/类
private static IFilter expandIn(IFilter root, Map<String, Object> extraCmd) {
IBooleanFilter bf = (IBooleanFilter) root;
if (bf.getOperation() == OPERATION.IN && isExpandIn(extraCmd)) {
List<Object> values = bf.getValues();
IFilter newRoot = null;
for (Object value : values) {
newRoot = FilterUtils.or(newRoot, FilterUtils.equal(bf.getColumn(), value));
}
return newRoot;
} else {
return root;
}
}
示例5: 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;
}
示例6: 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();
}
}
}