public final class RoutineName extends Object
CatalogLookupName, with the comparison keys of its named levels.
A routine is declared and called by a partial name (f, s.f, pkg.f,
db..p), which is a lookup, not an identity: the levels it leaves out are OMITTED and only
the caller's context (session defaults, search path) could supply them. D3b compares written names;
RoutineRegistry never reports a match that relies on an OMITTED level as resolved.
The levels come from the roles the parser gave the name's tokens (server, database, schema,
package, object). Each named level's key is minted by the analysis IdentifierService from
its token as written (SQL_LEXICAL), or as stored for a name taken from a model, under the comparison
type of its role, or of its kind for an object level
(IdentifierRolePolicy.comparisonTypeOf(gudusoft.gsqlparser.sqlenv.IdentifierComponentRole), CatalogIdentifierPolicy.comparisonTypeOfKind(gudusoft.gsqlparser.catalog.runtime.CatalogObjectKind)).
The terminal's key depends on the kind it is compared as, so it is minted per kind
(terminalKey(gudusoft.gsqlparser.catalog.runtime.CatalogObjectKind)).
| Modifier and Type | Class and Description |
|---|---|
static class |
RoutineName.Level
One level of the name: its role, whether it was named, and its key when named.
|
| Modifier and Type | Method and Description |
|---|---|
static RoutineName |
declared(TObjectName name,
CatalogObjectKind kind,
EDbVendor vendor,
IdentifierService service,
TObjectName enclosingPackage)
The name a routine is declared with: a member of the enclosing package when it is declared inside one
unqualified, else the name as written (a qualifier of a standalone declaration is its schema).
|
List<RoutineName.Level> |
getContainers() |
CatalogObjectKind |
getKind() |
CatalogLookupName |
getLookupName()
The request, as the catalog layer states it.
|
String |
getTerminalText() |
static List<RoutineName> |
interpretations(TObjectName name,
CatalogObjectKind kind,
EDbVendor vendor,
IdentifierService service,
TObjectName enclosingPackage)
The interpretations of a called name: one, or two for an Oracle name
x.f or a call inside a package. |
boolean |
isPackageMember()
Whether this interpretation names a member of a package.
|
boolean |
isQualified()
Whether any container level is named.
|
CanonKey |
terminalKey(CatalogObjectKind asKind)
The terminal's key when compared as a routine of
asKind. |
String |
toString() |
public CatalogLookupName getLookupName()
public List<RoutineName.Level> getContainers()
public String getTerminalText()
public CatalogObjectKind getKind()
public boolean isPackageMember()
public boolean isQualified()
public CanonKey terminalKey(CatalogObjectKind asKind)
asKind.public static RoutineName declared(TObjectName name, CatalogObjectKind kind, EDbVendor vendor, IdentifierService service, TObjectName enclosingPackage)
public static List<RoutineName> interpretations(TObjectName name, CatalogObjectKind kind, EDbVendor vendor, IdentifierService service, TObjectName enclosingPackage)
x.f or a call inside a package.