How to automatically order tables by their foreign keys?
DbUnit inserts and updates rows in the order they are found in your dataset; deletes on the other hand are done in reverse order. You must therefore order your tables and rows appropriately in your datasets to prevent foreign keys constraint violation. Since version 2.0, the DatabaseSequenceFilter can now be used to automatically determine the tables order using foreign/exported keys information.