public class SqlNameContext extends Object
This problem is further exacerbated by: 1) a SELECT can have many sub-SELECTs inside it, each one defining their own independent aliases 2) a SQL command might not have all the necessary info to infer the right table for a column. In those (valid) cases of ambiguity, we must refer to the schema. WARNING: we lowercase all names of tables and columns, as SQL is (should be?) case insensitive
| Modifier and Type | Field and Description |
|---|---|
static String |
UNNAMED_TABLE |
| Constructor and Description |
|---|
SqlNameContext(net.sf.jsqlparser.statement.Statement statement)
WARNING: should only be used in tests, to avoid each time having
to provide a schema for the test data
|
| Modifier and Type | Method and Description |
|---|---|
String |
getTableName(net.sf.jsqlparser.schema.Column column) |
boolean |
hasColumn(String tableName,
String columnName)
Check if table contains a column with the given name.
|
void |
setSchema(DbInfoDto schema) |
public static final String UNNAMED_TABLE
public SqlNameContext(net.sf.jsqlparser.statement.Statement statement)
statement - to create context forpublic void setSchema(DbInfoDto schema)
public boolean hasColumn(String tableName, String columnName)
public String getTableName(net.sf.jsqlparser.schema.Column column)
column - a column objectCopyright © 2016–2025. All rights reserved.