Robert.W wrote:
Hi,
Is there a way to force lllgen to guarantee the order of saved items in child entity collection?
If I do:
invoice.Rows.Add(row1)
invoice.Rows.Add(row2)
invoice.Rows.Add(row3)
is it guaranteed to save in that order (and thus rows will have identity column values assigned in that order in SQL Server)?
I'm using llblgen 2.6.
The save order is guaranteed to be valid not to violate FK constraints (so PK side is always persisted first). The order in which they're persisted in a single collection is likely that order, but not guaranteed. You shouldn't rely on identity values having a given order: a transaction that rolls back has identity values which will never be re-used (so the sequence of stored values in the table has gaps)