org.norther.tammi.root.ojb.query
Class OJBQuery

java.lang.Object
  extended by org.norther.tammi.root.db.query.DBQueryAdapter
      extended by org.norther.tammi.root.ojb.query.OJBQuery
All Implemented Interfaces:
Serializable, DBQuery

public class OJBQuery
extends DBQueryAdapter
implements Serializable

An OJB query adapter.

Author:
Ilkka Priha
See Also:
Serialized Form

Constructor Summary
OJBQuery(Query adapt)
          Constructs a new query with an adaptee.
 
Method Summary
 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.
 
Methods inherited from class org.norther.tammi.root.db.query.DBQueryAdapter
getAdaptee, setAdaptee
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OJBQuery

public OJBQuery(Query adapt)
Constructs a new query with an adaptee.

Parameters:
adapt - the query adaptee.
Method Detail

getOffset

public int getOffset()
Description copied from interface: DBQuery
Gets the first row to query.

Specified by:
getOffset in interface DBQuery
Returns:
the row index.

setOffset

public DBQuery setOffset(int offset)
Description copied from interface: DBQuery
Sets the first row to query.

Specified by:
setOffset in interface DBQuery
Parameters:
offset - the row index.
Returns:
the modified query.

getLimit

public int getLimit()
Description copied from interface: DBQuery
Gets the number of rows to query.

Specified by:
getLimit in interface DBQuery
Returns:
the row count (-1 = all).

setLimit

public DBQuery setLimit(int count)
Description copied from interface: DBQuery
Sets the number of rows to query.

Specified by:
setLimit in interface DBQuery
Parameters:
count - the row count (-1 = all).
Returns:
the modified query.

orderBy

public DBQuery orderBy(String attribute,
                       boolean desc)
Description copied from interface: DBQuery
Orders the query.

Specified by:
orderBy in interface DBQuery
Parameters:
attribute - the sort attribute.
desc - true for descending.
Returns:
the modified query.

getCriteria

public DBCriteria getCriteria()
Description copied from interface: DBQuery
Gets the criteria of the query, if any.

Specified by:
getCriteria in interface DBQuery
Returns:
the criteria or null.


Copyright © 2004 The Norther Organization. All rights reserved.