org.norther.tammi.root.db.query
Interface DBQuery

All Known Implementing Classes:
DBQueryAdapter, HibernateQuery, OJBQuery, XMLQueryCriteria

public interface DBQuery

An interface to classes representing a database query.

Author:
Ilkka Priha

Method Summary
 Object getAdaptee()
          Gets the implementation specific query adaptee, if any.
 DBCriteria getCriteria()
          Gets the criteria of the query, if any.
 int getLimit()
          Gets the number of rows to query.
 int getOffset()
          Gets the first row to query.
 DBQuery orderBy(String attribute, boolean desc)
          Orders the query.
 DBQuery setLimit(int count)
          Sets the number of rows to query.
 DBQuery setOffset(int offset)
          Sets the first row to query.
 

Method Detail

getAdaptee

Object getAdaptee()
Gets the implementation specific query adaptee, if any.

Returns:
the adaptee or null.

getOffset

int getOffset()
Gets the first row to query.

Returns:
the row index.

setOffset

DBQuery setOffset(int offset)
Sets the first row to query.

Parameters:
offset - the row index.
Returns:
the modified query.

getLimit

int getLimit()
Gets the number of rows to query.

Returns:
the row count (-1 = all).

setLimit

DBQuery setLimit(int count)
Sets the number of rows to query.

Parameters:
count - the row count (-1 = all).
Returns:
the modified query.

orderBy

DBQuery orderBy(String attribute,
                boolean desc)
Orders the query.

Parameters:
attribute - the sort attribute.
desc - true for descending.
Returns:
the modified query.

getCriteria

DBCriteria getCriteria()
Gets the criteria of the query, if any.

Returns:
the criteria or null.


Copyright © 2004 The Norther Organization. All rights reserved.