@Immutable public final class TableId extends Object implements Comparable<TableId>
| Modifier and Type | Field and Description |
|---|---|
private String |
catalogName |
private String |
id |
private String |
schemaName |
private String |
tableName |
| Constructor and Description |
|---|
TableId(String catalogName,
String schemaName,
String tableName)
Create a new table identifier.
|
| Modifier and Type | Method and Description |
|---|---|
String |
catalog()
Get the name of the JDBC catalog.
|
int |
compareTo(TableId that) |
int |
compareToIgnoreCase(TableId that) |
boolean |
equals(Object obj) |
static Predicate<TableId> |
filter(String dbWhitelist,
String dbBlacklist,
String tableWhitelist,
String tableBlacklist)
Create a predicate function that allows only those
TableIds that are allowed by the database whitelist (or
not disallowed by the database blacklist) and allowed by the table whitelist (or not disallowed by the table blacklist). |
int |
hashCode() |
static TableId |
parse(String str)
Parse the supplied string delimited with a period (
.) character, extracting up to the first 3 parts into a TableID. |
static TableId |
parse(String str,
char delimiter,
boolean useCatalogBeforeSchema)
Parse the supplied string, extracting up to the first 3 parts into a TableID.
|
String |
schema()
Get the name of the JDBC schema.
|
String |
table()
Get the name of the table.
|
private static String |
tableId(String catalog,
String schema,
String table) |
String |
toString() |
private final String catalogName
private final String schemaName
private final String tableName
private final String id
public TableId(String catalogName, String schemaName, String tableName)
catalogName - the name of the database catalog that contains the table; may be null if the JDBC driver does not
show a schema for this tableschemaName - the name of the database schema that contains the table; may be null if the JDBC driver does not
show a schema for this tabletableName - the name of the table; may not be nullpublic static Predicate<TableId> filter(String dbWhitelist, String dbBlacklist, String tableWhitelist, String tableBlacklist)
TableIds that are allowed by the database whitelist (or
not disallowed by the database blacklist) and allowed by the table whitelist (or not disallowed by the table blacklist).
Therefore, blacklists are only used if there is no corresponding whitelist.
Qualified table names are comma-separated strings that are each parsed into TableId objects.
dbWhitelist - the comma-separated string listing the names of the databases to be explicitly allowed;
may be nulldbBlacklist - the comma-separated string listing the names of the databases to be explicitly disallowed;
may be nulltableWhitelist - the comma-separated string listing the qualified names of the tables to be explicitly allowed;
may be nulltableBlacklist - the comma-separated string listing the qualified names of the tables to be explicitly disallowed;
may be nullpublic static TableId parse(String str)
.) character, extracting up to the first 3 parts into a TableID.
If the input contains only two parts, then the first part will be used as the catalog name and the second as the table
name.str - the input stringpublic static TableId parse(String str, char delimiter, boolean useCatalogBeforeSchema)
str - the input stringdelimiter - the delimiter between partsuseCatalogBeforeSchema - true if the parsed string contains only 2 items and the first should be used as
the catalog and the second as the table name, or false if the first should be used as the schema and the
second
as the table namepublic String catalog()
public String schema()
public String table()
public int compareTo(TableId that)
compareTo in interface Comparable<TableId>public int compareToIgnoreCase(TableId that)
Copyright © 2016 JBoss by Red Hat. All rights reserved.