public enum CatalogNameLayout extends Enum<CatalogNameLayout>
a.b is schema.table on one call and table.column on the next, and
on BigQuery it may be base column plus STRUCT field — where the first component folds under
DIFFERENT case rules in each reading. Five places in this repository guessed, and each guess was
a confident wrong answer for some input.
So when a caller genuinely has only a joined string — a compatibility API, a metadata file whose own format is flat — it must say which layout the string has. The parser then VERIFIES that the component count matches the declaration and refuses otherwise. It never picks.
Prefer not to be here at all: a caller that holds the parts separately should pass them
separately. ModelBackedCatalogProvider is the cautionary example — it holds catalog,
schema, object and column as separate fields, joins them with dots, and hands the result to a
parser that splits them again, losing the boundaries it already had.
| Enum Constant and Description |
|---|
CATALOG_OBJECT
catalog.object — schemaless dialects such as MySQL. |
CATALOG_OBJECT_COLUMN
catalog.object.column — a column on a schemaless topology such as MySQL's. |
CATALOG_SCHEMA_OBJECT
catalog.schema.object |
CATALOG_SCHEMA_OBJECT_COLUMN
catalog.schema.object.column |
CATALOG_SCHEMA_PACKAGE_MEMBER
catalog.schema.package.routine — a routine inside a package. |
CATALOG_SCHEMA_RELATION_CHILD
catalog.schema.relation.child — an index or constraint on a relation. |
OBJECT
object |
OBJECT_COLUMN
object.column — a relation and one of its columns. |
SCHEMA_OBJECT
schema.object |
SCHEMA_OBJECT_COLUMN
schema.object.column |
SERVER_CATALOG_SCHEMA_OBJECT
server.catalog.schema.object |
SERVER_CATALOG_SCHEMA_OBJECT_COLUMN
server.catalog.schema.object.column — a column through a linked server. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
permitsTerminalKind(CatalogObjectKind kind)
Whether this layout may be used to seek that kind of object.
|
IdentifierComponentRole |
roleAt(int index)
The role at one position.
|
List<IdentifierComponentRole> |
roles()
The role of each component, outermost first.
|
int |
size() |
static CatalogNameLayout |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CatalogNameLayout[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CatalogNameLayout OBJECT
objectpublic static final CatalogNameLayout SCHEMA_OBJECT
schema.objectpublic static final CatalogNameLayout CATALOG_OBJECT
catalog.object — schemaless dialects such as MySQL.public static final CatalogNameLayout CATALOG_SCHEMA_OBJECT
catalog.schema.objectpublic static final CatalogNameLayout SERVER_CATALOG_SCHEMA_OBJECT
server.catalog.schema.objectpublic static final CatalogNameLayout OBJECT_COLUMN
object.column — a relation and one of its columns.public static final CatalogNameLayout SCHEMA_OBJECT_COLUMN
schema.object.columnpublic static final CatalogNameLayout CATALOG_SCHEMA_OBJECT_COLUMN
catalog.schema.object.columnpublic static final CatalogNameLayout CATALOG_OBJECT_COLUMN
catalog.object.column — a column on a schemaless topology such as MySQL's.public static final CatalogNameLayout SERVER_CATALOG_SCHEMA_OBJECT_COLUMN
server.catalog.schema.object.column — a column through a linked server.public static final CatalogNameLayout CATALOG_SCHEMA_RELATION_CHILD
catalog.schema.relation.child — an index or constraint on a relation. Kept separate
from the package-member layout because the two have different parent constraints: this one's
container is a relation, that one's is a package.public static final CatalogNameLayout CATALOG_SCHEMA_PACKAGE_MEMBER
catalog.schema.package.routine — a routine inside a package.public static CatalogNameLayout[] values()
for (CatalogNameLayout c : CatalogNameLayout.values()) System.out.println(c);
public static CatalogNameLayout valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean permitsTerminalKind(CatalogObjectKind kind)
A layout is not just a component count: CATALOG_SCHEMA_RELATION_CHILD describes an
index or a constraint ON a relation, so using it to look for a TABLE would be describing a
table as the child of another table. The restriction lives here rather than as an if
that recognizes one enum constant, so adding a layout forces the question to be answered.
public List<IdentifierComponentRole> roles()
public int size()
public IdentifierComponentRole roleAt(int index)
IndexOutOfBoundsException - if the position is outside this layout — which is the
caller having declared a layout that does not match its string