public int countBy(String condition) {
return countBySQL("SELECT COUNT(*) AS count FROM " + mTableName + " WHERE " + condition);
}
public int countBySQL(String sql) {
Record rm = findFirst(sql);
String count = (String) (rm.values().toArray()[0]);
return Integer.parseInt(count);
}