本文整理汇总了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());
}
示例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);
}
}
示例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);
}
示例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());
}
}
示例5: visit
import net.sf.jsqlparser.schema.Column; //导入方法依赖的package包/类
public void visit(Column tableColumn) {
if (tableColumn.getTable() != null) {
tableColumn.setTable(null);
}
}
示例6: visit
import net.sf.jsqlparser.schema.Column; //导入方法依赖的package包/类
public void visit(Column tableColumn) throws Exception {
if (tableColumn.getTable() != null) {
tableColumn.getTable().accept(this);
}
}