@Immutable public final class TableId extends Object implements DataCollectionId, 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.
|
TableId(String catalogName,
String schemaName,
String tableName,
Selectors.TableIdToStringMapper tableIdMapper)
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) |
int |
hashCode() |
String |
identifier()
Get the fully qualified identifier of the data collection.
|
static TableId |
parse(String str)
Parse the supplied string, extracting up to the first 3 parts into a TableID.
|
protected static TableId |
parse(String[] parts,
int numParts,
boolean useCatalogBeforeSchema)
Parse the supplied string, extracting up to the first 3 parts into a TableID.
|
static TableId |
parse(String str,
boolean useCatalogBeforeSchema)
Parse the supplied string, extracting up to the first 3 parts into a TableID.
|
private static String |
quote(String identifierPart,
char quotingChar)
Quotes the given identifier part, e.g.
|
private static String |
repeat(char quotingChar) |
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 |
toDoubleQuotedString()
Returns a dot-separated String representation of this identifier, quoting all
name parts with the
" char. |
TableId |
toLowercase() |
String |
toQuotedString(char quotingChar)
Returns a dot-separated String representation of this identifier, quoting all
name parts with the given quoting char.
|
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, Selectors.TableIdToStringMapper tableIdMapper)
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 nulltableIdMapper
- the customization of fully quailified table namepublic 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 TableId parse(String str)
str
- the string representation of the table identifier; may not be nullpublic static TableId parse(String str, boolean useCatalogBeforeSchema)
str
- the string representation of the table identifier; may not be nulluseCatalogBeforeSchema
- 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 nameprotected static TableId parse(String[] parts, int numParts, boolean useCatalogBeforeSchema)
parts
- the parts of the identifier; may not be nullnumParts
- the number of parts to use for the table identifieruseCatalogBeforeSchema
- 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 String identifier()
DataCollectionId
identifier
in interface DataCollectionId
public int compareTo(TableId that)
compareTo
in interface Comparable<TableId>
public int compareToIgnoreCase(TableId that)
public String toDoubleQuotedString()
"
char.public String toQuotedString(char quotingChar)
private static String quote(String identifierPart, char quotingChar)
private static String repeat(char quotingChar)
public TableId toLowercase()
Copyright © 2020 JBoss by Red Hat. All rights reserved.