public interface RoleRepository
Role and its basic methods| Modifier and Type | Field and Description |
|---|---|
static int |
FULL_NAME_MAX_LENGTH
Full name may have at most 50 characters
|
static int |
SHORT_NAME_LENGTH
Each Short Name identifier has exactly this length
|
| Modifier and Type | Method and Description |
|---|---|
Role |
findByShortName(String shortName)
Find and return Role object with given short name (case insensitive).
|
Set<User> |
getUsers(Role role)
Return all users that share given Role, or an empty Set if no such users.
|
static boolean |
isValidShortName(String shortName)
This method provides quick pre-check for given Short Name
without looking in DB for existing names.
|
static final int SHORT_NAME_LENGTH
static final int FULL_NAME_MAX_LENGTH
static boolean isValidShortName(String shortName)
shortName - a Short name to checkRole findByShortName(String shortName)
shortName - Special acronymAccessDataBaseException - for DB issuesEntityDoesNotExistException - if Role with given
name was not foundSet<User> getUsers(Role role)
role - Users with what role need to be foundIllegalArgumentException - if argument is nullEntityDoesNotExistException - if Role with given
name was not foundAccessDataBaseException - for DB issues