public final class IdentifierRolePolicy extends Object
ESQLDataObjectType whose comparison and quoting
rules apply (stage S0R of docs/refactor/identifier_identity_display_separation_plan.md).
IdentifierComponentRole answers "what IS this component" — a server, a schema, the base
column. ESQLDataObjectType answers "under which rules is it compared and quoted". They
are not the same question and must not be the same enum: a role set needs SERVER and
STRUCT_FIELD, which no comparison domain of its own exists for, while the comparison type must
stay the thing IdentifierProfile and IdentifierCodec are keyed by — the profile
routes it to an ObjectGroup for case rules, and the codec needs the full type because
quoting differs per type on some vendors (SQL Server quotes a column differently from a table).
IdentifierComponentRole.OBJECT, depends on the object's entity kind and is owned by
CatalogIdentifierPolicy.comparisonTypeOfKind in the catalog layer. The split is
structural, not stylistic: catalog.runtime already depends on sqlenv, so holding
the kind mapping here would close a package cycle and make the low-level identifier layer
import a high-level catalog type that calls straight back into it.
mayFollow predicate, and
it was the wrong abstraction: a pairwise test cannot express "at most one SERVER", "a column key
must terminate in a base column or a field path", or the kind-dependent nesting that lets a
PACKAGE contain a PROCEDURE but forbids a SEQUENCE containing a column — and it silently merged
five different languages (resolved identity, partial lookup, column path, package member, table
child) into one. Sequence validation belongs to each domain's whole-shape validator, which sees
the complete component vector, the entity kinds and the declared layout.| Modifier and Type | Method and Description |
|---|---|
static ESQLDataObjectType |
comparisonTypeOf(IdentifierComponentRole role)
The comparison/quoting type for a component whose role determines it.
|
static boolean |
isRoleDecided(IdentifierComponentRole role)
Whether this role's comparison type is decided by the role alone.
|
public static ESQLDataObjectType comparisonTypeOf(IdentifierComponentRole role)
IdentifierComponentRole.OBJECT is deliberately REFUSED: the comparison type of a
named catalog object depends on its entity kind, which is a catalog concept this package
must not depend on. A catalog caller asks
CatalogIdentifierPolicy.comparisonTypeOfKind for those. Keeping the two apart is
what stops the low-level identifier layer from importing the high-level catalog layer.
IllegalArgumentException - for a null role or for OBJECTpublic static boolean isRoleDecided(IdentifierComponentRole role)