/** * Return object with primary key 'key' or null * * @param userId primary key of object user * @return object with primary key 'key' or null * @throws ServiceException */ @Override public Role getRoleById(Long userId) throws ServiceException { Role role; try { role = roleDao.getById(userId); } catch (DaoException e) { throw new ServiceException(e); } return role; }