For an Aggregate Root A with a collections of B entities which in turn has a collection of C entities, insert operations are are structured like this:
- insert
A
- insert 1.
B
- insert 1.
C of 1.B
- insert 2.
C of 1.B
...
- insert 1.
B
- insert 1.
C of 2.B
- insert 2.
C of 2.B
...
This is not well suited for batch operations.
For those we should execute the statements in the following order:
- insert
A
- insert 1.
B
- insert 1.
B
...
- insert 1.
C of 1.B
- insert 2.
C of 1.B
- insert 1.
C of 2.B
- insert 2.
C of 2.B
...
See also #537