Package com.darkcollective.relix.symbol
Record Class ColumnProvenance
java.lang.Object
java.lang.Record
com.darkcollective.relix.symbol.ColumnProvenance
- Record Components:
relation- the name of the relation the column originates from (its declared name, or the re-anchored name after a relation-renameρ R (…)); must not be blankcolumn- the column's name within that relation (its logical name, which may differ from the possibly-suffixed physical name in the concatenated schema); must not be blank
The source-relation origin of a schema
ColumnDefinition — which
relation a column came from, and under what name, so that a
relation-qualified reference (rooms.name) can be resolved
precisely even after a join has renamed the physical column to disambiguate a
collision.
A join concatenates two schemas; when both sides expose a column of the
same name the right side's is renamed with an _r suffix
(Schema.concat(Schema)). The renamed column's physical name is now
name_r, but its provenance still records (rooms, name) — so
rooms.name resolves to it, while devices.name resolves to the
un-renamed name on the left. Ambiguity is impossible by construction:
a qualified reference matches at most one column, and a stale qualifier
(relation not in scope) resolves to none — a validation error rather than a
silent unqualified first-match.
Both fields are matched case-insensitively at resolution time, consistent with the rest of relix's name handling.
-
Constructor Summary
ConstructorsConstructorDescriptionColumnProvenance(String relation, String column) Creates an instance of aColumnProvenancerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolumn()Returns the value of thecolumnrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanWhether this provenance is for the relation namedqualifierand the column namedcolumnName, compared case-insensitively.Returns a copy of this provenance re-anchored to a different relation, keeping the same logical column name.relation()Returns the value of therelationrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
matches
Whether this provenance is for the relation namedqualifierand the column namedcolumnName, compared case-insensitively.- Parameters:
qualifier- the relation qualifier to match; must not benullcolumnName- the column name to match; must not benull- Returns:
trueif both match case-insensitively
-
reanchor
Returns a copy of this provenance re-anchored to a different relation, keeping the same logical column name. Used by a whole-relation renameρ NewName (…), which re-labels every column's origin toNewName.- Parameters:
newRelation- the new relation name; must not be blank- Returns:
- the re-anchored provenance
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
relation
Returns the value of therelationrecord component.- Returns:
- the value of the
relationrecord component
-
column
Returns the value of thecolumnrecord component.- Returns:
- the value of the
columnrecord component
-