Class UserRepository
java.lang.Object
com.example.skeddly.business.database.repository.GenericRepository<User>
com.example.skeddly.business.database.repository.UserRepository
A class to handle retrieving users from Firestore.
-
Field Summary
FieldsFields inherited from class com.example.skeddly.business.database.repository.GenericRepository
clazz -
Constructor Summary
ConstructorsConstructorDescriptionUserRepository(com.google.firebase.firestore.FirebaseFirestore firestore) Create a new UserRepository.UserRepository(com.google.firebase.firestore.FirebaseFirestore firestore, UserLevel level) Create a new UserRepository that filters by a specific user privilege level. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.google.firebase.firestore.CollectionReferenceThis method retrieves the reference to the collection of documents it handlesprotected com.google.firebase.firestore.QuerygetQuery()This method retrieves a query for getting all the documents handled by this repository.Methods inherited from class com.example.skeddly.business.database.repository.GenericRepository
count, delete, get, getAll, getAllByQuery, listen, listenAll, set
-
Field Details
-
COLLECTION_PATH
- See Also:
-
-
Constructor Details
-
UserRepository
public UserRepository(com.google.firebase.firestore.FirebaseFirestore firestore) Create a new UserRepository.- Parameters:
firestore- The FirebaseFirestore instance to use.
-
UserRepository
Create a new UserRepository that filters by a specific user privilege level.- Parameters:
firestore- The FirebaseFirestore instance to use.level- The privilege level to filter by.
-
-
Method Details
-
getCollectionPath
protected com.google.firebase.firestore.CollectionReference getCollectionPath()Description copied from class:GenericRepositoryThis method retrieves the reference to the collection of documents it handles- Specified by:
getCollectionPathin classGenericRepository<User>- Returns:
- A CollectionReference to the collection of documents it handles.
-
getQuery
protected com.google.firebase.firestore.Query getQuery()Description copied from class:GenericRepositoryThis method retrieves a query for getting all the documents handled by this repository. This is commonly overridden in repositories that filter out documents by fields.- Overrides:
getQueryin classGenericRepository<User>- Returns:
- A query that can retrieve multiple documents.
-