public void deleteOlderThanDate(Date date, boolean flag) {
   date = o.a(date);
   QueryBuilder querybuilder = getEntityDao().queryBuilder();
   WhereCondition wherecondition = WaterLogEntryDao.Properties.LogDate.lt(date);
   if (flag) {
     date =
         WaterLogEntryDao.Properties.EntityStatus.eq(
             Integer.valueOf(com.fitbit.data.domain.Entity.EntityStatus.SYNCED.getCode()));
   } else {
     date = null;
   }
   (new DeleteQueryExt(
           querybuilder.where(wherecondition, new WhereCondition[] {date}).buildDelete()))
       .executeDeleteAndClearCache();
 }
 public void deleteByDate(Date date, boolean flag) {
   Object obj = o.a(date);
   date = o.e(date);
   QueryBuilder querybuilder = getEntityDao().queryBuilder();
   obj = WaterLogEntryDao.Properties.LogDate.between(obj, date);
   if (flag) {
     date =
         WaterLogEntryDao.Properties.EntityStatus.eq(
             Integer.valueOf(com.fitbit.data.domain.Entity.EntityStatus.SYNCED.getCode()));
   } else {
     date = null;
   }
   (new DeleteQueryExt(
           querybuilder
               .where(((WhereCondition) (obj)), new WhereCondition[] {date})
               .buildDelete()))
       .executeDeleteAndClearCache();
 }