Hi Sweety,
Can't we do it while importing the data??
We can use NPE to import data from the REST call, and then, iterate through each record one by one, and map it into the persistent entities, also, while mapping it into the persistent entities, we can retrieve the Battery object and associate it with the Asset object, or vice versa.
THis way, this process will be done automatically.
If you don't want to use this method you can go with the event handlers, ( I won't recommend using this, as it makes the application slower).
Let me know if you have any issues,
Hope it helps!
Rishabh
(Resilient It Services)