The short answer is no. For batch operations, Hibernate does not track the generated identifiers, so you will need to go to the database for each Name , since you will make a request based on the name, not on the identifier, if you use some query cache (which would be difficult for your business, I suppose).
I would suggest doing this in a two-step (three?) Process: first, insert all Name objects. Then load them all using Hibernate itself, saving them to a Map . Then just save the other data by binding the Name to an uninstalled Person . Of course, you will need as much memory as you have names :-) But why do you save Name as a separate object?
source share