| org.apache.ojb.broker.query.Query
All known Subclasses: org.apache.ojb.broker.query.AbstractQueryImpl,
Query | public interface Query extends java.io.Serializable(Code) | | represents Queries that can be used by the OJB PersistenceBroker
to retrieve Objects from the underlying DB.
Until now there are two implementations:
1. QueryByCriteria, represents SELECT * FROM ... WHERE ... queries
2. QueryByIdentity, uses Example objects or OIDs
as templates for the db lookup
there could additional implementations, e.g for user defined SQL
For the Criteria API I reused code from the COBRA project,
as you will see by their class comments.
I removed all stuff that relies on knowlegde of the DataDictionary
or MetaData layer. The Query and Criteria classes thus don't know
how to build SQL statements, as in the COBRA original sources.
I use the this classes as mere data-structures, that are
processed by the OJB Accesslayer (SqlGenerator, JdbcAccess).
This design will allow to reuse the org.apache.ojb.broker.query package in other
projects without breaking any references. I hope this will be
useful for someone.
author: Thomas Mahler version: $Id: Query.java,v 1.17.2.3 2005/12/21 22:27:09 tomdz Exp $ |
NOT_SCROLLABLE | final public static boolean NOT_SCROLLABLE(Code) | | |
NO_END_AT_INDEX | final public static int NO_END_AT_INDEX(Code) | | |
NO_START_AT_INDEX | final public static int NO_START_AT_INDEX(Code) | | |
SCROLLABLE | final public static boolean SCROLLABLE(Code) | | |
serialVersionUID | final static long serialVersionUID(Code) | | |
fullSize | void fullSize(int size)(Code) | | Parameters: size - |
getBaseClass | abstract public Class getBaseClass()(Code) | | return the base class, with respect to which all paths are done
|
getCriteria | abstract public Criteria getCriteria()(Code) | | return the criteria of the query if present or null.
|
getEndAtIndex | int getEndAtIndex()(Code) | | the row at which the query should stop retrieving results. If the end at index is 0, ignore all cursor control |
getExampleObject | abstract public Object getExampleObject()(Code) | | return the template Object if present or null
|
getFetchSize | int getFetchSize()(Code) | | Returns the fetchSize hint for this Query
the fetch size hint specific to this query(or 0 if not set / using driver default) |
getGroupBy | public List getGroupBy()(Code) | | Gets the groupby for ReportQueries of all Criteria and Sub Criteria
the elements are of class FieldHelper
List of FieldHelper |
getHavingCriteria | abstract public Criteria getHavingCriteria()(Code) | | return the criteria of the query if present or null.
|
getOrderBy | public List getOrderBy()(Code) | | Answer the orderBy of all Criteria and Sub Criteria the elements are of
class FieldHelper
List of FieldHelper |
getPrefetchedRelationships | public List getPrefetchedRelationships()(Code) | | Returns the names of Relationships to be prefetched
List of Strings |
getSearchClass | abstract public Class getSearchClass()(Code) | | return the target class, representing the extend to be searched
|
getStartAtIndex | int getStartAtIndex()(Code) | | the row at which the query should start retrieving results. If the start at index is 0, then ignore all cursor control. |
getWithExtents | boolean getWithExtents()(Code) | | |
isDistinct | public boolean isDistinct()(Code) | | return true if select DISTINCT should be used
|
setEndAtIndex | void setEndAtIndex(int endAtIndex)(Code) | | Set the row at which the query should stop retrieving results, inclusive.
first row is 1
Parameters: endAtIndex - ending index, inclusive |
setFetchSize | void setFetchSize(int fetchSize)(Code) | | Set fetchSize hint for this Query. Passed to the JDBC driver on the
Statement level. It is JDBC driver-dependant if this function has
any effect at all, since fetchSize is only a hint.
Parameters: fetchSize - the fetch size specific to this query |
setStartAtIndex | void setStartAtIndex(int startAtIndex)(Code) | | Set the row at which the query should start retrieving results, inclusive
first row is 1
Parameters: startAtIndex - starting index, inclusive. |
setWithExtents | void setWithExtents(boolean withExtents)(Code) | | |
usePaging | public boolean usePaging()(Code) | | Answer true if start- and endIndex is set
|
|
|