public final class JoinEntity extends Object
conditionText (the SQL substring derived from span,
never 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).
| 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()
Never null; empty until ON predicates are attached (slice 168).
|
String |
getConditionText()
Optional verbatim SQL substring of the ON condition; may be null.
|
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()
public SourceSpan getSourceSpan()
public String getConditionText()