Package org.greenrobot.greendao.query
Class CountQuery<T>
- java.lang.Object
-
- org.greenrobot.greendao.query.CountQuery<T>
-
public class CountQuery<T> extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractDao<T,?>daoprotected InternalQueryDaoAccess<T>daoAccessprotected java.lang.ThreadownerThreadprotected java.lang.String[]parametersprotected java.lang.Stringsql
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckThread()longcount()Returns the count (number of results matching the query).CountQuery<T>forCurrentThread()CountQuery<T>setParameter(int index, java.lang.Boolean parameter)CountQuery<T>setParameter(int index, java.lang.Object parameter)Sets the parameter (0 based) using the position in which it was added during building the query.CountQuery<T>setParameter(int index, java.util.Date parameter)protected static java.lang.String[]toStringArray(java.lang.Object[] values)
-
-
-
Field Detail
-
dao
protected final AbstractDao<T,?> dao
-
daoAccess
protected final InternalQueryDaoAccess<T> daoAccess
-
sql
protected final java.lang.String sql
-
parameters
protected final java.lang.String[] parameters
-
ownerThread
protected final java.lang.Thread ownerThread
-
-
Method Detail
-
forCurrentThread
public CountQuery<T> forCurrentThread()
-
count
public long count()
Returns the count (number of results matching the query). Uses SELECT COUNT (*) sematics.
-
setParameter
public CountQuery<T> setParameter(int index, java.lang.Object parameter)
Sets the parameter (0 based) using the position in which it was added during building the query.
-
setParameter
public CountQuery<T> setParameter(int index, java.util.Date parameter)
- See Also:
setParameter(int, Object)
-
setParameter
public CountQuery<T> setParameter(int index, java.lang.Boolean parameter)
- See Also:
setParameter(int, Object)
-
toStringArray
protected static java.lang.String[] toStringArray(java.lang.Object[] values)
-
checkThread
protected void checkThread()
-
-