public class ColumnReference extends Object
When multiple syntactically different identifiers refer to the same semantic column (e.g., "Column1" and column1 in Oracle), this class allows tracing back from the normalized column name to all original occurrences in the SQL text.
Example: For SQL SELECT "Column1", column1 FROM dual:
| Constructor and Description |
|---|
ColumnReference(TObjectName objectName)
Create a column reference from a TObjectName AST node.
|
ColumnReference(TObjectName objectName,
String originalText,
int startOffset,
int endOffset,
int lineNumber,
int columnNumber)
Create a column reference with explicit values (for testing or special cases).
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
getColumnNumber()
Get the column number.
|
int |
getEndOffset()
Get the end offset in the SQL text.
|
int |
getLineNumber()
Get the line number.
|
TObjectName |
getObjectName()
Get the original AST node.
|
String |
getOriginalText()
Get the original text as it appears in SQL.
|
int |
getStartOffset()
Get the start offset in the SQL text.
|
int |
hashCode() |
boolean |
hasPositionInfo()
Check if position information is available.
|
String |
toString() |
public ColumnReference(TObjectName objectName)
objectName - the original AST nodepublic ColumnReference(TObjectName objectName, String originalText, int startOffset, int endOffset, int lineNumber, int columnNumber)
objectName - the original AST node (may be null)originalText - the original textstartOffset - start offsetendOffset - end offsetlineNumber - line numbercolumnNumber - column numberpublic TObjectName getObjectName()
public String getOriginalText()
public int getStartOffset()
public int getEndOffset()
public int getLineNumber()
public int getColumnNumber()
public boolean hasPositionInfo()