Class ProfileRepository
java.lang.Object
com.serinity.accesscontrol.repository.base.BaseRepository<Profile,Long>
com.serinity.accesscontrol.repository.ProfileRepository
Repository class for performing CRUD operations on
Profile entities.- Since:
- 2026-02-03
- Version:
- 1.0
- Author:
- @ZouariOmar (zouariomar20@gmail.com)
- See Also:
-
Field Summary
Fields inherited from class BaseRepository
em, entityClass -
Constructor Summary
ConstructorsConstructorDescriptionProfileRepository(org.zouarioss.skinnedratorm.core.EntityManager em) Creates a repository instance for profiles. -
Method Summary
Modifier and TypeMethodDescriptionfindByUserId(UUID userId) Finds the profile associated with a given user.findByUsername(String username) Finds a profile by its unique generated username.Methods inherited from class BaseRepository
delete, deleteById, findAll, findById, save, update
-
Constructor Details
-
ProfileRepository
public ProfileRepository(org.zouarioss.skinnedratorm.core.EntityManager em) Creates a repository instance for profiles.- Parameters:
em- entity manager used for persistence operations
-
-
Method Details
-
findByUsername
Finds a profile by its unique generated username.- Parameters:
username- the auto-generated username- Returns:
- the matching
Profile - Throws:
RuntimeException- if the profile is not found or a DB error occurs
-
findByUserId
Finds the profile associated with a given user.- Parameters:
userId- the UUID of the ownerUser- Returns:
- the matching
Profile - Throws:
RuntimeException- if the profile is not found or a DB error occurs
-