简体   繁体   中英

DBunit Circular depedency in dataset.xml

Im trying to create dataset for unit test.

<dataset>
    <team id="1" lead_id="1" />
    <player id="1" team_id="1" />
</dataset>

Player has reference to Team table and vice versa. So when I run test (no matter what is created first, team or player), it returns exception, because ForeignKey requirements was not met.

How can I fix it? Maybe disable FK for data import or dataset.xml allows to update fields in some way.

Yes, will need to drop one of those DB constraints. If there is a feature implementation you find that works, please add it here: https://sourceforge.net/p/dbunit/feature-requests/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM