Sequence generator is probably a good choice, but you have to tweak its parameters.
In your particular case, I'd start experimenting with allocation size, and then with strategy.
See for example: JPA/Hibernate bulk inserts slow
Take a look at the optimizers configuration:
Note that your configuration resolves to:
SequenceHiLoGenerator on Hibernate 4
SequenceStyleGenerator on Hibernate 5, (it has
hibernate.id.new_generator_mappings set to true)
You cannot use identity generator (see Hibernate disabled insert batching when using an identity identifier generator)
Table generator is not the best performant one (https://vladmihalcea.com/why-you-should-never-use-the-table-identifier-generator-with-jpa-and-hibernate/)
Additionally, make sure that the number of
nextval() is the actual problem.
Maybe changing batch size or statement ordering will help (see https://vladmihalcea.com/how-to-batch-insert-and-update-statements-with-hibernate/)