本文整理汇总了Java中com.taobao.tddl.executor.utils.ExecUtils.getColumn方法的典型用法代码示例。如果您正苦于以下问题:Java ExecUtils.getColumn方法的具体用法?Java ExecUtils.getColumn怎么用?Java ExecUtils.getColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.taobao.tddl.executor.utils.ExecUtils
的用法示例。
在下文中一共展示了ExecUtils.getColumn方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: manageToBooleanRangeCursor
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的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: manageToBooleanRangeCursor
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的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;
}
示例3: getOrderBy
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
/**
* 根据列名,生成order by 条件.永远是正向。
*
* @param columns
* @return
*/
protected static final List<IOrderBy> getOrderBy(List<ISelectable> columns) {
if (columns == null) {
columns = Collections.EMPTY_LIST;
}
List<IOrderBy> orderBys = new ArrayList<IOrderBy>(columns.size());
for (Object cobj : columns) {
IColumn c = ExecUtils.getColumn(cobj);
orderBys.add(ASTNodeFactory.getInstance().createOrderBy().setColumn(c).setDirection(true));
}
return orderBys;
}
示例4: getOrderBy
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
protected static final List<IOrderBy> getOrderBy(List columns) {
if (columns == null) {
columns = Collections.EMPTY_LIST;
}
List<IOrderBy> orderBys = new ArrayList<IOrderBy>(columns.size());
for (Object cobj : columns) {
IColumn c = ExecUtils.getColumn(cobj);
orderBys.add(ASTNodeFactory.getInstance().createOrderBy().setColumn(c).setDirection(true));
}
return orderBys;
}
示例5: equalsIOrderBy
import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
/**
* 左数据集和右数据集,排序是否相同。
*
* @param o1
* @param o2
* @return
*/
protected boolean equalsIOrderBy(IOrderBy o1, IOrderBy o2) {
IColumn c1 = ExecUtils.getColumn(o1.getColumn());
IColumn c2 = ExecUtils.getColumn(o2.getColumn());
return StringUtils.equalsIgnoreCase(c1.getTableName(), c2.getTableName())
&& c1.getColumnName().equals(c2.getColumnName()) && o1.getDirection() == o2.getDirection();
}