Skip to content

Commit 25b08b1

Browse files
feat: add syntax sugar for accessing name parts easier
Signed-off-by: Andreas Reichel <[email protected]> Signed-off-by: manticore-projects <[email protected]>
1 parent d3d3af9 commit 25b08b1

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,30 @@ public Table getTable() {
9292
return table;
9393
}
9494

95+
public String getTableName() {
96+
return table != null ? table.getName() : null;
97+
}
98+
99+
public String getUnquotedTableName() {
100+
return table != null ? table.getUnquotedName() : null;
101+
}
102+
103+
public String getSchemaName() {
104+
return table != null ? table.getSchemaName() : null;
105+
}
106+
107+
public String getUnquotedSchemaName() {
108+
return table != null ? table.getUnquotedSchemaName() : null;
109+
}
110+
111+
public String getCatalogName() {
112+
return table != null ? table.getCatalogName() : null;
113+
}
114+
115+
public String getUnquotedCatalogName() {
116+
return table != null ? table.getUnquotedCatalogName() : null;
117+
}
118+
95119
public void setTable(Table table) {
96120
this.table = table;
97121
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ public String getDatabaseName() {
115115
return getIndex(DATABASE_IDX);
116116
}
117117

118+
public String getUnquotedCatalogName() {
119+
return MultiPartName.unquote(getDatabaseName());
120+
}
121+
118122
public String getUnquotedDatabaseName() {
119123
return MultiPartName.unquote(getDatabaseName());
120124
}

0 commit comments

Comments
 (0)