Class SqlNameContext
java.lang.Object
org.evomaster.client.java.sql.internal.SqlNameContext
Given a column, we need to determinate to which table it
belongs to. This is not always simple, as SQL queries can use "aliases".
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
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSqlNameContext(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 -
Method Summary
-
Field Details
-
UNNAMED_TABLE
- See Also:
-
-
Constructor Details
-
SqlNameContext
public 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- Parameters:
statement- to create context for
-
-
Method Details
-
setSchema
-
hasColumn
Check if table contains a column with the given name. This is based on the DB schema. If no schema is defined, this method returns false. -
getFullyQualifiedTableName
- Parameters:
column- a column object- Returns:
- the name of the table that this column belongs to
-