Class UserRepository

java.lang.Object
com.example.skeddly.business.database.repository.GenericRepository<User>
com.example.skeddly.business.database.repository.UserRepository

public class UserRepository extends GenericRepository<User>
A class to handle retrieving users from Firestore.
  • Field Details

  • Constructor Details

    • UserRepository

      public UserRepository(com.google.firebase.firestore.FirebaseFirestore firestore)
      Create a new UserRepository.
      Parameters:
      firestore - The FirebaseFirestore instance to use.
    • UserRepository

      public UserRepository(com.google.firebase.firestore.FirebaseFirestore firestore, UserLevel level)
      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: GenericRepository
      This method retrieves the reference to the collection of documents it handles
      Specified by:
      getCollectionPath in class GenericRepository<User>
      Returns:
      A CollectionReference to the collection of documents it handles.
    • getQuery

      protected com.google.firebase.firestore.Query getQuery()
      Description copied from class: GenericRepository
      This 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:
      getQuery in class GenericRepository<User>
      Returns:
      A query that can retrieve multiple documents.