当前位置: 首页>>代码示例>>Java>>正文


Java Column.getTable方法代码示例

本文整理汇总了Java中net.sf.jsqlparser.schema.Column.getTable方法的典型用法代码示例。如果您正苦于以下问题:Java Column.getTable方法的具体用法?Java Column.getTable怎么用?Java Column.getTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.jsqlparser.schema.Column的用法示例。


在下文中一共展示了Column.getTable方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import net.sf.jsqlparser.schema.Column; //导入方法依赖的package包/类
@Override
public void visit(Column tableColumn) {
    final Table table = tableColumn.getTable();
    String tableName = null;
    if (table != null) {
        if (table.getAlias() != null) {
            tableName = table.getAlias().getName();
        } else {
            tableName = table.getFullyQualifiedName();
        }
    }
    if (tableName != null && !tableName.isEmpty()) {
        buffer.append(tableName).append(".");
    }

    buffer.append(tableColumn.getColumnName());
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:18,代码来源:ExpressionDeParser.java

示例2: visit

import net.sf.jsqlparser.schema.Column; //导入方法依赖的package包/类
@Override
public void visit(Column column)
{
   String tableName = null;
   if (column.getTable() != null)
      tableName = column.getTable().getName();

   if (tableName == null)
   {
      List<String> tables = new TablesNamesFinder().getTableList(statement);
      if (tables != null && tables.size() == 1)
         tableName = tables.get(0).toLowerCase();
   }

   if (tableName != null)
      if (aliases.containsKey(tableName))
         tableName = aliases.get(tableName);
   
   if (tableName != null)
   {
      Map<String, Set<String>> m = on.get(tableName);
      if (m == null)
         m = new TreeMap<>();
      
      Set<String> cols = m.get(queryId);
      if (cols == null)
         cols = new TreeSet<>();

      cols.add(column.getColumnName().toLowerCase());
      m.put(queryId, cols);
      on.put(tableName, m);
   }
}
 
开发者ID:jesperpedersen,项目名称:postgres-tools,代码行数:34,代码来源:QueryAnalyzer.java

示例3: accumulate

import net.sf.jsqlparser.schema.Column; //导入方法依赖的package包/类
private void accumulate(Column column) {
    String tableName;
    Table fromTable = column.getTable();
    if (fromTable == null || fromTable.getName() == null) {
        if (mainTableAlias == null) {
            throw new IllegalArgumentException("you have to full qualify column names, ambiguos column is " + column);
        }
        tableName = mainTableAlias;
    } else {
        tableName = fromTable.getName();
    }
    String tableAlias = tableName;
    if (fromTable.getAlias() != null && fromTable.getAlias().getName() != null) {
        tableAlias = fromTable.getAlias().getName();
    }
    if (mainTableAlias == null) {
        mainTableAlias = tableAlias;
    } else if (!mainTableAlias.equals(tableAlias)) {
        containsMixedAliases = true;
        mainTableAlias = null;
    }
    List<Column> columnsForTable = columnsByTable.get(tableAlias);
    if (columnsForTable == null) {
        columnsForTable = new ArrayList<>();
        columnsByTable.put(tableAlias, columnsForTable);
    }
    columnsForTable.add(column);
}
 
开发者ID:diennea,项目名称:herddb,代码行数:29,代码来源:ColumnReferencesDiscovery.java

示例4: visit

import net.sf.jsqlparser.schema.Column; //导入方法依赖的package包/类
@Override
public void visit(Column column) {
    
    if (column.getTable() == null || column.getTable().getName() == null) {
        throw new QueryException("Column table can not be determined: %s", column.getFullyQualifiedName());
    }
    
    String alias = column.getTable().getName();
    if (!selectDef.getTables().containsKey(alias)) {
        throw new QueryException("Column table alias can not be determined: %s", column.getFullyQualifiedName());
    }
    
    SelectDef td = selectDef.getTables().get(alias);
    String name = fixColumnName(column.getColumnName());

    boolean found = Boolean.FALSE;
    for (String n: td.getColumns()) {
        if (name.equalsIgnoreCase(n)) {
            column.setColumnName("\"" + n + "\"");
            found = Boolean.TRUE;
        }
    }
    
    if (!found) {
        throw new QueryException("Column %s not found in table", column.getFullyQualifiedName());
    }
    
}
 
开发者ID:valdasraps,项目名称:resthub,代码行数:29,代码来源:CheckExpressionParser.java

示例5: visit

import net.sf.jsqlparser.schema.Column; //导入方法依赖的package包/类
public void visit(Column tableColumn) {
    if (tableColumn.getTable() != null) {
        tableColumn.setTable(null);
    }
}
 
开发者ID:zhicwu,项目名称:cassandra-jdbc-driver,代码行数:6,代码来源:SqlToCqlTranslator.java

示例6: visit

import net.sf.jsqlparser.schema.Column; //导入方法依赖的package包/类
public void visit(Column tableColumn) throws Exception {
    if (tableColumn.getTable() != null) {
        tableColumn.getTable().accept(this);
    }
}
 
开发者ID:ddf-project,项目名称:DDF,代码行数:6,代码来源:TableVisitor.java


注:本文中的net.sf.jsqlparser.schema.Column.getTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。