com.caucho.amber.expr
Class ManyToOneJoinExpr

java.lang.Object
  extended by com.caucho.amber.expr.AbstractAmberExpr
      extended by com.caucho.amber.expr.JoinExpr
          extended by com.caucho.amber.expr.ManyToOneJoinExpr
All Implemented Interfaces:
AmberExpr

public class ManyToOneJoinExpr
extends JoinExpr

Links two tables. The parent table is "b" in "b.next". The child table is "b.next" The source is "b", i.e. the parent. The target is "b.next", i.e. the child.


Field Summary
 
Fields inherited from interface com.caucho.amber.expr.AmberExpr
IS_INNER_JOIN, USES_DATA
 
Constructor Summary
ManyToOneJoinExpr(LinkColumns link, FromItem source, FromItem target)
          Creates the expr.
 
Method Summary
 AmberExpr bindSelect(QueryParser parser)
          Binds the expression as a select item.
 boolean bindToFromItem()
          Binds the link to the from item.
 boolean equals(java.lang.Object o)
          Test for equality.
 boolean exists(FromItem from)
          Returns true if the expression uses the from item.
 void generateHaving(CharBuffer cb)
          Generates the having expression.
 void generateJoin(CharBuffer cb)
          Generates the where expression.
 void generateUpdateWhere(CharBuffer cb)
          Generates the (update) where expression.
 void generateWhere(CharBuffer cb)
          Generates the where expression.
 FromItem getJoinParent()
          Returns the target join clause.
 FromItem getJoinTarget()
          Returns the target join clause.
 boolean isBoolean()
          Returns true for a boolean expression.
 boolean isManyToMany()
          Returns true for a many-to-many expression.
 AmberExpr replace(IdExpr id)
          Returns the id expr with the joined expression.
 AmberExpr replace(KeyColumnExpr id)
          Returns the id expr with the joined expression.
 java.lang.String toString()
           
 boolean usesFrom(FromItem from, int type, boolean isNot)
          Returns true if the expression uses the from item.
 
Methods inherited from class com.caucho.amber.expr.JoinExpr
getWhere, isDependent
 
Methods inherited from class com.caucho.amber.expr.AbstractAmberExpr
createBoolean, exists, findItem, generateSelect, getCacheObject, getColumnCount, getObject, getType, hasRelationship, replaceJoin, setInternalArgType, usesFrom
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManyToOneJoinExpr

public ManyToOneJoinExpr(LinkColumns link,
                         FromItem source,
                         FromItem target)
Creates the expr.

Method Detail

isBoolean

public boolean isBoolean()
Returns true for a boolean expression.

Specified by:
isBoolean in interface AmberExpr
Overrides:
isBoolean in class JoinExpr

isManyToMany

public boolean isManyToMany()
Returns true for a many-to-many expression.


bindSelect

public AmberExpr bindSelect(QueryParser parser)
Binds the expression as a select item.

Specified by:
bindSelect in interface AmberExpr
Overrides:
bindSelect in class JoinExpr

bindToFromItem

public boolean bindToFromItem()
Binds the link to the from item.

Overrides:
bindToFromItem in class JoinExpr

getJoinTarget

public FromItem getJoinTarget()
Returns the target join clause.

Overrides:
getJoinTarget in class JoinExpr

getJoinParent

public FromItem getJoinParent()
Returns the target join clause.

Overrides:
getJoinParent in class JoinExpr

usesFrom

public boolean usesFrom(FromItem from,
                        int type,
                        boolean isNot)
Returns true if the expression uses the from item.

Specified by:
usesFrom in interface AmberExpr
Overrides:
usesFrom in class AbstractAmberExpr

exists

public boolean exists(FromItem from)
Returns true if the expression uses the from item.

Specified by:
exists in interface AmberExpr
Overrides:
exists in class AbstractAmberExpr

replace

public AmberExpr replace(KeyColumnExpr id)
Returns the id expr with the joined expression.

Overrides:
replace in class JoinExpr

replace

public AmberExpr replace(IdExpr id)
Returns the id expr with the joined expression.

Overrides:
replace in class JoinExpr

generateWhere

public void generateWhere(CharBuffer cb)
Generates the where expression.

Specified by:
generateWhere in interface AmberExpr
Overrides:
generateWhere in class AbstractAmberExpr

generateUpdateWhere

public void generateUpdateWhere(CharBuffer cb)
Generates the (update) where expression.

Specified by:
generateUpdateWhere in interface AmberExpr
Overrides:
generateUpdateWhere in class AbstractAmberExpr

generateHaving

public void generateHaving(CharBuffer cb)
Generates the having expression.

Specified by:
generateHaving in interface AmberExpr
Overrides:
generateHaving in class AbstractAmberExpr

generateJoin

public void generateJoin(CharBuffer cb)
Generates the where expression.

Specified by:
generateJoin in interface AmberExpr
Overrides:
generateJoin in class AbstractAmberExpr

equals

public boolean equals(java.lang.Object o)
Test for equality.

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object