public enum CatalogHierarchy extends Enum<CatalogHierarchy>
db.t is a complete identity depends on whether the namespace has a schema level.
On MySQL it does not, so db.t names a table completely. On Oracle it does, so db.t
is a name with an UNRESOLVED schema — and keying it as though it were complete makes it collide
with the same table name in a different schema. The component list alone cannot tell those apart:
both are "a catalog and an object". So the topology is declared, and validation checks the
components against the declaration rather than guessing the declaration from the components.
IdentifierComponentRole.SERVER is deliberately not part of a topology. Every namespace
can be reached through a link, and a name without a server means the local one — its absence is
not a missing level.
| Enum Constant and Description |
|---|
CATALOG_ONLY
A catalog (database) but no schema level: MySQL, Teradata, Hive, Impala.
|
CATALOG_SCHEMA
Catalog and schema both exist: Oracle, SQL Server, PostgreSQL, Snowflake, most dialects.
|
ROOT_ONLY
Objects at the root, with no container level at all.
|
SCHEMA_ONLY
A schema with no catalog above it — a rootless topology.
|
| Modifier and Type | Method and Description |
|---|---|
List<IdentifierComponentRole> |
containers()
The container roles this topology has, outermost first.
|
boolean |
has(IdentifierComponentRole role)
Whether this topology has the given container level.
|
boolean |
hasCatalog() |
boolean |
hasSchema() |
static CatalogHierarchy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CatalogHierarchy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CatalogHierarchy CATALOG_SCHEMA
public static final CatalogHierarchy CATALOG_ONLY
public static final CatalogHierarchy SCHEMA_ONLY
public static final CatalogHierarchy ROOT_ONLY
public static CatalogHierarchy[] values()
for (CatalogHierarchy c : CatalogHierarchy.values()) System.out.println(c);
public static CatalogHierarchy 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 hasCatalog()
public boolean hasSchema()
public List<IdentifierComponentRole> containers()
public boolean has(IdentifierComponentRole role)
Only CATALOG and SCHEMA are topology questions. IdentifierComponentRole.SERVER is
refused rather than answered true: a server is an optional endpoint qualifier, not a level a
topology can lack, and answering "yes, always" contradicted this class's own definition.