How to do the BATCH insert in JPA?

自闭症网瘾萝莉.ら 提交于 2019-12-07 11:27:17

问题


I am using JPA with Hibernate persistence. We are using JPA in the following configurations.

persistence-api 1.0 version
hibernate-core 3.3.2.GA version
hibernate-entitymanager 3.4.0.GA version

Is it possible to use Batch Insert in JPA with above configuration?

Please suggest how to do BATCH insert. We want to insert multiple rows in a single table without affecting performance of Database. Also suggest how many row insert is practically possible to use in batch?

Thanks in Anticipations


回答1:


JPA itself does not have have specific support for batch insert. However, because you use Hibernate, take a look to: http://docs.jboss.org/hibernate/core/3.3/reference/en/html/batch.html



来源:https://stackoverflow.com/questions/7440397/how-to-do-the-batch-insert-in-jpa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!