org.apache.ojb.broker.query
Class AbstractQueryImpl

java.lang.Object
  extended by org.apache.ojb.broker.query.AbstractQueryImpl
All Implemented Interfaces:
java.io.Serializable, Query
Direct Known Subclasses:
QueryByCriteria, QueryByIdentity, QueryBySQL

public abstract class AbstractQueryImpl
extends java.lang.Object
implements Query, java.io.Serializable

Abstract implemenation of Query interface

Version:
$Id: AbstractQueryImpl.java 365232 2005-12-21 22:36:07Z tomdz $
Author:
???
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.ojb.broker.query.Query
NO_END_AT_INDEX, NO_START_AT_INDEX, NOT_SCROLLABLE, SCROLLABLE
 
Constructor Summary
AbstractQueryImpl()
           
AbstractQueryImpl(java.lang.Class aSearchClass)
           
 
Method Summary
 int fullSize()
           
 void fullSize(int size)
           
 java.lang.Class getBaseClass()
          return the base class, with respect to which all paths are done
 Criteria getCriteria()
          return the criteria of the query if present or null.
 int getEndAtIndex()
           
 java.lang.Object getExampleObject()
          return the template Object if present or null
 int getFetchSize()
          Returns the fetchSize hint for this Query
 java.util.List getGroupBy()
          Gets the groupby for ReportQueries of all Criteria and Sub Criteria the elements are of class FieldHelper
 Criteria getHavingCriteria()
          return the criteria of the query if present or null.
 java.util.List getOrderBy()
          Answer the orderBy of all Criteria and Sub Criteria the elements are of class FieldHelper
 java.util.List getPrefetchedRelationships()
          Returns the names of Relationships to be prefetched
 java.lang.Class getSearchClass()
          return the target class, representing the extend to be searched
 int getStartAtIndex()
           
 boolean getWithExtents()
           
 boolean isDistinct()
          return true if select DISTINCT should be used
 void setEndAtIndex(int endAtIndex)
          Set the row at which the query should stop retrieving results, inclusive.
 void setFetchSize(int fetchSize)
          Set fetchSize hint for this Query.
 void setStartAtIndex(int startAtIndex)
          Set the row at which the query should start retrieving results, inclusive first row is 1
 void setWithExtents(boolean withExtents)
           
 boolean usePaging()
          Answer true if start- and endIndex is set
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractQueryImpl

public AbstractQueryImpl()

AbstractQueryImpl

public AbstractQueryImpl(java.lang.Class aSearchClass)
Method Detail

getStartAtIndex

public int getStartAtIndex()
Specified by:
getStartAtIndex in interface Query
Returns:
the row at which the query should start retrieving results. If the start at index is 0, then ignore all cursor control.

setStartAtIndex

public void setStartAtIndex(int startAtIndex)
Description copied from interface: Query
Set the row at which the query should start retrieving results, inclusive first row is 1

Specified by:
setStartAtIndex in interface Query
Parameters:
startAtIndex - starting index, inclusive.

getEndAtIndex

public int getEndAtIndex()
Specified by:
getEndAtIndex in interface Query
Returns:
the row at which the query should stop retrieving results. If the end at index is 0, ignore all cursor control

setEndAtIndex

public void setEndAtIndex(int endAtIndex)
Description copied from interface: Query
Set the row at which the query should stop retrieving results, inclusive. first row is 1

Specified by:
setEndAtIndex in interface Query
Parameters:
endAtIndex - ending index, inclusive

fullSize

public void fullSize(int size)
Specified by:
fullSize in interface Query

fullSize

public int fullSize()
Specified by:
fullSize in interface Query
Returns:

setWithExtents

public void setWithExtents(boolean withExtents)
Specified by:
setWithExtents in interface Query

getWithExtents

public boolean getWithExtents()
Specified by:
getWithExtents in interface Query

getSearchClass

public java.lang.Class getSearchClass()
Description copied from interface: Query
return the target class, representing the extend to be searched

Specified by:
getSearchClass in interface Query

getBaseClass

public java.lang.Class getBaseClass()
Description copied from interface: Query
return the base class, with respect to which all paths are done

Specified by:
getBaseClass in interface Query

getGroupBy

public java.util.List getGroupBy()
Description copied from interface: Query
Gets the groupby for ReportQueries of all Criteria and Sub Criteria the elements are of class FieldHelper

Specified by:
getGroupBy in interface Query
Returns:
List of FieldHelper

getOrderBy

public java.util.List getOrderBy()
Description copied from interface: Query
Answer the orderBy of all Criteria and Sub Criteria the elements are of class FieldHelper

Specified by:
getOrderBy in interface Query
Returns:
List of FieldHelper

getPrefetchedRelationships

public java.util.List getPrefetchedRelationships()
Description copied from interface: Query
Returns the names of Relationships to be prefetched

Specified by:
getPrefetchedRelationships in interface Query
Returns:
List of Strings

getCriteria

public Criteria getCriteria()
Description copied from interface: Query
return the criteria of the query if present or null.

Specified by:
getCriteria in interface Query

getExampleObject

public java.lang.Object getExampleObject()
Description copied from interface: Query
return the template Object if present or null

Specified by:
getExampleObject in interface Query

getHavingCriteria

public Criteria getHavingCriteria()
Description copied from interface: Query
return the criteria of the query if present or null.

Specified by:
getHavingCriteria in interface Query

isDistinct

public boolean isDistinct()
Description copied from interface: Query
return true if select DISTINCT should be used

Specified by:
isDistinct in interface Query

usePaging

public boolean usePaging()
Description copied from interface: Query
Answer true if start- and endIndex is set

Specified by:
usePaging in interface Query
Returns:

setFetchSize

public void setFetchSize(int fetchSize)
Description copied from interface: Query
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.

Specified by:
setFetchSize in interface Query
Parameters:
fetchSize - the fetch size specific to this query

getFetchSize

public int getFetchSize()
Description copied from interface: Query
Returns the fetchSize hint for this Query

Specified by:
getFetchSize in interface Query
Returns:
the fetch size hint specific to this query (or 0 if not set / using driver default)


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30