org.eobjects.metamodel.query
Class AbstractQueryClause<E extends QueryItem>

java.lang.Object
  extended by org.eobjects.metamodel.util.BaseObject
      extended by org.eobjects.metamodel.query.AbstractQueryClause<E>
Type Parameters:
E - the type of query item this QueryClause handles
All Implemented Interfaces:
Serializable, QueryClause<E>
Direct Known Subclasses:
FilterClause, FromClause, GroupByClause, OrderByClause, SelectClause

public abstract class AbstractQueryClause<E extends QueryItem>
extends BaseObject
implements QueryClause<E>

Represents an abstract clause in a query. Clauses contains IQueryItems and provide basic ways of adding, modifying and removing these.

See Also:
Query, Serialized Form

Field Summary
static String DELIM_AND
           
static String DELIM_COMMA
           
static String PREFIX_FROM
           
static String PREFIX_GROUP_BY
           
static String PREFIX_HAVING
           
static String PREFIX_ORDER_BY
           
static String PREFIX_SELECT
           
static String PREFIX_WHERE
           
 
Constructor Summary
AbstractQueryClause(Query query, String prefix, String delim)
           
 
Method Summary
 QueryClause<E> addItem(E item)
           
 QueryClause<E> addItem(int index, E item)
           
 QueryClause<E> addItems(E... items)
           
 QueryClause<E> addItems(Iterable<E> items)
           
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
 E getItem(int index)
           
 int getItemCount()
           
 List<E> getItems()
           
 boolean isEmpty()
           
 QueryClause<E> removeItem(E item)
           
 QueryClause<E> removeItem(int index)
           
 QueryClause<E> removeItems()
           
 QueryClause<E> setItems(E... items)
           
 String toSql()
           
 String toSql(boolean includeSchemaInColumnPaths)
           
 String toString()
           
 
Methods inherited from class org.eobjects.metamodel.util.BaseObject
classEquals, equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PREFIX_SELECT

public static final String PREFIX_SELECT
See Also:
Constant Field Values

PREFIX_FROM

public static final String PREFIX_FROM
See Also:
Constant Field Values

PREFIX_WHERE

public static final String PREFIX_WHERE
See Also:
Constant Field Values

PREFIX_GROUP_BY

public static final String PREFIX_GROUP_BY
See Also:
Constant Field Values

PREFIX_HAVING

public static final String PREFIX_HAVING
See Also:
Constant Field Values

PREFIX_ORDER_BY

public static final String PREFIX_ORDER_BY
See Also:
Constant Field Values

DELIM_COMMA

public static final String DELIM_COMMA
See Also:
Constant Field Values

DELIM_AND

public static final String DELIM_AND
See Also:
Constant Field Values
Constructor Detail

AbstractQueryClause

public AbstractQueryClause(Query query,
                           String prefix,
                           String delim)
Method Detail

setItems

public QueryClause<E> setItems(E... items)
Specified by:
setItems in interface QueryClause<E extends QueryItem>

addItems

public QueryClause<E> addItems(E... items)
Specified by:
addItems in interface QueryClause<E extends QueryItem>

addItems

public QueryClause<E> addItems(Iterable<E> items)
Specified by:
addItems in interface QueryClause<E extends QueryItem>

addItem

public QueryClause<E> addItem(int index,
                              E item)
Specified by:
addItem in interface QueryClause<E extends QueryItem>

addItem

public QueryClause<E> addItem(E item)
Specified by:
addItem in interface QueryClause<E extends QueryItem>

getItemCount

public int getItemCount()
Specified by:
getItemCount in interface QueryClause<E extends QueryItem>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface QueryClause<E extends QueryItem>

getItem

public E getItem(int index)
Specified by:
getItem in interface QueryClause<E extends QueryItem>

getItems

public List<E> getItems()
Specified by:
getItems in interface QueryClause<E extends QueryItem>

removeItem

public QueryClause<E> removeItem(int index)
Specified by:
removeItem in interface QueryClause<E extends QueryItem>

removeItem

public QueryClause<E> removeItem(E item)
Specified by:
removeItem in interface QueryClause<E extends QueryItem>

removeItems

public QueryClause<E> removeItems()
Specified by:
removeItems in interface QueryClause<E extends QueryItem>

toSql

public String toSql()
Specified by:
toSql in interface QueryClause<E extends QueryItem>

toSql

public String toSql(boolean includeSchemaInColumnPaths)
Specified by:
toSql in interface QueryClause<E extends QueryItem>

toString

public String toString()
Overrides:
toString in class BaseObject

decorateIdentity

protected void decorateIdentity(List<Object> identifiers)
Description copied from class: BaseObject
Subclasses should implement this method and add all fields to the list that are to be included in equals(...) and hashCode() evaluation

Specified by:
decorateIdentity in class BaseObject


Copyright © 2007-2013. All Rights Reserved.