@Test public void findRolesByUsername() { final List<Roles> list = usersJdbcRepository.findRolesByUsername("abcd"); assertTrue(list.isEmpty()); }
@Override public List<Roles> findRolesByUsername(String username) { final String roleSql = " select r.* from roles r, user_roles ur, users u where u.archived = false " + " and u.id = ur.users_id and ur.roles_id = r.id and u.username = ? "; final List<Roles> rolesList = jdbcTemplate.query(roleSql, rolesRowMapper, username); for (Roles roles : rolesList) { loadRolesPermissions(roles); } return rolesList; }
UsersJdbcRepository extends AbstractJdbcRepository implements UsersRepository { @Override public List<Roles> findRolesByUsername(String username) { final String roleSql = " select r.* from roles r, user_roles ur, users u where u.archived = false " + " and u.id = ur.users_id and ur.roles_id = r.id and u.username = ? "; final List<Roles> rolesList = jdbcTemplate.query(roleSql, rolesRowMapper, username); for (Roles roles : rolesList) { loadRolesPermissions(roles); } return rolesList; } }
UsersJdbcRepository extends AbstractJdbcRepository implements UsersRepository { @Override public List<Roles> findRolesByUsername(String username) { final String roleSql = " select r.* from roles r, user_roles ur, users u where u.archived = false " + " and u.id = ur.users_id and ur.roles_id = r.id and u.username = ? "; final List<Roles> rolesList = jdbcTemplate.query(roleSql, rolesRowMapper, username); for (Roles roles : rolesList) { loadRolesPermissions(roles); } return rolesList; }  }
UsersJdbcRepository extends AbstractJdbcRepository implements UsersRepository { @Override public List<Roles> findRolesByUsername(String username) { final String roleSql = " select r.* from roles r, user_roles ur, users u where u.archived = false " + " and u.id = ur.users_id and ur.roles_id = r.id and u.username = ? "; final List<Roles> rolesList = jdbcTemplate.query(roleSql, rolesRowMapper, username); for (Roles roles : rolesList) { loadRolesPermissions(roles); } return rolesList; }  @Override Users findUsersByUsername(String username); @Override List<Roles> findRolesByUsername(String username); }
UsersJdbcRepository extends AbstractJdbcRepository implements UsersRepository { @Override public List<Roles> findRolesByUsername(String username) { final String roleSql = " select r.* from roles r, user_roles ur, users u where u.archived = false " + " and u.id = ur.users_id and ur.roles_id = r.id and u.username = ? "; final List<Roles> rolesList = jdbcTemplate.query(roleSql, rolesRowMapper, username); for (Roles roles : rolesList) { loadRolesPermissions(roles); } return rolesList; }  @Override Users findUsersByUsername(String username); @Override List<Roles> findRolesByUsername(String username);  }