提交 208bb23f 编写于 作者: T terrymanu

remove SQLParseEngine

上级 c198311e
/*
* Copyright 1999-2015 dangdang.com.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* </p>
*/
package com.dangdang.ddframe.rdb.sharding.parser;
import com.dangdang.ddframe.rdb.sharding.parser.sql.context.SQLContext;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* 不包含OR语句的SQL构建器解析.
*
* @author gaohongtao
* @author zhangliang
*/
@RequiredArgsConstructor
@Slf4j
// TODO 与SQLParserEngine合一
public final class SQLParseEngine {
private final SQLContext sqlContext;
/**
*  解析SQL.
*
* @return SQL解析结果
*/
public SQLContext parse() {
return sqlContext;
}
}
......@@ -51,6 +51,6 @@ public class SQLExecutionUnit {
} else {
sql = sqlBuilder.isChanged() ? sqlBuilder.toSQL() : sql;
}
return sqlBuilder.toSQL();
return sql;
}
}
......@@ -23,7 +23,6 @@ import com.dangdang.ddframe.rdb.sharding.constants.DatabaseType;
import com.dangdang.ddframe.rdb.sharding.exception.SQLParserException;
import com.dangdang.ddframe.rdb.sharding.hint.HintManagerHolder;
import com.dangdang.ddframe.rdb.sharding.metrics.MetricsContext;
import com.dangdang.ddframe.rdb.sharding.parser.SQLParseEngine;
import com.dangdang.ddframe.rdb.sharding.parser.result.router.ConditionContext;
import com.dangdang.ddframe.rdb.sharding.parser.result.router.SQLBuilder;
import com.dangdang.ddframe.rdb.sharding.parser.sql.context.DeleteSQLContext;
......@@ -95,7 +94,7 @@ public final class SQLRouteEngine {
}
Context context = MetricsContext.start("Parse SQL");
log.debug("Logic SQL: {}, {}", logicSql, parameters);
SQLContext result = new SQLParseEngine(new SQLParserEngine(databaseType, logicSql, shardingRule, parameters).parseStatement()).parse();
SQLContext result = new SQLParserEngine(databaseType, logicSql, shardingRule, parameters).parseStatement();
MetricsContext.stop(context);
return result;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册