improved PageUtils & support natural join. issue #1711

This commit is contained in:
wenshao
2017-05-08 03:27:32 +08:00
parent 2dbe1da578
commit 306f956273
8 changed files with 221 additions and 1 deletions
@@ -572,8 +572,14 @@ public class PagerUtils {
if (parent instanceof SQLSelectQuery) {
if (parent instanceof OracleSelectQueryBlock) {
OracleSelectQueryBlock queryBlock = (OracleSelectQueryBlock) parent;
if (queryBlock.getFrom() instanceof SQLExprTableSource) {
SQLTableSource from = queryBlock.getFrom();
if (from instanceof SQLExprTableSource) {
selectQuery = queryBlock;
} else if (from instanceof SQLSubqueryTableSource) {
SQLSelect subSelect = ((SQLSubqueryTableSource) from).getSelect();
if (subSelect.getQuery() instanceof OracleSelectQueryBlock) {
selectQuery = (OracleSelectQueryBlock) subSelect.getQuery();
}
}
}
break;
@@ -581,6 +587,7 @@ public class PagerUtils {
}
}
if (selectQuery != null) {
SQLObject parent = selectQuery.getParent();
if (parent instanceof SQLSelect) {