本文整理汇总了Java中com.taobao.tddl.executor.cursor.impl.CursorMetaImp类的典型用法代码示例。如果您正苦于以下问题:Java CursorMetaImp类的具体用法?Java CursorMetaImp怎么用?Java CursorMetaImp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CursorMetaImp类属于com.taobao.tddl.executor.cursor.impl包,在下文中一共展示了CursorMetaImp类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convertToICursorMeta
import com.taobao.tddl.executor.cursor.impl.CursorMetaImp; //导入依赖的package包/类
public static ICursorMeta convertToICursorMeta(IQueryTree query) {
if (query.getSql() != null) {
return null;
}
ICursorMeta iCursorMeta = null;
List<ColumnMeta> columns = convertISelectablesToColumnMeta(query.getColumns(),
query.getAlias(),
query.isSubQuery());
iCursorMeta = CursorMetaImp.buildNew(columns, columns.size());
return iCursorMeta;
}
示例2: getICursorMetaByOrderBy
import com.taobao.tddl.executor.cursor.impl.CursorMetaImp; //导入依赖的package包/类
public ICursorMeta getICursorMetaByOrderBy(List<IOrderBy> orderBys) {
List<ColumnMeta> columnsNew = new ArrayList<ColumnMeta>(orderBys.size());
for (IOrderBy orderBy : orderBys) {
ColumnMeta cmNew = ExecUtils.getColumnMeta(orderBy.getColumn());
columnsNew.add(cmNew);
}
ICursorMeta cursorMetaNew = CursorMetaImp.buildNew(columnsNew, orderBys.size());
return cursorMetaNew;
}
示例3: buildReturnColumns
import com.taobao.tddl.executor.cursor.impl.CursorMetaImp; //导入依赖的package包/类
void buildReturnColumns() throws TddlException {
if (returnColumns != null) {
return;
}
returnColumns = new ArrayList();
// 使用meta做为returncolumns
// resultset中返回的meta信是物理表名,会导致join在构造返回对象时找不到index(表名不同/为null)
if (meta != null) {
returnColumns.addAll(meta.getColumns());
} else {
try {
if (this.myJdbcHandler.getResultSet() == null) {
myJdbcHandler.executeQuery(meta, isStreaming);
}
ResultSetMetaData rsmd = this.myJdbcHandler.getResultSet().getMetaData();
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
boolean isUnsigned = StringUtils.containsIgnoreCase(rsmd.getColumnTypeName(i), "unsigned");
DataType type = TableMetaParser.jdbcTypeToDataType(rsmd.getColumnType(i), isUnsigned);
String name = rsmd.getColumnLabel(i);
ColumnMeta cm = new ColumnMeta(null, name, type, null, true);
returnColumns.add(cm);
}
meta = CursorMetaImp.buildNew(returnColumns);
myJdbcHandler.setContext(meta, isStreaming);
} catch (Exception e) {
throw new TddlException(e);
}
}
}
示例4: init
import com.taobao.tddl.executor.cursor.impl.CursorMetaImp; //导入依赖的package包/类
public void init() throws TddlException {
if (inited) {
return;
}
try {
myJdbcHandler.executeQuery(meta, isStreaming);
// ResultSetMetaData rsmd =
// this.myJdbcHandler.getResultSet().getMetaData();
returnColumns = new ArrayList();
// 使用meta做为returncolumns
// resultset中返回的meta信是物理表名,会导致join在构造返回对象时找不到index(表名不同/为null)
if (meta != null) {
returnColumns.addAll(meta.getColumns());
} else {
ResultSetMetaData rsmd = this.myJdbcHandler.getResultSet().getMetaData();
for (int i = 1; i <= rsmd.getColumnCount(); i++) {
DataType type = TableMetaParser.jdbcTypeToDataType(rsmd.getColumnType(i));
String name = rsmd.getColumnLabel(i);
ColumnMeta cm = new ColumnMeta(null, name, type, null, true);
returnColumns.add(cm);
}
meta = CursorMetaImp.buildNew(returnColumns);
myJdbcHandler.setContext(meta, isStreaming);
}
inited = true;
} catch (SQLException e) {
throw new TddlException(e);
}
}
示例5: initMeta
import com.taobao.tddl.executor.cursor.impl.CursorMetaImp; //导入依赖的package包/类
public void initMeta() {
this.meta = CursorMetaImp.buildNew(columns);
}