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


Java MysqlRepoUtils.buildOrderBy方法代码示例

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


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

示例1: getCursor

import com.taobao.tddl.repo.mysql.utils.MysqlRepoUtils; //导入方法依赖的package包/类
@Override
public ISchematicCursor getCursor(ExecutionContext executionContext, IndexMeta indexName, IQuery executor)
                                                                                                          throws TddlException {
    My_JdbcHandler jdbcHandler = ((My_Repository) executionContext.getCurrentRepository()).getJdbcHandler(this.dsGetter,
        executor,
        executionContext);
    ICursorMeta meta = ExecUtils.convertToICursorMeta(indexName);
    My_Cursor my_cursor = new My_Cursor(jdbcHandler, meta, executor, executor.isStreaming());
    return new SchematicMyCursor(my_cursor, meta, MysqlRepoUtils.buildOrderBy(executor, indexName));
}
 
开发者ID:loye168,项目名称:tddl5,代码行数:11,代码来源:My_Table.java

示例2: getCursor

import com.taobao.tddl.repo.mysql.utils.MysqlRepoUtils; //导入方法依赖的package包/类
@Override
public ISchematicCursor getCursor(ExecutionContext executionContext, IndexMeta indexName, IQuery executor)
                                                                                                          throws TddlException {
    My_JdbcHandler jdbcHandler = MysqlRepoUtils.getJdbcHandler(this.dsGetter, executor, executionContext);
    ICursorMeta meta = ExecUtils.convertToICursorMeta(indexName);
    My_Cursor my_cursor = new My_Cursor(jdbcHandler, meta, executor, executor.isStreaming());
    return new SchematicMyCursor(my_cursor, meta, MysqlRepoUtils.buildOrderBy(executor, indexName));
}
 
开发者ID:beebeandwer,项目名称:TDDL,代码行数:9,代码来源:My_Table.java

示例3: handle

import com.taobao.tddl.repo.mysql.utils.MysqlRepoUtils; //导入方法依赖的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

示例4: handle

import com.taobao.tddl.repo.mysql.utils.MysqlRepoUtils; //导入方法依赖的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.repo.mysql.utils.MysqlRepoUtils.buildOrderBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。