@Repository @Transactional(readOnly=true) public class RoleRepositoryJDBC extends Object implements RoleRepository
RoleRepository specification.
Single statement SQL queries are used
Offers simple caching solution as for now we have
only three predefined roles and no mutators.
So, avoiding unnecessary DB querying.
FULL_NAME_MAX_LENGTH, SHORT_NAME_LENGTH| Constructor and Description |
|---|
RoleRepositoryJDBC(DataSource dataSource) |
| 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.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisValidShortName@Autowired public RoleRepositoryJDBC(DataSource dataSource)
public Role findByShortName(String shortName)
RoleRepositoryfindByShortName in interface RoleRepositoryshortName - Special acronympublic Set<User> getUsers(Role role)
RoleRepositorygetUsers in interface RoleRepositoryrole - Users with what role need to be found