I am importing raw data in groovy, hundreds of thousands of entries. I use the table fields as the keys of a hash map and then use the add(hash) method on a groove sql Dataset. The Dataset goes to a postgres table and the ID field is autogenerated from a sequence. I need to get the ID of each record as it is inserted.
In java + hibernate the ID gets inserted automatically inside the corresponding field of the object being persisted. In this case the add() method does not return anything nor does it add an id field to the hash table. I am trying to avoid using hibernate/gorm here for efficiency reason.
Thanks for any pointers or for a better approach.