Merge pull request #2617 from Philoul/DatabaseHelper_Missing_Function
Add missing function in DatabaseHelper
This commit is contained in:
commit
948bb8dc33
1 changed files with 16 additions and 0 deletions
|
@ -1250,6 +1250,22 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
|||
return new ArrayList<ExtendedBolus>();
|
||||
}
|
||||
|
||||
public List<ExtendedBolus> getExtendedBolusDataFromTime(long from, long to, boolean ascending) {
|
||||
try {
|
||||
List<ExtendedBolus> extendedBoluses;
|
||||
QueryBuilder<ExtendedBolus, Long> queryBuilder = getDaoExtendedBolus().queryBuilder();
|
||||
queryBuilder.orderBy("date", ascending);
|
||||
Where where = queryBuilder.where();
|
||||
where.between("date", from, to);
|
||||
PreparedQuery<ExtendedBolus> preparedQuery = queryBuilder.prepare();
|
||||
extendedBoluses = getDaoExtendedBolus().query(preparedQuery);
|
||||
return extendedBoluses;
|
||||
} catch (SQLException e) {
|
||||
log.error("Unhandled exception", e);
|
||||
}
|
||||
return new ArrayList<ExtendedBolus>();
|
||||
}
|
||||
|
||||
public void deleteExtendedBolusById(String _id) {
|
||||
ExtendedBolus stored = findExtendedBolusById(_id);
|
||||
if (stored != null) {
|
||||
|
|
Loading…
Reference in a new issue