Skip to content

Commit 4f500a4

Browse files
arcuri82wumpz
authored andcommitted
JavaDoc for Column#getTable (#782)
1 parent e216840 commit 4f500a4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/main/java/net/sf/jsqlparser/schema/Column.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,28 @@ public Column(String columnName) {
3636
this(null, columnName);
3737
}
3838

39+
/**
40+
* Retrieve the information regarding the {@code Table} this {@code Column} does
41+
* belong to, if any can be inferred.
42+
* <p>
43+
* The inference is based only on local information, and not on the whole SQL command.
44+
* For example, consider the following query:
45+
* <blockquote><pre>
46+
* SELECT x FROM Foo
47+
* </pre></blockquote>
48+
* Given the {@code Column} called {@code x}, this method would return {@code null},
49+
* and not the info about the table {@code Foo}.
50+
* On the other hand, consider:
51+
* <blockquote><pre>
52+
* SELECT t.x FROM Foo t
53+
* </pre></blockquote>
54+
* Here, we will get a {@code Table} object for a table called {@code t}.
55+
* But because the inference is local, such object will not know that {@code t} is
56+
* just an alias for {@code Foo}.
57+
*
58+
* @return an instance of {@link net.sf.jsqlparser.schema.Table} representing the
59+
* table this column does belong to, if it can be inferred. Can be {@code null}.
60+
*/
3961
public Table getTable() {
4062
return table;
4163
}

0 commit comments

Comments
 (0)