JPA中的批量更新(Toplink) [英] Batch updates in JPA (Toplink)
本文介绍了JPA中的批量更新(Toplink)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用JPA Toplink执行批量更新(EntityManagerpersist()或merge())?
Is there any way if executing batch updates (EntityManager persist() or merge()) using JPA Toplink?
推荐答案
如果要进行批处理更新,可以创建一个查询(JPQL或Native SQL),该查询使用EntityManager执行更新,然后调用<该查询上的href ="http://java.sun.com/javaee/5/docs/api/javax/persistence/Query.html#executeUpdate%28%29" rel ="nofollow"> executeUpdate
If you want to do a batch update, you can create a Query (either JPQL or Native SQL) that performs the update using the EntityManager, and then call executeUpdate on that query.
这篇关于JPA中的批量更新(Toplink)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文