1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-26 01:43:59 +02:00

Limit what data the provider exposes

Also rename id to _ID as that is what the documentation recommends
(required to use a Cursor with a ListView).
This commit is contained in:
Erik Johansson
2018-09-22 22:29:01 +02:00
parent a33b671510
commit 0cc9d0fd2b
2 changed files with 2 additions and 2 deletions

View File

@@ -67,6 +67,6 @@ public interface ScaleMeasurementDAO {
void deleteAll(int userId);
// selectAll() is equivalent to getAll(), but returns a Cursor, for exposing via a ContentProvider.
@Query("SELECT * FROM scaleMeasurements WHERE userId = :userId AND enabled = 1 ORDER BY datetime DESC")
@Query("SELECT id as _ID, datetime, weight, fat, water, muscle FROM scaleMeasurements WHERE userId = :userId AND enabled = 1 ORDER BY datetime DESC")
Cursor selectAll(int userId);
}

View File

@@ -49,7 +49,7 @@ public interface ScaleUserDAO {
// selectAll() and select() are equivalent to getall() and get(), but return a Cursor,
// for exposing via a ContentProvider.
@Query("SELECT * FROM scaleUsers")
@Query("SELECT id as _ID, username, birthday, bodyHeight, gender, activityLevel FROM scaleUsers")
Cursor selectAll();
@Query("SELECT * FROM scaleUsers WHERE id = :id")