当前位置: 首页>>代码示例>>Java>>正文


Java ExecUtils.copyOrderBys方法代码示例

本文整理汇总了Java中com.taobao.tddl.executor.utils.ExecUtils.copyOrderBys方法的典型用法代码示例。如果您正苦于以下问题:Java ExecUtils.copyOrderBys方法的具体用法?Java ExecUtils.copyOrderBys怎么用?Java ExecUtils.copyOrderBys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.taobao.tddl.executor.utils.ExecUtils的用法示例。


在下文中一共展示了ExecUtils.copyOrderBys方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildOrderBy

import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
public static List<IOrderBy> buildOrderBy(IDataNodeExecutor executor, IndexMeta indexMeta, String tableName) {
    IQuery query = ((IQuery) executor);
    List<IOrderBy> orderBy = null;
    orderBy = query.getOrderBys();
    if (orderBy == null || orderBy.isEmpty()) {
        List<IOrderBy> groupBys = query.getGroupBys();
        orderBy = groupBys;
    }
    if (orderBy == null || orderBy.isEmpty()) {
        orderBy = ExecUtils.getOrderBy(indexMeta);
    }
    List<IOrderBy> orderbys = ExecUtils.copyOrderBys(orderBy);

    return orderbys;

}
 
开发者ID:loye168,项目名称:tddl5,代码行数:17,代码来源:MysqlRepoUtils.java

示例2: handle

import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public ISchematicCursor handle(IDataNodeExecutor executor, ExecutionContext executionContext) throws TddlException {
    if (!canComposeOneSql(executor)) {
        return super.handle(executor, executionContext);
    }

    IndexMeta indexMeta = null;
    My_JdbcHandler jdbcHandler = MysqlRepoUtils.getJdbcHandler(dsGetter, executor, executionContext);
    ICursorMeta meta = ExecUtils.convertToICursorMeta((IQueryTree) executor);
    My_Cursor my_cursor = new My_Cursor(jdbcHandler, meta, executor, executor.isStreaming());

    // if (executor.getSql() != null) {
    // // TODO shenxun : 排序信息似乎丢了啊。。
    // return my_cursor.getResultSet();
    // }

    List<IOrderBy> orderBy = null;
    if (executor instanceof IJoin) {
        orderBy = ((IJoin) executor).getOrderBys();
    } else {
        orderBy = MysqlRepoUtils.buildOrderBy(executor, indexMeta);
    }

    orderBy = ExecUtils.copyOrderBys(orderBy);

    for (IOrderBy order : orderBy) {
        if (((IQueryTree) executor).getAlias() != null) {
            order.getColumn().setTableName(((IQueryTree) executor).getAlias());
        }
        if (order.getColumn().getAlias() != null) order.getColumn().setColumnName(order.getColumn().getAlias());
    }

    if (GeneralUtil.getExtraCmdBoolean(executionContext.getExtraCmds(), ExtraCmd.EXECUTE_QUERY_WHEN_CREATED, false)) {
        my_cursor.init();
    }
    return new SchematicMyCursor(my_cursor, meta, orderBy);
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:39,代码来源:QueryMyHandler.java

示例3: handle

import com.taobao.tddl.executor.utils.ExecUtils; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public ISchematicCursor handle(IDataNodeExecutor executor, ExecutionContext executionContext) throws TddlException {
    if (!canComposeOneSql(executor)) {
        return super.handle(executor, executionContext);
    }

    IndexMeta indexMeta = null;
    My_JdbcHandler jdbcHandler = ((My_Repository) executionContext.getCurrentRepository()).getJdbcHandler(dsGetter,
        executor,
        executionContext);
    ICursorMeta meta = ExecUtils.convertToICursorMeta((IQueryTree) executor);
    My_Cursor my_cursor = new My_Cursor(jdbcHandler, meta, executor, executor.isStreaming());

    if (executor.getSql() != null) {
        return my_cursor.getResultSet();
    }

    List<IOrderBy> orderBy = null;
    if (executor instanceof IJoin) {
        orderBy = ((IJoin) executor).getOrderBys();
    } else {
        orderBy = MysqlRepoUtils.buildOrderBy(executor, indexMeta);
    }

    orderBy = ExecUtils.copyOrderBys(orderBy);

    for (IOrderBy order : orderBy) {
        if (((IQueryTree) executor).getAlias() != null) {
            order.getColumn().setTableName(((IQueryTree) executor).getAlias());
        }
        if (order.getColumn().getAlias() != null) order.getColumn().setColumnName(order.getColumn().getAlias());
    }

    if (!executor.lazyLoad()) {
        my_cursor.init();
    }

    ISchematicCursor cursor = new SchematicMyCursor(my_cursor, meta, orderBy);
    if (((IQueryTree) executor).getSubqueryFilter() != null) {
        cursor = executionContext.getCurrentRepository()
            .getCursorFactory()
            .valueFilterCursor(executionContext, cursor, ((IQueryTree) executor).getSubqueryFilter());
    }
    return cursor;
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:47,代码来源:QueryMyHandler.java


注:本文中的com.taobao.tddl.executor.utils.ExecUtils.copyOrderBys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。