Class ProfileRepository
java.lang.Object
org.strassburger.subscriptionmanager.model.repositories.ProfileRepository
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancreateProfile(String username) Create a new profile.booleancreateProfile(String username, String pin) Create a new profile.booleandeleteProfile(String username) Delete a profile by its username.getProfile(int id) Get a profile by its id.getProfile(String username) Get a profile by its username.Get a list of all profiles.booleanupdateProfileName(int id, String newName) Update the name of a profile.
-
Constructor Details
-
ProfileRepository
public ProfileRepository(org.jooq.DSLContext dsl)
-
-
Method Details
-
getProfiles
Get a list of all profiles.- Returns:
- A list of all profiles.
-
getProfile
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
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
Create a new profile.- Parameters:
username- The username of the profile.- Returns:
- True if the profile was created successfully, false otherwise.
-
createProfile
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
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
Delete a profile by its username.- Parameters:
username- The username of the profile.- Returns:
- True if the profile was deleted successfully, false otherwise.
-