/** * Select users by ids, including disabled users. An empty list is returned * if list of ids is empty, without any db round trips. * * Used by the Governance plugin */ public List<UserDto> selectByIds(DbSession session, Collection<Integer> ids) { return executeLargeInputs(ids, mapper(session)::selectByIds); }
/** * Select users by logins, including disabled users. An empty list is returned * if list of logins is empty, without any db round trips. */ public List<UserDto> selectByLogins(DbSession session, Collection<String> logins) { return executeLargeInputs(logins, mapper(session)::selectByLogins); }
/** * Search for an active user with the given emailCaseInsensitive exits in database * * Select is case insensitive. Result for searching 'mail@emailCaseInsensitive.com' or 'Mail@Email.com' is the same */ public List<UserDto> selectByEmail(DbSession dbSession, String emailCaseInsensitive) { return mapper(dbSession).selectByEmail(emailCaseInsensitive.toLowerCase(ENGLISH)); }
public List<UserDto> selectByScmAccountOrLoginOrEmail(DbSession session, String scmAccountOrLoginOrEmail) { String like = new StringBuilder().append("%") .append(SCM_ACCOUNTS_SEPARATOR).append(scmAccountOrLoginOrEmail) .append(SCM_ACCOUNTS_SEPARATOR).append("%").toString(); return mapper(session).selectNullableByScmAccountOrLoginOrEmail(scmAccountOrLoginOrEmail, like); }
@CheckForNull public UserDto selectActiveUserByLogin(DbSession session, String login) { UserMapper mapper = mapper(session); return mapper.selectUserByLogin(login); }
/** * Select users by uuids, including disabled users. An empty list is returned * if list of uuids is empty, without any db round trips. */ public List<UserDto> selectByUuids(DbSession session, Collection<String> uuids) { return executeLargeInputs(uuids, mapper(session)::selectByUuids); }
@CheckForNull public UserDto selectUserById(DbSession session, int userId) { return mapper(session).selectUser(userId); }
@CheckForNull public UserDto selectByExternalIdAndIdentityProvider(DbSession dbSession, String externalId, String externalIdentityProvider) { return mapper(dbSession).selectByExternalIdAndIdentityProvider(externalId, externalIdentityProvider); }
@CheckForNull public UserDto selectByUuid(DbSession session, String uuid) { return mapper(session).selectByUuid(uuid); }
@CheckForNull public UserDto selectByLogin(DbSession session, String login) { return mapper(session).selectByLogin(login); }
@CheckForNull public UserDto selectByExternalLoginAndIdentityProvider(DbSession dbSession, String externalLogin, String externalIdentityProvider) { return mapper(dbSession).selectByExternalLoginAndIdentityProvider(externalLogin, externalIdentityProvider); }
public List<UserDto> selectByExternalIdentityProvider(DbSession dbSession, String externalIdentityProvider) { return mapper(dbSession).selectByExternalIdentityProvider(externalIdentityProvider); }
public List<UserDto> selectUsers(DbSession dbSession, UserQuery query) { return mapper(dbSession).selectUsers(query); }
public long countRootUsersButLogin(DbSession dbSession, String login) { return mapper(dbSession).countRootUsersButLogin(login); }
public void scrollByUuids(DbSession dbSession, Collection<String> uuids, Consumer<UserDto> consumer) { UserMapper mapper = mapper(dbSession); executeLargeInputsWithoutOutput(uuids, pageOfUuids -> mapper .selectByUuids(pageOfUuids) .forEach(consumer)); }
public void scrollAll(DbSession dbSession, Consumer<UserDto> consumer) { mapper(dbSession).scrollAll(context -> { UserDto user = context.getResultObject(); consumer.accept(user); }); }
public void setRoot(DbSession session, String login, boolean root) { mapper(session).setRoot(login, root, system2.now()); }
public UserDto update(DbSession session, UserDto dto) { mapper(session).update(dto.setUpdatedAt(system2.now())); return dto; }
public void cleanHomepage(DbSession dbSession, UserDto user) { mapper(dbSession).clearHomepage(user.getLogin(), system2.now()); }
public UserDto insert(DbSession session, UserDto dto) { long now = system2.now(); mapper(session).insert(dto.setUuid(uuidFactory.create()).setCreatedAt(now).setUpdatedAt(now)); return dto; }