public final class JoinEntity extends Object
conditionText. The source text and semantic predicates are
deliberately separate representations: conditionText is never
synthesized from getConditions() or reformatted.
Endpoints are JoinEndpoints, never bare aliases, so a
left-deep chain is modelled correctly: rightEndpoint is the
newly added relation; leftEndpoint is the accumulated
JoinEndpointKind.JOIN_RESULT of prior joins (or the first
JoinEndpointKind.RELATION).
Immutable. Introduced by join-analysis slice 162 (S1); built in slice 167 (S6); predicates attached in slice 168 (S7).
API status: supported read-only result. Public getters are part of
Join Analysis Consumption Profile v1. Constructors and with*
helpers are producer-oriented and are outside that profile.
| Constructor and Description |
|---|
JoinEntity(SemanticJoinType joinType,
JoinEndpoint leftEndpoint,
JoinEndpoint rightEndpoint,
int order,
JoinSourceSyntax sourceSyntax,
boolean naturalFlag,
List<String> usingColumns,
List<Predicate> conditions,
SourceSpan sourceSpan,
String conditionText)
Original 10-arg constructor (non-lateral).
|
JoinEntity(SemanticJoinType joinType,
JoinEndpoint leftEndpoint,
JoinEndpoint rightEndpoint,
int order,
JoinSourceSyntax sourceSyntax,
boolean naturalFlag,
List<String> usingColumns,
List<Predicate> conditions,
SourceSpan sourceSpan,
String conditionText,
boolean lateralFlag)
Full constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
List<Predicate> |
getConditions()
Semantic conditions attached to this join.
|
String |
getConditionText()
Returns the optional verbatim source expression that directly defines
this join entity's condition.
|
SemanticJoinType |
getJoinType() |
JoinEndpoint |
getLeftEndpoint() |
int |
getOrder() |
JoinEndpoint |
getRightEndpoint() |
SourceSpan |
getSourceSpan()
Optional; null when the parser cannot anchor the join clause.
|
JoinSourceSyntax |
getSourceSyntax() |
List<String> |
getUsingColumns()
Never null; empty unless a USING clause was written.
|
int |
hashCode() |
boolean |
isLateral()
True for a lateral join (SQL Server
CROSS APPLY /
OUTER APPLY). |
boolean |
isNatural() |
String |
toString() |
JoinEntity |
withConditions(List<Predicate> newConditions)
Return a copy of this entity with its ON-condition predicate list
replaced (used by slice 168 to attach predicates without mutating
the immutable entity built in slice 167).
|
public JoinEntity(SemanticJoinType joinType, JoinEndpoint leftEndpoint, JoinEndpoint rightEndpoint, int order, JoinSourceSyntax sourceSyntax, boolean naturalFlag, List<String> usingColumns, List<Predicate> conditions, SourceSpan sourceSpan, String conditionText)
lateralFlag = false.public JoinEntity(SemanticJoinType joinType, JoinEndpoint leftEndpoint, JoinEndpoint rightEndpoint, int order, JoinSourceSyntax sourceSyntax, boolean naturalFlag, List<String> usingColumns, List<Predicate> conditions, SourceSpan sourceSpan, String conditionText, boolean lateralFlag)
lateralFlag marks a lateral join
(SQL Server CROSS APPLY / OUTER APPLY); such a join
carries no ON/USING and empty conditions — the correlation
lives inside the right operand's own statement graph. The flag lets
consumers distinguish a lateral join from a buggy cartesian INNER.public JoinEntity withConditions(List<Predicate> newConditions)
public SemanticJoinType getJoinType()
public JoinEndpoint getLeftEndpoint()
public JoinEndpoint getRightEndpoint()
public int getOrder()
public JoinSourceSyntax getSourceSyntax()
public boolean isNatural()
public boolean isLateral()
CROSS APPLY /
OUTER APPLY). Such a join has empty getConditions()
and getUsingColumns(); the correlation lives inside the
right operand. Distinguishes a lateral join from a cartesian INNER.public List<String> getUsingColumns()
public List<Predicate> getConditions()
null; may be
populated from ON, promoted WHERE predicates, or a
predicate-derived semi-join independently of getConditionText().public SourceSpan getSourceSpan()
public String getConditionText()
For an EXPLICIT join with
ON, this is the ON expression without the ON
keyword. For a predicate-derived SEMI or
anti-semi join, this is the complete EXISTS/IN wrapper
expression, including NOT when written.
It is null for COMMA joins,
even when getConditions() contains predicates promoted from
WHERE, because no join-local condition expression was written.
It is also null for CROSS, USING,
NATURAL, and condition-less LATERAL/APPLY
source forms, or when the source expression cannot be anchored.
The returned text is never synthesized or reformatted. It is not a
serialization of getConditions() and is not guaranteed to be
valid as an ON expression in another SQL dialect.