use of com.orm.androrm.statement.SelectStatement in project androrm by androrm.
the class QuerySet method getCount.
private int getCount(SelectStatement query) {
SelectStatement countQuery = new SelectStatement();
countQuery.from(query).count();
Cursor c = getCursor(countQuery);
int count = 0;
if (c.moveToFirst()) {
count = c.getInt(c.getColumnIndexOrThrow(Model.COUNT));
}
closeConnection(c);
return count;
}
Aggregations