本文整理汇总了Java中com.alibaba.druid.sql.ast.SQLName类的典型用法代码示例。如果您正苦于以下问题:Java SQLName类的具体用法?Java SQLName怎么用?Java SQLName使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SQLName类属于com.alibaba.druid.sql.ast包,在下文中一共展示了SQLName类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visit
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public boolean visit(MySqlDeleteStatement x) {
setAliasMap();
setMode(x, Mode.Delete);
accept(x.getFrom());
accept(x.getUsing());
x.getTableSource().accept(this);
if (x.getTableSource() instanceof SQLExprTableSource) {
SQLName tableName = (SQLName) ((SQLExprTableSource) x.getTableSource()).getExpr();
String ident = tableName.toString();
setCurrentTable(x, ident);
TableStat stat = this.getTableStat(ident,ident);
stat.incrementDeleteCount();
}
accept(x.getWhere());
accept(x.getOrderBy());
accept(x.getLimit());
return false;
}
开发者ID:huang-up,项目名称:mycat-src-1.6.1-RELEASE,代码行数:26,代码来源:MycatSchemaStatVisitor.java
示例2: applyColumnRename
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public boolean applyColumnRename(SQLName columnName, SQLName to) {
for (SQLSelectOrderByItem orderByItem : columns) {
SQLExpr expr = orderByItem.getExpr();
if (expr instanceof SQLName
&& SQLUtils.nameEquals((SQLName) expr, columnName)) {
orderByItem.setExpr(to.clone());
return true;
}
}
return false;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:12,代码来源:SQLUnique.java
示例3: computeName
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public String computeName() {
if (tableSource == null) {
return null;
}
SQLExpr expr = tableSource.getExpr();
if (expr instanceof SQLName) {
String name = ((SQLName) expr).getSimpleName();
return SQLUtils.normalize(name);
}
return null;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:14,代码来源:SQLCreateTableStatement.java
示例4: visit
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
@Override
public boolean visit(MySqlInsertStatement x) {
SQLName sqlName = x.getTableName();
if (sqlName != null) {
setCurrentTable(sqlName.toString());
}
return false;
}
开发者ID:actiontech,项目名称:dble,代码行数:9,代码来源:ServerSchemaStatVisitor.java
示例5: getReferencedTableName
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
@Override
public SQLName getReferencedTableName() {
if (referencedTable == null) {
return null;
}
return referencedTable.getName();
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:8,代码来源:SQLForeignKeyImpl.java
示例6: setDatabase
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public void setDatabase(SQLName database) {
if (database != null) {
database.setParent(this);
}
this.database = database;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:8,代码来源:SQLShowTablesStatement.java
示例7: getToName
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public SQLName getToName() {
if (to == null) {
return null;
}
SQLExpr expr = to.expr;
if (expr instanceof SQLName) {
return (SQLName) expr;
}
return null;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:14,代码来源:SQLAlterTableRename.java
示例8: primaryRest
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public SQLExpr primaryRest(SQLExpr expr) {
if (lexer.token() == Token.DOTDOT) {
expr = nameRest((SQLName) expr);
}
return super.primaryRest(expr);
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:8,代码来源:SQLServerExprParser.java
示例9: getObject
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public SQLName getObject() {
return object;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:OracleCreateSynonymStatement.java
示例10: buildGroupByCols
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
private String[] buildGroupByCols(List<SQLExpr> groupByItems,Map<String, String> aliaColumns) {
String[] groupByCols = new String[groupByItems.size()];
for(int i= 0; i < groupByItems.size(); i++) {
SQLExpr sqlExpr = groupByItems.get(i);
String column = null;
if(sqlExpr instanceof SQLIdentifierExpr )
{
column=((SQLIdentifierExpr) sqlExpr).getName();
} else if(sqlExpr instanceof SQLMethodInvokeExpr){
column = ((SQLMethodInvokeExpr) sqlExpr).toString();
} else if(sqlExpr instanceof MySqlOrderingExpr){
//todo czn
SQLExpr expr = ((MySqlOrderingExpr) sqlExpr).getExpr();
if (expr instanceof SQLName)
{
column = StringUtil.removeBackquote(((SQLName) expr).getSimpleName());//不要转大写 2015-2-10 sohudo StringUtil.removeBackquote(expr.getSimpleName().toUpperCase());
} else
{
column = StringUtil.removeBackquote(expr.toString());
}
} else if(sqlExpr instanceof SQLPropertyExpr){
/**
* 针对子查询别名,例如select id from (select h.id from hotnews h union select h.title from hotnews h ) as t1 group by t1.id;
*/
column = sqlExpr.toString();
}
if(column == null){
column = sqlExpr.toString();
}
int dotIndex=column.indexOf(".") ;
int bracketIndex=column.indexOf("(") ;
//通过判断含有括号来决定是否为函数列
if(dotIndex!=-1&&bracketIndex==-1)
{
//此步骤得到的column必须是不带.的,有别名的用别名,无别名的用字段名
column=column.substring(dotIndex+1) ;
}
groupByCols[i] = getAliaColumn(aliaColumns,column);//column;
}
return groupByCols;
}
开发者ID:huang-up,项目名称:mycat-src-1.6.1-RELEASE,代码行数:43,代码来源:DruidSelectParser.java
示例11: setLabel
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public void setLabel(SQLName label) {
this.label = label;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:OracleGotoStatement.java
示例12: getPartitions
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public List<SQLName> getPartitions() {
return partitions;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:SQLAlterTableRebuildPartition.java
示例13: addPartition
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public void addPartition(SQLName partition) {
if (partition != null) {
partition.setParent(this);
}
this.partitions.add(partition);
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:7,代码来源:SQLAlterTableRebuildPartition.java
示例14: setTable
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public void setTable(SQLName table) {
this.setTable(new SQLExprTableSource(table));
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:SQLCreateIndexStatement.java
示例15: getName
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public SQLName getName() {
return name;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:SQLCreateIndexStatement.java
示例16: getFirstColumn
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public SQLName getFirstColumn() {
return firstColumn;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:MySqlAlterTableChangeColumn.java
示例17: getProcedureName
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public SQLName getProcedureName() {
return procedureName;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:SQLCallStatement.java
示例18: setProcedureName
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public void setProcedureName(SQLName procedureName) {
this.procedureName = procedureName;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:SQLCallStatement.java
示例19: getTo
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public SQLName getTo() {
return to;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:SQLAlterViewRenameStatement.java
示例20: getColumns
import com.alibaba.druid.sql.ast.SQLName; //导入依赖的package包/类
public List<SQLName> getColumns() {
return columns;
}
开发者ID:zuonima,项目名称:sql-utils,代码行数:4,代码来源:OdpsGrantStmt.java
注:本文中的com.alibaba.druid.sql.ast.SQLName类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论