Reputation: 327
Id status
789 1
769 0
234 1
Updating the status values of id's to
Id status
789 0
769 0
234 1
Instead of using select query, modelservice and saving one by one, Can a bulk update be done with Update-Query or Impex Insert_Update in JAVA
Upvotes: 1
Views: 2411
Reputation: 720
Hybris does not currently have an effective bulk updating feature - ModelService.saveAll() does not combine multiple updates into one SQL statement to execute.
I have personally hit this limitation many times when a large number of records need to be updated regularly.
I have spoken to the Hybris core platform team about this in the past but they do not seem keen to address it.
If I have a situation where I need to update a large number of records (hundreds of thousands or more) regularly I tend to store that data in a table outside of the Hybris data model and access it using plain JDBC - not terribly elegant, but not too bad as long as you wrap it the DAO layer.
Taking it a step further, you may want to consider a NoSQL approach using something like MongoDB to store these records, but that depends on your requirements.
Upvotes: 1