Custom Action for database Update with nested subtables

Hey guys,

I’m facing again and again the need to update (or insert) database tables with nested subtables (Table->Subtable->SubSubtable).
This is something that databaseUpdater cannot handle…
Of course I have solved it, but instead of 1 line/step in my server action (like a simple databaseUpdater Table->Subtable) I ended up with ~30 lines/steps with conditions and loops…
For example:

So, I’m searching for a way to create a reusable action/component/extension in order to accomplish this kind of task.
(my main concern and difficulty is how to define dynamically which table or subtable is going to be updated)

Any idea/comment would be much appreciated!