|
||||||||||
| 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.FilterItem
public class FilterItem
Represents a filter in a query that resides either within a WHERE clause or a HAVING clause
FilterClause,
OperatorType,
LogicalOperator,
Serialized Form| Constructor Summary | |
|---|---|
FilterItem(FilterItem... items)
Creates a compound filter item based on other filter items. |
|
FilterItem(List<FilterItem> items)
Creates a composite filter item based on other filter items. |
|
FilterItem(LogicalOperator logicalOperator,
FilterItem... items)
Creates a compound filter item based on other filter items. |
|
FilterItem(LogicalOperator logicalOperator,
List<FilterItem> items)
Creates a compound filter item based on other filter items. |
|
FilterItem(SelectItem selectItem,
OperatorType operator,
Object operand)
Creates a single filter item based on a SelectItem, an operator and an operand. |
|
FilterItem(String expression)
Creates a single unvalidated filter item based on a expression. |
|
| Method Summary | |
|---|---|
boolean |
accept(Row row)
Filters a row |
static Object |
appendOperator(StringBuilder sb,
Object operand,
OperatorType operator)
|
protected FilterItem |
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 |
evaluate(Row row)
Does a "manual" evaluation, useful for CSV data and alike, where queries cannot be created. |
int |
getChildItemCount()
Get the number of child items, if this is a compound filter item. |
FilterItem[] |
getChildItems()
Gets the FilterItems that this filter item consists of, if it is
a compound filter item. |
String |
getExpression()
|
LogicalOperator |
getLogicalOperator()
|
Object |
getOperand()
|
OperatorType |
getOperator()
|
int |
getOrItemCount()
Deprecated. use getChildItemCount() instead. |
FilterItem[] |
getOrItems()
Deprecated. use getChildItems() instead |
Query |
getQuery()
|
SelectItem |
getSelectItem()
|
boolean |
isCompoundFilter()
Determines whether this FilterItem is a compound filter or not
(ie. if it has child items or not) |
boolean |
isReferenced(Column column)
|
FilterItem |
setQuery(Query query)
|
String |
toSql()
|
String |
toSql(boolean includeSchemaInColumnPaths)
Parses the constraint as a SQL Where-clause item |
String |
toString()
|
| 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 FilterItem(SelectItem selectItem,
OperatorType operator,
Object operand)
throws IllegalArgumentException
selectItem - the selectItem to put constraints on, cannot be nulloperator - The operator to use. Can be OperatorType.EQUALS_TO,
OperatorType.DIFFERENT_FROM,
OperatorType.GREATER_THAN,OperatorType.LESS_THANoperand - The operand. Can be a constant like null or a String, a
Number, a Boolean, a Date, a Time, a DateTime. Or another
SelectItem
IllegalArgumentException - if the SelectItem is null or if the combination of operator
and operand does not make sense.public FilterItem(String expression)
expression - An expression to use for the filter, for example
"YEAR(my_date) = 2008".public FilterItem(List<FilterItem> items)
items - a list of items to include in the composite
public FilterItem(LogicalOperator logicalOperator,
List<FilterItem> items)
LogicalOperator.
logicalOperator - the logical operator to applyitems - a list of items to include in the composite
public FilterItem(LogicalOperator logicalOperator,
FilterItem... items)
LogicalOperator.
logicalOperator - the logical operator to applyitems - an array of items to include in the compositepublic FilterItem(FilterItem... items)
items - an array of items to include in the composite| Method Detail |
|---|
public SelectItem getSelectItem()
public OperatorType getOperator()
public Object getOperand()
public String getExpression()
public Query getQuery()
getQuery in interface QueryItempublic LogicalOperator getLogicalOperator()
public FilterItem setQuery(Query query)
setQuery in interface QueryItempublic String toSql()
toSql in interface QueryItempublic String toSql(boolean includeSchemaInColumnPaths)
toSql in interface QueryItem
public static Object appendOperator(StringBuilder sb,
Object operand,
OperatorType operator)
public boolean evaluate(Row row)
protected FilterItem clone()
clone in class Objectpublic boolean isReferenced(Column column)
protected void decorateIdentity(List<Object> identifiers)
BaseObject
decorateIdentity in class BaseObject@Deprecated public FilterItem[] getOrItems()
getChildItems() instead
FilterItems that this filter item consists of, if it is
a compound filter item.
@Deprecated public int getOrItemCount()
getChildItemCount() instead.
public int getChildItemCount()
public FilterItem[] getChildItems()
FilterItems that this filter item consists of, if it is
a compound filter item.
public boolean isCompoundFilter()
FilterItem is a compound filter or not
(ie. if it has child items or not)
public String toString()
toString in interface QueryItemtoString in class BaseObjectpublic boolean accept(Row row)
IRowFilter
accept in interface IRowFilter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||