Search in sources :

Example 1 with RouteContext

use of com.dangdang.ddframe.rdb.sharding.parser.result.router.RouteContext in project sharding-jdbc by dangdangdotcom.

the class SQLRouteEngine method buildHintParsedResult.

private SQLParsedResult buildHintParsedResult(final String logicSql) {
    SQLParsedResult result = new SQLParsedResult();
    RouteContext routeContext = result.getRouteContext();
    routeContext.setSqlStatementType(SQLUtil.getTypeByStart(logicSql));
    log.trace("Get {} SQL Statement", routeContext.getSqlStatementType());
    SQLBuilder sqlBuilder = new SQLBuilder();
    try {
        sqlBuilder.append(logicSql);
    } catch (final IOException ignored) {
    }
    routeContext.setSqlBuilder(sqlBuilder);
    result.getConditionContexts().add(new ConditionContext());
    return result;
}
Also used : SQLParsedResult(com.dangdang.ddframe.rdb.sharding.parser.result.SQLParsedResult) SQLBuilder(com.dangdang.ddframe.rdb.sharding.parser.result.router.SQLBuilder) ConditionContext(com.dangdang.ddframe.rdb.sharding.parser.result.router.ConditionContext) IOException(java.io.IOException) RouteContext(com.dangdang.ddframe.rdb.sharding.parser.result.router.RouteContext)

Aggregations

SQLParsedResult (com.dangdang.ddframe.rdb.sharding.parser.result.SQLParsedResult)1 ConditionContext (com.dangdang.ddframe.rdb.sharding.parser.result.router.ConditionContext)1 RouteContext (com.dangdang.ddframe.rdb.sharding.parser.result.router.RouteContext)1 SQLBuilder (com.dangdang.ddframe.rdb.sharding.parser.result.router.SQLBuilder)1 IOException (java.io.IOException)1