|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.root.db.query.DBQueryAdapter<T,Query>
org.norther.tammi.root.ojb.query.OJBQuery<T>
T - the query type.public class OJBQuery<T>
An OJB query adapter.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.root.db.query.DBQueryAdapter |
|---|
factory |
| Constructor Summary | |
|---|---|
OJBQuery(String alias,
Query query,
MBeanReference<? extends PersisterFactory> pbf)
Constructs a new query with an adaptee. |
|
| Method Summary | |
|---|---|
int |
getLimit()
Gets the number of rows to query. |
int |
getOffset()
Gets the first row to query. |
Class<?> |
getPersistentClass()
Gets the persistent class of the query. |
DBQuery<T> |
orderBy(String attribute,
boolean desc)
Orders the query. |
DBQuery<T> |
setLimit(int count)
Sets the number of rows to query. |
DBQuery<T> |
setOffset(int offset)
Sets the first row to query. |
DBQuery<T> |
setParameter(String name,
Object value)
Sets a query parameter. |
DBQuery<T> |
setParameters(Map<String,?> params)
Sets the parameters of the query. |
| Methods inherited from class org.norther.tammi.root.db.query.DBQueryAdapter |
|---|
getConnectionAlias, getPersisterFactory, getQuery, setQuery |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OJBQuery(String alias,
Query query,
MBeanReference<? extends PersisterFactory> pbf)
alias - the connection alias.query - the query adaptee.pbf - the persister factory.
NullPointerException - for nulls.| Method Detail |
|---|
public Class<?> getPersistentClass()
DBQuery
getPersistentClass in interface DBQuery<T>public int getOffset()
DBQuery
getOffset in interface DBQuery<T>public DBQuery<T> setOffset(int offset)
DBQuery
setOffset in interface DBQuery<T>offset - the row index.
public int getLimit()
DBQuery
getLimit in interface DBQuery<T>public DBQuery<T> setLimit(int count)
DBQuery
setLimit in interface DBQuery<T>count - the row count (-1 = all).
public DBQuery<T> setParameter(String name,
Object value)
DBQuery
setParameter in interface DBQuery<T>name - the parameter name.value - the parameter value.
public DBQuery<T> setParameters(Map<String,?> params)
DBQuery
setParameters in interface DBQuery<T>params - a map of parameters.
public DBQuery<T> orderBy(String attribute,
boolean desc)
DBQuery
orderBy in interface DBQuery<T>attribute - the sort attribute.desc - true for descending.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||