I'm running a process that makes lot's of inserts, but can't be done in a bulk way. It is inserting one by one (in an isolated transaction).
After each insert, JPA executes the ''SELECT @@IDENTITY'' sentence, and I don't care to get the id to store it in the persistence context (as a matter of fact, I'm no interested in getting the new inserted object in the p. context).
How can I avoid that JPA executes that query?
I know that I can create a native query with the insert, but I prefer a JPA way.
I'm using SQL Server 2014
The only way I know is the native insert statement