com.caucho.amber.expr
Class ElementCollectionExpr

java.lang.Object
  extended by com.caucho.amber.expr.AbstractAmberExpr
      extended by com.caucho.amber.expr.AbstractPathExpr
          extended by com.caucho.amber.expr.ElementCollectionExpr
All Implemented Interfaces:
AmberExpr, PathExpr

public class ElementCollectionExpr
extends AbstractPathExpr

Expression to a collection of rows The relation is maintained by a link from the child objects to the parent object.


Field Summary
 
Fields inherited from interface com.caucho.amber.expr.AmberExpr
IS_INNER_JOIN, USES_DATA
 
Constructor Summary
ElementCollectionExpr(QueryParser parser, PathExpr parent, LinkColumns linkColumns, ElementType targetType)
          Creates a new expression to the child objects.
 
Method Summary
 AmberExpr bindSelect(QueryParser parser)
          Binds the expression as a select item.
 PathExpr bindSelect(QueryParser parser, java.lang.String id)
          Binds the expression as a select item.
 FromItem bindSubPath(QueryParser parser)
          Binds the expression as a subpath.
 IdExpr createId(FromItem fromItem)
          Creates an id expression.
 boolean equals(java.lang.Object o)
           
 void generateHaving(CharBuffer cb)
          Generates the having expression.
 void generateSelect(CharBuffer cb)
          Generates the where expression.
 void generateUpdateWhere(CharBuffer cb)
          Generates the (update) where expression.
 void generateWhere(CharBuffer cb)
          Generates the where expression.
 FromItem getChildFromItem()
          Returns the child from item.
 LinkColumns getLinkColumns()
          Returns the link columns.
 PathExpr getParent()
          Returns the parent.
 AmberTable getTable()
          Returns the table.
 AmberBeanType getTargetType()
          Returns the expr type.
 AmberType getType()
          Returns the expr type.
 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.AbstractPathExpr
createArray, createField, createLoad
 
Methods inherited from class com.caucho.amber.expr.AbstractAmberExpr
createBoolean, exists, exists, findItem, generateJoin, getCacheObject, getColumnCount, getObject, hasRelationship, isBoolean, replaceJoin, setInternalArgType, usesFrom
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.amber.expr.AmberExpr
createBoolean, exists, exists, findItem, generateJoin, getCacheObject, getObject, hasRelationship, isBoolean, replaceJoin, setInternalArgType, usesFrom
 

Constructor Detail

ElementCollectionExpr

public ElementCollectionExpr(QueryParser parser,
                             PathExpr parent,
                             LinkColumns linkColumns,
                             ElementType targetType)
Creates a new expression to the child objects.

Method Detail

getLinkColumns

public LinkColumns getLinkColumns()
Returns the link columns.


getType

public AmberType getType()
Returns the expr type.

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

createId

public IdExpr createId(FromItem fromItem)
Creates an id expression.

Specified by:
createId in interface PathExpr
Overrides:
createId in class AbstractPathExpr

getTargetType

public AmberBeanType getTargetType()
Returns the expr type.


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

getParent

public PathExpr getParent()
Returns the parent.


bindSelect

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

Specified by:
bindSelect in interface AmberExpr
Specified by:
bindSelect in class AbstractAmberExpr

bindSelect

public PathExpr bindSelect(QueryParser parser,
                           java.lang.String id)
Binds the expression as a select item.

Specified by:
bindSelect in interface PathExpr
Overrides:
bindSelect in class AbstractPathExpr

getChildFromItem

public FromItem getChildFromItem()
Returns the child from item.

Specified by:
getChildFromItem in interface PathExpr
Overrides:
getChildFromItem in class AbstractPathExpr

bindSubPath

public FromItem bindSubPath(QueryParser parser)
Binds the expression as a subpath.

Specified by:
bindSubPath in interface PathExpr
Overrides:
bindSubPath in class AbstractPathExpr

getTable

public AmberTable getTable()
Returns the table.


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

generateSelect

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

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

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

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