My favorites | Sign in
Project Logo
                
Search
for
Updated Oct 05, 2008 by kuisong.tong
Updater  
Remove the delegation to DAO to do bulk operation

Introduction

For 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.

Details

We 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.


Sign in to add a comment
Hosted by Google Code