I am writing a spring batch application and have an input csv file that has multiple rows with a unique person name and their phone number. In the csv I am guaranteed that the person to phone number is one to one relationship however I want to insert these in a database where there is a one to many relationship on person to phone.
I know how to insert each individually however when inserting the phone I want to get the id that was autogenerated when inserting the person to create the one to many relationship.
Not sure the best way to do that unless I write a custom processor that sends http request to the backend or directly access the database to create the person and then use the writer to create the phone number entry.