|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eobjects.metamodel.util.BaseObject
org.eobjects.metamodel.query.SelectItem
public class SelectItem
Represents a SELECT item. SelectItems can take different forms:
SelectClause,
Serialized Form| Constructor Summary | |
|---|---|
SelectItem(Column column)
Creates a simple SelectItem that selects from a column |
|
SelectItem(Column column,
FromItem fromItem)
Creates a SelectItem that references a column from a particular FromItem, for example a.price or p.age |
|
SelectItem(FunctionType function,
Column column)
Creates a SelectItem that uses a function on a column, for example SUM(price) or MAX(age) |
|
SelectItem(FunctionType function,
Column column,
FromItem fromItem)
Creates a SelectItem that uses a function on a column from a particular FromItem, for example SUM(a.price) or MAX(p.age) |
|
SelectItem(FunctionType function,
String expression,
String alias)
Creates a SelectItem based on a function and an expression. |
|
SelectItem(SelectItem subQuerySelectItem,
FromItem subQueryFromItem)
Creates a SelectItem that references another select item in a subquery |
|
SelectItem(String expression,
String alias)
Creates a SelectItem based on an expression. |
|
| Method Summary | |
|---|---|
protected SelectItem |
clone()
|
protected void |
decorateIdentity(List<Object> identifiers)
Subclasses should implement this method and add all fields to the list that are to be included in equals(...) and hashCode() evaluation |
boolean |
equalsIgnoreAlias(SelectItem that)
|
boolean |
equalsIgnoreAlias(SelectItem that,
boolean exactColumnCompare)
|
String |
getAlias()
|
Column |
getColumn()
|
static SelectItem |
getCountAllItem()
Generates a COUNT(*) select item |
ColumnType |
getExpectedColumnType()
Tries to infer the ColumnType of this SelectItem. |
String |
getExpression()
|
FromItem |
getFromItem()
|
FunctionType |
getFunction()
|
Query |
getQuery()
|
String |
getSameQueryAlias()
|
String |
getSameQueryAlias(boolean includeSchemaInColumnPath)
|
FromItem |
getSubQueryFromItem()
Deprecated. use getFromItem() instead |
SelectItem |
getSubQuerySelectItem()
|
String |
getSuperQueryAlias()
|
String |
getSuperQueryAlias(boolean includeQuotes)
|
static boolean |
isCountAllItem(SelectItem item)
|
boolean |
isFunctionApproximationAllowed()
|
boolean |
isReferenced(Column column)
Investigates whether or not this SelectItem references a particular column. |
SelectItem |
replaceFunction(FunctionType function)
Creates a copy of the SelectItem, with a different
FunctionType. |
SelectItem |
setAlias(String alias)
|
void |
setFunctionApproximationAllowed(boolean functionApproximationAllowed)
|
SelectItem |
setQuery(Query query)
|
String |
toSql()
|
String |
toSql(boolean includeSchemaInColumnPath)
|
String |
toString()
|
StringBuilder |
toStringNoAlias()
|
StringBuilder |
toStringNoAlias(boolean includeSchemaInColumnPath)
|
| Methods inherited from class org.eobjects.metamodel.util.BaseObject |
|---|
classEquals, equals, hashCode |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SelectItem(Column column)
column -
public SelectItem(FunctionType function,
Column column)
function - column -
public SelectItem(Column column,
FromItem fromItem)
FromItem, for example a.price or p.age
column - fromItem -
public SelectItem(FunctionType function,
Column column,
FromItem fromItem)
FromItem, for example SUM(a.price) or MAX(p.age)
function - column - fromItem -
public SelectItem(String expression,
String alias)
expression - alias -
public SelectItem(FunctionType function,
String expression,
String alias)
function - expression - alias -
public SelectItem(SelectItem subQuerySelectItem,
FromItem subQueryFromItem)
subQuerySelectItem - subQueryFromItem - the FromItem that holds the sub-query| Method Detail |
|---|
public static SelectItem getCountAllItem()
public static boolean isCountAllItem(SelectItem item)
public String getAlias()
public SelectItem setAlias(String alias)
public FunctionType getFunction()
public boolean isFunctionApproximationAllowed()
public void setFunctionApproximationAllowed(boolean functionApproximationAllowed)
public Column getColumn()
public ColumnType getExpectedColumnType()
ColumnType of this SelectItem. For
expression based select items, this is not possible, and the method will
return null.
public String getExpression()
public SelectItem setQuery(Query query)
setQuery in interface QueryItempublic Query getQuery()
getQuery in interface QueryItempublic SelectItem getSubQuerySelectItem()
@Deprecated public FromItem getSubQueryFromItem()
getFromItem() instead
public FromItem getFromItem()
public String getSuperQueryAlias()
public String getSuperQueryAlias(boolean includeQuotes)
includeQuotes - indicates whether or not the output should include quotes, if
the select item's column has quotes associated (typically
true, but false if used for presentation)
public String getSameQueryAlias()
public String getSameQueryAlias(boolean includeSchemaInColumnPath)
public String toSql()
toSql in interface QueryItempublic String toSql(boolean includeSchemaInColumnPath)
toSql in interface QueryItempublic StringBuilder toStringNoAlias()
public StringBuilder toStringNoAlias(boolean includeSchemaInColumnPath)
public boolean equalsIgnoreAlias(SelectItem that)
public boolean equalsIgnoreAlias(SelectItem that,
boolean exactColumnCompare)
protected void decorateIdentity(List<Object> identifiers)
BaseObject
decorateIdentity in class BaseObjectprotected SelectItem clone()
clone in class Objectpublic SelectItem replaceFunction(FunctionType function)
SelectItem, with a different
FunctionType.
function -
public boolean isReferenced(Column column)
column -
public String toString()
toString in interface QueryItemtoString in class BaseObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||