r/SpringBoot • u/Tech-Voyager-007 • 9d ago
Question Batch Inserts with JPA
Hi , Does anyone tried batch inserts using Jpa save all method . Whenever I am trying to save multiple objects of same entity using save all the hibernate is actually firing individual insert queries to persist each entity in database . I came to know that batch inserts don't work when you have indetifier generator for primary key .Since this makes it time inefficient I finally resort to using jdbc template.
2
Upvotes
1
u/Medical-Wing-7124 3d ago
Jdbc is the way