public final class CatalogLookupName extends Object
t, s.t and db..t are all normal things to write, and none of them is a
complete identity: the first two leave levels unstated, and the third states that a level was
written but left empty. Only after defaults and the search path supply the missing context does a
CatalogObjectKey exist. Collapsing the two ideas into one type is what let db..t
be keyed as db.dbo.t, which silently binds the wrong object whenever the session default
schema is not dbo.
CatalogLookupName.SlotState.ABSENT — the dialect or declared layout genuinely has no such level.
MySQL has no schema level; there is nothing missing.CatalogLookupName.SlotState.OMITTED — the level EXISTS and the caller did not name it. db..t
omits its schema; a bare t omits both. A resolver must supply it before an identity
can be built, and CatalogObjectKey refuses to contain one.CatalogLookupName.SlotState.PRESENT — named, with its text and the provenance of that text.| Modifier and Type | Class and Description |
|---|---|
static class |
CatalogLookupName.Builder |
static class |
CatalogLookupName.Slot
One level of the request.
|
static class |
CatalogLookupName.SlotState
Whether a hierarchy level is inapplicable, unstated, or named.
|
| Modifier and Type | Method and Description |
|---|---|
static CatalogLookupName.Builder |
builder(CatalogHierarchy hierarchy)
A request against a declared namespace topology.
|
String |
getDatabaseLink() |
IdentifierInputForm |
getDatabaseLinkForm() |
CatalogHierarchy |
getHierarchy()
The declared namespace topology this request was built against.
|
List<CatalogLookupName.Slot> |
getObjectSlots()
Every object slot, outermost first.
|
CatalogParentConstraint |
getParentConstraint()
What is known about the parent's kind, or null when the request names no child.
|
CatalogLookupName.Slot |
getParentObjectSlot()
The object slot that contains the terminal, or null when the terminal has no object parent.
|
List<CatalogLookupName.Slot> |
getSlots()
The slots, outermost first.
|
CatalogObjectKind |
getTerminalKind() |
CatalogLookupName.Slot |
getTerminalSlot()
The innermost slot — what this request is actually looking for.
|
boolean |
isFullyQualified()
Whether every level this request needs is named, so an identity could be built without
consulting any default.
|
static CatalogLookupName |
ofDeclaredLayout(List<String> components,
CatalogNameLayout layout,
IdentifierInputForm form,
CatalogObjectKind terminalKind,
CatalogHierarchy hierarchy)
Parses a FLAT name under a layout the caller DECLARES, against a topology the caller DECLARES.
|
CatalogLookupName.Slot |
slotOf(IdentifierComponentRole role)
The slot for a role, or null when this request has no such level.
|
String |
toString() |
public static CatalogLookupName.Builder builder(CatalogHierarchy hierarchy)
public static CatalogLookupName ofDeclaredLayout(List<String> components, CatalogNameLayout layout, IdentifierInputForm form, CatalogObjectKind terminalKind, CatalogHierarchy hierarchy)
Where the layout has a container OBJECT whose exact kind a flat name cannot carry — a
column's parent may be a table, a view or a materialized view — the FAMILY is recorded
instead, derived from the layout itself. A lookup legitimately knows only the family; only a
resolved CatalogObjectKey carries the exact kind.
Prefer builder(CatalogHierarchy) with the parts passed separately. This exists for
callers whose input genuinely is one string.
IllegalArgumentException - if the component count does not match the declared layoutpublic List<CatalogLookupName.Slot> getSlots()
public CatalogObjectKind getTerminalKind()
public CatalogHierarchy getHierarchy()
public CatalogParentConstraint getParentConstraint()
public String getDatabaseLink()
public IdentifierInputForm getDatabaseLinkForm()
public boolean isFullyQualified()
public CatalogLookupName.Slot slotOf(IdentifierComponentRole role)
IllegalArgumentException - for IdentifierComponentRole.OBJECT, which may appear
twice — a relation and its index. Returning the first silently would hand a caller
asking for "the object" the container when it wanted the child. Use
getTerminalSlot(), getParentObjectSlot() or getObjectSlots().public CatalogLookupName.Slot getTerminalSlot()
public CatalogLookupName.Slot getParentObjectSlot()
public List<CatalogLookupName.Slot> getObjectSlots()