IntroductionFor performance, we need do bulk operation such as batch disable users. Just do it like using @Finder to find the entities, We use @Updater to do this. DetailsWe add method which annotated with @Updater to UserRepository, eg. @Updater
@Transactional
void disableAll(List<String> userIds); and Named query to User: @NamedQuery(name = "User.disableAll", query = "update User u set u.enabled = false where u.id in (:ids)") Then all things is ok. You just need pass user ids to method to disable this users.
|