Merge pull request #86 from AdrianLxM/dbfix

DB query fix
This commit is contained in:
Milos Kozak 2016-12-07 07:36:44 +01:00 committed by GitHub
commit a3585d93f4

View file

@ -196,8 +196,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
QueryBuilder<BgReading, Long> queryBuilder = daoBgreadings.queryBuilder(); QueryBuilder<BgReading, Long> queryBuilder = daoBgreadings.queryBuilder();
queryBuilder.orderBy("timeIndex", true); queryBuilder.orderBy("timeIndex", true);
Where where = queryBuilder.where(); Where where = queryBuilder.where();
where.ge("timeIndex", mills); where.ge("timeIndex", mills).and().gt("value", 38);
queryBuilder.where().gt("value", 38);
PreparedQuery<BgReading> preparedQuery = queryBuilder.prepare(); PreparedQuery<BgReading> preparedQuery = queryBuilder.prepare();
bgReadings = daoBgreadings.query(preparedQuery); bgReadings = daoBgreadings.query(preparedQuery);
return bgReadings; return bgReadings;