java.lang.Object
org.strassburger.subscriptionmanager.model.repositories.ProfileRepository

public class ProfileRepository extends Object
  • Constructor Details

    • ProfileRepository

      public ProfileRepository(org.jooq.DSLContext dsl)
  • Method Details

    • getProfiles

      public List<Profile> getProfiles()
      Get a list of all profiles.
      Returns:
      A list of all profiles.
    • getProfile

      public Optional<Profile> getProfile(String username)
      Get a profile by its username.
      Parameters:
      username - The username of the profile.
      Returns:
      The profile with the given username or null if no profile with the given username exists.
    • getProfile

      public Optional<Profile> getProfile(int id)
      Get a profile by its id.
      Parameters:
      id - The id of the profile.
      Returns:
      The profile with the given id or null if no profile with the given id exists.
    • createProfile

      public boolean createProfile(String username)
      Create a new profile.
      Parameters:
      username - The username of the profile.
      Returns:
      True if the profile was created successfully, false otherwise.
    • createProfile

      public boolean createProfile(String username, String pin)
      Create a new profile.
      Parameters:
      username - The username of the profile.
      pin - The pin of the profile.
      Returns:
      True if the profile was created successfully, false otherwise.
    • updateProfileName

      public boolean updateProfileName(int id, String newName)
      Update the name of a profile.
      Parameters:
      id - The id of the profile.
      newName - The new name of the profile.
      Returns:
      True if the profile was updated successfully, false otherwise.
    • deleteProfile

      public boolean deleteProfile(String username)
      Delete a profile by its username.
      Parameters:
      username - The username of the profile.
      Returns:
      True if the profile was deleted successfully, false otherwise.