Naresh J
Naresh J

Reputation: 2137

Batch update in Hibernate4

I want to perform batch update for a query. Here are the 4 queries which I want to perform in batch processing :

Update Contact SET contactNumber = '876-128-9871' WHERE userId = 1 AND contactType = 'A';
Update Contact SET contactNumber = '615-165-9071' WHERE userId = 1 AND contactType = 'B';
Update Contact SET contactNumber = '816-897-5818' WHERE userId = 1 AND contactType = 'C';
Update Contact SET contactNumber = '151-891-7861' WHERE userId = 1 AND contactType = 'D';

Is it possible to perform batch update for such scenario?

If yes then how?

Any reference/link appreciated.

Upvotes: 2

Views: 1287

Answers (1)

Simeon Angelov
Simeon Angelov

Reputation: 470

If I understand you correctly you just would like to make a DML style batch processing. Here is the official tutorial about it: http://docs.jboss.org/hibernate/orm/4.0/manual/en-US/html/batch.html

Upvotes: 1

Related Questions