@Immutable public final class ColumnId extends Object implements Comparable<ColumnId>
Modifier and Type | Field and Description |
---|---|
private String |
columnName |
private String |
id |
private static Pattern |
IDENTIFIER_SEPARATOR_PATTERN |
private TableId |
tableId |
Constructor and Description |
---|
ColumnId(String catalogName,
String schemaName,
String tableName,
String columnName)
Create a new column identifier.
|
ColumnId(TableId tableId,
String columnName)
Create a new column identifier.
|
Modifier and Type | Method and Description |
---|---|
String |
catalog()
Get the name of the JDBC catalog.
|
private static String |
columnId(TableId tableId,
String columnName) |
String |
columnName()
Get the name of the table.
|
int |
compareTo(ColumnId that) |
int |
compareToIgnoreCase(ColumnId that) |
boolean |
equals(Object obj) |
static Map<TableId,Predicate<Column>> |
filter(String columnBlacklist)
Create the map of predicate functions that specify which columns are to be included.
|
int |
hashCode() |
static ColumnId |
parse(String str)
Parse the supplied string delimited with a period (
. ) character, extracting the last segment into a column name
and the prior segments into the TableID. |
private static ColumnId |
parse(String str,
boolean useCatalogBeforeSchema)
Parse the supplied string delimited with the specified delimiter character, extracting the last segment into a column name
and the prior segments into the TableID.
|
String |
schema()
Get the name of the JDBC schema.
|
String |
table()
Get the name of the table.
|
TableId |
tableId()
Get the identifier for the table that owns this column.
|
String |
toString() |
private static final Pattern IDENTIFIER_SEPARATOR_PATTERN
private final TableId tableId
private final String columnName
private final String id
public ColumnId(TableId tableId, String columnName)
tableId
- the identifier of the table; may not be nullcolumnName
- the name of the column; may not be nullpublic ColumnId(String catalogName, String schemaName, String tableName, String columnName)
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 nullcolumnName
- the name of the column; may not be nullpublic static Map<TableId,Predicate<Column>> filter(String columnBlacklist)
Qualified column names are comma-separated strings that are each parsed
into ColumnId
objects.
columnBlacklist
- the comma-separated string listing the qualified names of the columns to be explicitly disallowed;
may be nullpublic static ColumnId parse(String str)
.
) character, extracting the last segment into a column name
and the prior segments into the TableID.str
- the input stringprivate static ColumnId parse(String str, boolean useCatalogBeforeSchema)
str
- the input stringuseCatalogBeforeSchema
- 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 TableId tableId()
public String catalog()
public String schema()
public String table()
public String columnName()
public int compareTo(ColumnId that)
compareTo
in interface Comparable<ColumnId>
public int compareToIgnoreCase(ColumnId that)
Copyright © 2017 JBoss by Red Hat. All rights reserved.