mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
optimize QueryColumn.java
This commit is contained in:
parent
b557b9cc96
commit
6ad26ff398
@ -53,11 +53,14 @@ public class QueryColumn implements CloneSupport<QueryColumn> {
|
||||
}
|
||||
|
||||
public QueryColumn(String schema, String tableName, String name) {
|
||||
this(schema, tableName, name, null);
|
||||
SqlUtil.keepColumnSafely(name);
|
||||
this.table = new QueryTable(schema, tableName);
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public QueryColumn(String schema, String tableName, String name, String alias) {
|
||||
SqlUtil.keepColumnSafely(name);
|
||||
this.returnCopyByAsMethod = true;
|
||||
this.table = new QueryTable(schema, tableName);
|
||||
this.name = name;
|
||||
this.alias = alias;
|
||||
@ -75,7 +78,6 @@ public class QueryColumn implements CloneSupport<QueryColumn> {
|
||||
|
||||
public QueryColumn(TableDef tableDef, String name, String alias) {
|
||||
SqlUtil.keepColumnSafely(name);
|
||||
|
||||
this.returnCopyByAsMethod = true;
|
||||
this.table = new QueryTable(tableDef);
|
||||
this.name = name;
|
||||
@ -113,7 +115,7 @@ public class QueryColumn implements CloneSupport<QueryColumn> {
|
||||
|
||||
public QueryColumn as(String alias) {
|
||||
SqlUtil.keepColumnSafely(alias);
|
||||
if (returnCopyByAsMethod || StringUtil.isNotBlank(this.alias)) {
|
||||
if (returnCopyByAsMethod) {
|
||||
QueryColumn newColumn = new QueryColumn();
|
||||
newColumn.table = this.table;
|
||||
newColumn.name = this.name;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user