How to implement batch update using Spring Data Jpa? -


how implement batch update using spring data jpa? have goods entity, , diff user level there diff price,e.g.

goodsid level price   1       1     10   1       2     9   1       3     8 

when update goods want batch update these prices, below:

@query(value = "update goodsprice set price = :price goodsid=:goodsid , level=:level") void batchupdate(list<goodsprice> goodspricelist); 

but throws exception,

caused by: java.lang.illegalargumentexception: name parameter binding must not null or empty! named parameters need use @param query method parameters on java versions < 8.   

so how implement batch update using spring data jpa correctly?

i think not possible spring data jpa according docs. have @ plain jdbc, there few methods regarding batch insert/updates . there nice ebook covering topic.


Comments

Popular posts from this blog

java - unable show chart in xls document using jasper reports -

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -

javascript - How to change image src on success AJAX -