Ejemplo n.º 1
0
 @Transactional(readOnly = true)
 public User getUserWithAuthorities() {
   User user = userRepository.findOneByLogin(SecurityUtils.getCurrentUser().getUsername()).get();
   user.getAuthorities().size(); // eagerly load the association
   return user;
 }
Ejemplo n.º 2
0
 @Transactional(readOnly = true)
 public User getUserWithAuthorities(Long id) {
   User user = userRepository.findOne(id);
   user.getAuthorities().size(); // eagerly load the association
   return user;
 }