com.metamatrix.query.sql.lang
Class JoinPredicate

java.lang.Object
  extended by com.metamatrix.query.sql.lang.FromClause
      extended by com.metamatrix.query.sql.lang.JoinPredicate
All Implemented Interfaces:
LanguageObject, java.io.Serializable, java.lang.Cloneable

public class JoinPredicate
extends FromClause

Represents a subpart of the FROM clause specifying a join within the FROM. It may optionally specify criteria for the join, depending on the join type. For example, these are some representations of JoinPredicates:

  1. GroupA CROSS JOIN GroupB
  2. GroupA JOIN GroupB ON GroupA.E1=GroupB.E1 AND GroupA.E2=GroupB.E2
  3. GroupA RIGHT OUTER JOIN (GroupB JOIN GroupC ON GroupB.E1=GroupC.E1) ON GroupA.E1=GroupB.E1

See Also:
Serialized Form

Constructor Summary
JoinPredicate()
          Construct a JoinPredicate
JoinPredicate(FromClause leftClause, FromClause rightClause, JoinType type)
          Construct a JoinPredicate between two clauses of the specified type.
JoinPredicate(FromClause leftClause, FromClause rightClause, JoinType type, Criteria criteria)
          Construct a JoinPredicate between two clauses of the specified type.
JoinPredicate(FromClause leftClause, FromClause rightClause, JoinType type, java.util.List criteria)
          Construct a JoinPredicate between two clauses of the specified type.
 
Method Summary
 void acceptVisitor(LanguageVisitor visitor)
          Method for accepting a visitor.
 java.lang.Object clone()
          Return deep clone for object
 void collectGroups(java.util.Collection groups)
          Collect all GroupSymbols for this from clause.
 boolean equals(java.lang.Object obj)
          Compare this object to another
 java.util.List getJoinCriteria()
          Get join criteria for this predicate
 JoinType getJoinType()
          Get join type for this predicate
 FromClause getLeftClause()
          Get left clause
 FromClause getRightClause()
          Get right clause
 int hashCode()
          Get hash code for object
 void setJoinCriteria(java.util.List criteria)
          Set join criteria for this predicate
 void setJoinType(JoinType type)
          Set join type for this predicate
 void setLeftClause(FromClause predicate)
          Set left clause
 void setRightClause(FromClause predicate)
          Set right clause
 java.lang.String toString()
          Returns a string representation of an instance of this class.
 
Methods inherited from class com.metamatrix.query.sql.lang.FromClause
hasHint, isMakeDep, isMakeNotDep, isOptional, setMakeDep, setMakeNotDep, setOptional
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JoinPredicate

public JoinPredicate()
Construct a JoinPredicate


JoinPredicate

public JoinPredicate(FromClause leftClause,
                     FromClause rightClause,
                     JoinType type)
Construct a JoinPredicate between two clauses of the specified type.

Parameters:
leftClause - Left from clause
rightClause - Right from clause
type - Type of join

JoinPredicate

public JoinPredicate(FromClause leftClause,
                     FromClause rightClause,
                     JoinType type,
                     java.util.List criteria)
Construct a JoinPredicate between two clauses of the specified type.

Parameters:
leftClause - Left from clause
rightClause - Right from clause
type - Type of join
criteria - List of Criteria for this join predicate

JoinPredicate

public JoinPredicate(FromClause leftClause,
                     FromClause rightClause,
                     JoinType type,
                     Criteria criteria)
Construct a JoinPredicate between two clauses of the specified type.

Parameters:
leftClause - Left from clause
rightClause - Right from clause
type - Type of join
criteria - List of Criteria for this join predicate
Method Detail

setLeftClause

public void setLeftClause(FromClause predicate)
Set left clause

Parameters:
predicate - Left clause to set

getLeftClause

public FromClause getLeftClause()
Get left clause

Returns:
Left clause

setRightClause

public void setRightClause(FromClause predicate)
Set right clause

Parameters:
predicate - Right clause to set

getRightClause

public FromClause getRightClause()
Get right clause

Returns:
Right clause

setJoinType

public void setJoinType(JoinType type)
Set join type for this predicate

Parameters:
type - Type of join

getJoinType

public JoinType getJoinType()
Get join type for this predicate

Returns:
Type of join

setJoinCriteria

public void setJoinCriteria(java.util.List criteria)
Set join criteria for this predicate

Parameters:
criteria - List of Criteria set on this predicate

getJoinCriteria

public java.util.List getJoinCriteria()
Get join criteria for this predicate

Returns:
List of Criteria

collectGroups

public void collectGroups(java.util.Collection groups)
Collect all GroupSymbols for this from clause.

Specified by:
collectGroups in class FromClause
Parameters:
groups - Groups to add to

acceptVisitor

public void acceptVisitor(LanguageVisitor visitor)
Description copied from interface: LanguageObject
Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.

Specified by:
acceptVisitor in interface LanguageObject
Specified by:
acceptVisitor in class FromClause
Parameters:
visitor - Visitor being used

equals

public boolean equals(java.lang.Object obj)
Compare this object to another

Overrides:
equals in class FromClause
Parameters:
obj - Other object
Returns:
True if equal

hashCode

public int hashCode()
Get hash code for object

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code

clone

public java.lang.Object clone()
Return deep clone for object

Specified by:
clone in interface LanguageObject
Specified by:
clone in class FromClause
Returns:
Deep clone

toString

public java.lang.String toString()
Returns a string representation of an instance of this class.

Overrides:
toString in class java.lang.Object
Returns:
String representation of object


Copyright © 2009. All Rights Reserved.