Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Shardingsphere
提交
2529e493
Shardingsphere
项目概览
apache
/
Shardingsphere
通知
56
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Shardingsphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2529e493
编写于
3月 29, 2018
作者:
T
terrymanu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
For #673: refactor parser jaxb to suitable package
上级
4cda10fd
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
92 addition
and
71 deletion
+92
-71
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/AllParsingIntegrateTests.java
...jdbc/core/parsing/integrate/AllParsingIntegrateTests.java
+2
-0
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/asserts/ParserAssertHelper.java
...bc/core/parsing/integrate/asserts/ParserAssertHelper.java
+36
-33
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/asserts/ParserJAXBHelper.java
...jdbc/core/parsing/integrate/asserts/ParserJAXBHelper.java
+9
-9
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/condition/Condition.java
...jdbc/core/parsing/integrate/jaxb/condition/Condition.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/condition/Conditions.java
...dbc/core/parsing/integrate/jaxb/condition/Conditions.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/condition/Value.java
...dingjdbc/core/parsing/integrate/jaxb/condition/Value.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/groupby/GroupByColumn.java
...bc/core/parsing/integrate/jaxb/groupby/GroupByColumn.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/item/AggregationSelectItem.java
...re/parsing/integrate/jaxb/item/AggregationSelectItem.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/limit/Limit.java
...shardingjdbc/core/parsing/integrate/jaxb/limit/Limit.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/orderby/OrderByColumn.java
...bc/core/parsing/integrate/jaxb/orderby/OrderByColumn.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/root/ParserAssert.java
...ngjdbc/core/parsing/integrate/jaxb/root/ParserAssert.java
+16
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/root/ParserAsserts.java
...gjdbc/core/parsing/integrate/jaxb/root/ParserAsserts.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/table/Table.java
...shardingjdbc/core/parsing/integrate/jaxb/table/Table.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/table/Tables.java
...hardingjdbc/core/parsing/integrate/jaxb/table/Tables.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/token/GeneratedKeyToken.java
.../core/parsing/integrate/jaxb/token/GeneratedKeyToken.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/token/IndexToken.java
...ingjdbc/core/parsing/integrate/jaxb/token/IndexToken.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/token/ItemsToken.java
...ingjdbc/core/parsing/integrate/jaxb/token/ItemsToken.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/token/MultipleInsertValuesToken.java
...rsing/integrate/jaxb/token/MultipleInsertValuesToken.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/token/OffsetToken.java
...ngjdbc/core/parsing/integrate/jaxb/token/OffsetToken.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/token/OrderByToken.java
...gjdbc/core/parsing/integrate/jaxb/token/OrderByToken.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/token/RowCountToken.java
...jdbc/core/parsing/integrate/jaxb/token/RowCountToken.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/token/SQLToken.java
...rdingjdbc/core/parsing/integrate/jaxb/token/SQLToken.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/token/TableToken.java
...ingjdbc/core/parsing/integrate/jaxb/token/TableToken.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/tests/AbstractBaseIntegrateSQLParsingTest.java
.../integrate/tests/AbstractBaseIntegrateSQLParsingTest.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/tests/IntegrateSupportedSQLParsingTest.java
...ing/integrate/tests/IntegrateSupportedSQLParsingTest.java
+4
-5
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/tests/IntegrateUnsupportedSQLParsingTest.java
...g/integrate/tests/IntegrateUnsupportedSQLParsingTest.java
+1
-1
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/tests/ParserAssertsLoader.java
...dbc/core/parsing/integrate/tests/ParserAssertsLoader.java
+3
-1
sharding-core/src/test/java/io/shardingjdbc/core/rewrite/SQLRewriteEngineTest.java
...va/io/shardingjdbc/core/rewrite/SQLRewriteEngineTest.java
+1
-1
未找到文件。
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/AllParsingIntegrateTests.java
浏览文件 @
2529e493
...
...
@@ -17,6 +17,8 @@
package
io.shardingjdbc.core.parsing.integrate
;
import
io.shardingjdbc.core.parsing.integrate.tests.IntegrateSupportedSQLParsingTest
;
import
io.shardingjdbc.core.parsing.integrate.tests.IntegrateUnsupportedSQLParsingTest
;
import
org.junit.runner.RunWith
;
import
org.junit.runners.Suite
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/
jaxb/helper
/ParserAssertHelper.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/
asserts
/ParserAssertHelper.java
浏览文件 @
2529e493
...
...
@@ -15,10 +15,13 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.
jaxb.helper
;
package
io.shardingjdbc.core.parsing.integrate.
asserts
;
import
io.shardingjdbc.core.constant.DatabaseType
;
import
io.shardingjdbc.core.constant.ShardingOperator
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.condition.Condition
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.condition.Conditions
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.table.Tables
;
import
io.shardingjdbc.core.parsing.parser.context.OrderItem
;
import
io.shardingjdbc.core.parsing.parser.context.condition.Column
;
import
io.shardingjdbc.core.parsing.parser.context.limit.Limit
;
...
...
@@ -28,7 +31,7 @@ import io.shardingjdbc.core.parsing.parser.expression.SQLExpression;
import
io.shardingjdbc.core.parsing.parser.expression.SQLNumberExpression
;
import
io.shardingjdbc.core.parsing.parser.expression.SQLPlaceholderExpression
;
import
io.shardingjdbc.core.parsing.parser.expression.SQLTextExpression
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.Value
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.
condition.
Value
;
import
io.shardingjdbc.core.parsing.parser.token.GeneratedKeyToken
;
import
io.shardingjdbc.core.parsing.parser.token.IndexToken
;
import
io.shardingjdbc.core.parsing.parser.token.ItemsToken
;
...
...
@@ -51,22 +54,22 @@ import static org.junit.Assert.assertTrue;
public
class
ParserAssertHelper
{
public
static
void
assertTables
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
Tables
expected
,
final
io
.
shardingjdbc
.
core
.
parsing
.
parser
.
context
.
table
.
Tables
actual
)
{
public
static
void
assertTables
(
final
Tables
expected
,
final
io
.
shardingjdbc
.
core
.
parsing
.
parser
.
context
.
table
.
Tables
actual
)
{
assertTrue
(
EqualsBuilder
.
reflectionEquals
(
ParserJAXBHelper
.
getTables
(
expected
),
actual
));
}
public
static
void
assertConditions
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
Conditions
expected
,
final
io
.
shardingjdbc
.
core
.
parsing
.
parser
.
context
.
condition
.
Conditions
actual
,
final
boolean
isPreparedStatement
)
{
final
Conditions
expected
,
final
io
.
shardingjdbc
.
core
.
parsing
.
parser
.
context
.
condition
.
Conditions
actual
,
final
boolean
isPreparedStatement
)
{
assertTrue
(
EqualsBuilder
.
reflectionEquals
(
buildExpectedConditions
(
expected
,
isPreparedStatement
),
actual
));
}
private
static
io
.
shardingjdbc
.
core
.
parsing
.
parser
.
context
.
condition
.
Conditions
buildExpectedConditions
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
Conditions
conditions
,
final
boolean
isPreparedStatement
)
{
final
Conditions
conditions
,
final
boolean
isPreparedStatement
)
{
io
.
shardingjdbc
.
core
.
parsing
.
parser
.
context
.
condition
.
Conditions
result
=
new
io
.
shardingjdbc
.
core
.
parsing
.
parser
.
context
.
condition
.
Conditions
();
if
(
null
==
conditions
)
{
return
result
;
}
for
(
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
Condition
each
:
conditions
.
getConditions
())
{
for
(
Condition
each
:
conditions
.
getConditions
())
{
List
<
SQLExpression
>
sqlExpressions
=
new
LinkedList
<>();
for
(
Value
value
:
each
.
getValues
())
{
if
(
isPreparedStatement
)
{
...
...
@@ -100,7 +103,7 @@ public class ParserAssertHelper {
return
result
;
}
public
static
void
assertSqlTokens
(
final
List
<
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
SQLToken
>
expected
,
final
List
<
SQLToken
>
actual
,
final
boolean
isPreparedStatement
)
{
public
static
void
assertSqlTokens
(
final
List
<
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
SQLToken
>
expected
,
final
List
<
SQLToken
>
actual
,
final
boolean
isPreparedStatement
)
{
if
(
null
==
expected
||
expected
.
size
()
==
0
)
{
return
;
}
...
...
@@ -118,12 +121,12 @@ public class ParserAssertHelper {
}
}
private
static
List
<
SQLToken
>
buildExpectedSqlTokens
(
final
List
<
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
SQLToken
>
sqlTokens
,
private
static
List
<
SQLToken
>
buildExpectedSqlTokens
(
final
List
<
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
SQLToken
>
sqlTokens
,
final
boolean
isPreparedStatement
)
{
List
<
SQLToken
>
result
=
new
ArrayList
<>(
sqlTokens
.
size
());
for
(
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
SQLToken
each
:
sqlTokens
)
{
if
(
isPreparedStatement
&&
(
each
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
OffsetToken
||
each
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
RowCountToken
))
{
for
(
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
SQLToken
each
:
sqlTokens
)
{
if
(
isPreparedStatement
&&
(
each
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
OffsetToken
||
each
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
RowCountToken
))
{
continue
;
}
result
.
add
(
buildExpectedSQLToken
(
each
,
isPreparedStatement
));
...
...
@@ -131,42 +134,42 @@ public class ParserAssertHelper {
return
result
;
}
private
static
SQLToken
buildExpectedSQLToken
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
SQLToken
sqlToken
,
final
boolean
isPreparedStatement
)
{
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
TableToken
)
{
return
new
TableToken
(
sqlToken
.
getBeginPosition
(),
((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
TableToken
)
sqlToken
).
getOriginalLiterals
());
private
static
SQLToken
buildExpectedSQLToken
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
SQLToken
sqlToken
,
final
boolean
isPreparedStatement
)
{
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
TableToken
)
{
return
new
TableToken
(
sqlToken
.
getBeginPosition
(),
((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
TableToken
)
sqlToken
).
getOriginalLiterals
());
}
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
IndexToken
)
{
return
new
IndexToken
(
sqlToken
.
getBeginPosition
(),
((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
IndexToken
)
sqlToken
).
getOriginalLiterals
(),
((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
IndexToken
)
sqlToken
).
getTableName
());
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
ItemsToken
)
{
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
IndexToken
)
{
return
new
IndexToken
(
sqlToken
.
getBeginPosition
(),
((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
IndexToken
)
sqlToken
).
getOriginalLiterals
(),
((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
IndexToken
)
sqlToken
).
getTableName
());
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
ItemsToken
)
{
ItemsToken
itemsToken
=
new
ItemsToken
(
sqlToken
.
getBeginPosition
());
itemsToken
.
getItems
().
addAll
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
ItemsToken
)
sqlToken
).
getItems
());
itemsToken
.
getItems
().
addAll
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
ItemsToken
)
sqlToken
).
getItems
());
return
itemsToken
;
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
GeneratedKeyToken
)
{
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
GeneratedKeyToken
)
{
if
(
isPreparedStatement
)
{
return
new
GeneratedKeyToken
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
GeneratedKeyToken
)
sqlToken
).
getBeginPositionOfPreparedStatement
());
return
new
GeneratedKeyToken
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
GeneratedKeyToken
)
sqlToken
).
getBeginPositionOfPreparedStatement
());
}
else
{
return
new
GeneratedKeyToken
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
GeneratedKeyToken
)
sqlToken
).
getBeginPositionOfStatement
());
return
new
GeneratedKeyToken
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
GeneratedKeyToken
)
sqlToken
).
getBeginPositionOfStatement
());
}
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
MultipleInsertValuesToken
)
{
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
MultipleInsertValuesToken
)
{
MultipleInsertValuesToken
multipleInsertValuesToken
=
new
MultipleInsertValuesToken
(
sqlToken
.
getBeginPosition
());
multipleInsertValuesToken
.
getValues
().
addAll
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
MultipleInsertValuesToken
)
sqlToken
).
getValues
());
multipleInsertValuesToken
.
getValues
().
addAll
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
MultipleInsertValuesToken
)
sqlToken
).
getValues
());
return
multipleInsertValuesToken
;
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
RowCountToken
)
{
return
new
RowCountToken
(
sqlToken
.
getBeginPosition
(),
((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
RowCountToken
)
sqlToken
).
getRowCount
());
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
OrderByToken
)
{
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
RowCountToken
)
{
return
new
RowCountToken
(
sqlToken
.
getBeginPosition
(),
((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
RowCountToken
)
sqlToken
).
getRowCount
());
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
OrderByToken
)
{
if
(
isPreparedStatement
)
{
return
new
OrderByToken
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
OrderByToken
)
sqlToken
).
getBeginPositionOfPreparedStatement
());
return
new
OrderByToken
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
OrderByToken
)
sqlToken
).
getBeginPositionOfPreparedStatement
());
}
else
{
return
new
OrderByToken
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
OrderByToken
)
sqlToken
).
getBeginPositionOfStatement
());
return
new
OrderByToken
(((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
OrderByToken
)
sqlToken
).
getBeginPositionOfStatement
());
}
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
OffsetToken
)
{
return
new
OffsetToken
(
sqlToken
.
getBeginPosition
(),
((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
OffsetToken
)
sqlToken
).
getOffset
());
}
else
if
(
sqlToken
instanceof
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
OffsetToken
)
{
return
new
OffsetToken
(
sqlToken
.
getBeginPosition
(),
((
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
token
.
OffsetToken
)
sqlToken
).
getOffset
());
}
return
null
;
}
public
static
void
assertLimit
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
Limit
limit
,
final
Limit
actual
,
final
boolean
isPreparedStatement
)
{
public
static
void
assertLimit
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
limit
.
Limit
limit
,
final
Limit
actual
,
final
boolean
isPreparedStatement
)
{
Limit
expected
=
buildExpectedLimit
(
limit
,
isPreparedStatement
);
if
(
null
==
expected
)
{
assertNull
(
actual
);
...
...
@@ -180,7 +183,7 @@ public class ParserAssertHelper {
}
}
private
static
Limit
buildExpectedLimit
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
Limit
limit
,
final
boolean
isPreparedStatement
)
{
private
static
Limit
buildExpectedLimit
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
limit
.
Limit
limit
,
final
boolean
isPreparedStatement
)
{
if
(
null
==
limit
)
{
return
null
;
}
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/
jaxb/helper
/ParserJAXBHelper.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/
asserts
/ParserJAXBHelper.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.
jaxb.helper
;
package
io.shardingjdbc.core.parsing.integrate.
asserts
;
import
com.google.common.base.Function
;
import
com.google.common.base.Optional
;
...
...
@@ -27,9 +27,9 @@ import io.shardingjdbc.core.parsing.parser.context.OrderItem;
import
io.shardingjdbc.core.parsing.parser.context.selectitem.AggregationSelectItem
;
import
io.shardingjdbc.core.parsing.parser.context.table.Table
;
import
io.shardingjdbc.core.parsing.parser.context.table.Tables
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.ParserAssert
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.GroupByColumn
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.OrderByColumn
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.
root.
ParserAssert
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.
groupby.
GroupByColumn
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.
orderby.
OrderByColumn
;
import
io.shardingjdbc.core.parsing.parser.sql.dql.select.SelectStatement
;
import
java.util.List
;
...
...
@@ -54,12 +54,12 @@ public final class ParserJAXBHelper {
* @param tables tables
* @return tables
*/
public
static
Tables
getTables
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
Tables
tables
)
{
public
static
Tables
getTables
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
table
.
Tables
tables
)
{
Tables
result
=
new
Tables
();
if
(
null
==
tables
)
{
return
result
;
}
for
(
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
Table
each
:
tables
.
getTables
())
{
for
(
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
table
.
Table
each
:
tables
.
getTables
())
{
Table
table
=
new
Table
(
each
.
getName
(),
Optional
.
fromNullable
(
each
.
getAlias
()));
result
.
add
(
table
);
}
...
...
@@ -109,13 +109,13 @@ public final class ParserJAXBHelper {
}
if
(
null
!=
assertObj
.
getAggregationSelectItems
())
{
List
<
AggregationSelectItem
>
selectItems
=
Lists
.
transform
(
assertObj
.
getAggregationSelectItems
(),
new
Function
<
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
AggregationSelectItem
,
AggregationSelectItem
>()
{
new
Function
<
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
item
.
AggregationSelectItem
,
AggregationSelectItem
>()
{
@Override
public
AggregationSelectItem
apply
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
AggregationSelectItem
input
)
{
public
AggregationSelectItem
apply
(
final
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
item
.
AggregationSelectItem
input
)
{
AggregationSelectItem
result
=
new
AggregationSelectItem
(
AggregationType
.
valueOf
(
input
.
getAggregationType
().
toUpperCase
()),
input
.
getInnerExpression
(),
Optional
.
fromNullable
(
input
.
getAlias
()));
for
(
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
AggregationSelectItem
each
:
input
.
getDerivedColumns
())
{
for
(
io
.
shardingjdbc
.
core
.
parsing
.
integrate
.
jaxb
.
item
.
AggregationSelectItem
each
:
input
.
getDerivedColumns
())
{
result
.
getDerivedAggregationSelectItems
().
add
(
new
AggregationSelectItem
(
AggregationType
.
valueOf
(
each
.
getAggregationType
().
toUpperCase
()),
each
.
getInnerExpression
(),
Optional
.
fromNullable
(
each
.
getAlias
())));
}
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/Condition.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
condition/
Condition.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.condition
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/Conditions.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
condition/
Conditions.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.condition
;
import
lombok.Getter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/Value.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
condition/
Value.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.condition
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/GroupByColumn.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
groupby/
GroupByColumn.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.groupby
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/AggregationSelectItem.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
item/
AggregationSelectItem.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.item
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/Limit.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
limit/
Limit.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.limit
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/OrderByColumn.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
orderby/
OrderByColumn.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.orderby
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/ParserAssert.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
root/
ParserAssert.java
浏览文件 @
2529e493
...
...
@@ -15,8 +15,23 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.root
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.item.AggregationSelectItem
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.condition.Conditions
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.token.GeneratedKeyToken
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.groupby.GroupByColumn
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.token.IndexToken
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.token.ItemsToken
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.limit.Limit
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.token.MultipleInsertValuesToken
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.token.OffsetToken
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.orderby.OrderByColumn
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.token.OrderByToken
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.token.RowCountToken
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.token.SQLToken
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.token.TableToken
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.table.Tables
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/ParserAsserts.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
root/
ParserAsserts.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.root
;
import
lombok.Getter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/Table.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
table/
Table.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.table
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/Tables.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
table/
Tables.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.table
;
import
lombok.Getter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/GeneratedKeyToken.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
token/
GeneratedKeyToken.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.token
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/IndexToken.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
token/
IndexToken.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.token
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/ItemsToken.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
token/
ItemsToken.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.token
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/MultipleInsertValuesToken.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
token/
MultipleInsertValuesToken.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.token
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/OffsetToken.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
token/
OffsetToken.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.token
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/OrderByToken.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
token/
OrderByToken.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.token
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/RowCountToken.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
token/
RowCountToken.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.token
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/SQLToken.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
token/
SQLToken.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.token
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/TableToken.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/jaxb/
token/
TableToken.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.jaxb
;
package
io.shardingjdbc.core.parsing.integrate.jaxb
.token
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/AbstractBaseIntegrateSQLParsingTest.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/
tests/
AbstractBaseIntegrateSQLParsingTest.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate
;
package
io.shardingjdbc.core.parsing.integrate
.tests
;
import
com.google.common.base.Preconditions
;
import
io.shardingjdbc.core.rule.ShardingRule
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/IntegrateSupportedSQLParsingTest.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/
tests/
IntegrateSupportedSQLParsingTest.java
浏览文件 @
2529e493
...
...
@@ -15,14 +15,13 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate
;
package
io.shardingjdbc.core.parsing.integrate
.tests
;
import
io.shardingjdbc.core.constant.DatabaseType
;
import
io.shardingjdbc.core.parsing.SQLParsingEngine
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.ParserAssert
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.ParserAssertsLoader
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.helper.ParserAssertHelper
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.helper.ParserJAXBHelper
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.root.ParserAssert
;
import
io.shardingjdbc.core.parsing.integrate.asserts.ParserAssertHelper
;
import
io.shardingjdbc.core.parsing.integrate.asserts.ParserJAXBHelper
;
import
io.shardingjdbc.core.parsing.parser.sql.SQLStatement
;
import
io.shardingjdbc.core.parsing.parser.sql.dql.select.SelectStatement
;
import
io.shardingjdbc.core.util.SQLPlaceholderUtil
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/IntegrateUnsupportedSQLParsingTest.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/
tests/
IntegrateUnsupportedSQLParsingTest.java
浏览文件 @
2529e493
...
...
@@ -15,7 +15,7 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate
;
package
io.shardingjdbc.core.parsing.integrate
.tests
;
import
io.shardingjdbc.core.constant.DatabaseType
;
import
io.shardingjdbc.core.parsing.SQLParsingEngine
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/
jaxb
/ParserAssertsLoader.java
→
sharding-core/src/test/java/io/shardingjdbc/core/parsing/integrate/
tests
/ParserAssertsLoader.java
浏览文件 @
2529e493
...
...
@@ -15,9 +15,11 @@
* </p>
*/
package
io.shardingjdbc.core.parsing.integrate.
jaxb
;
package
io.shardingjdbc.core.parsing.integrate.
tests
;
import
com.google.common.base.Preconditions
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.root.ParserAssert
;
import
io.shardingjdbc.core.parsing.integrate.jaxb.root.ParserAsserts
;
import
javax.xml.bind.JAXBContext
;
import
javax.xml.bind.JAXBException
;
...
...
sharding-core/src/test/java/io/shardingjdbc/core/rewrite/SQLRewriteEngineTest.java
浏览文件 @
2529e493
...
...
@@ -21,7 +21,7 @@ import com.google.common.base.Optional;
import
com.google.common.base.Preconditions
;
import
io.shardingjdbc.core.constant.DatabaseType
;
import
io.shardingjdbc.core.constant.OrderType
;
import
io.shardingjdbc.core.parsing.integrate.IntegrateSupportedSQLParsingTest
;
import
io.shardingjdbc.core.parsing.integrate.
tests.
IntegrateSupportedSQLParsingTest
;
import
io.shardingjdbc.core.parsing.parser.context.OrderItem
;
import
io.shardingjdbc.core.parsing.parser.context.limit.Limit
;
import
io.shardingjdbc.core.parsing.parser.context.limit.LimitValue
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录