wiradikusuma wrote:
how did you do that precisely?
i have a User object which has another User as its property. db-load chokes
when called :-(

Two choices: It's possible that while your schema is circular, your entries do not contain circular references, in which case you can order the entries in your xml file so that no user row references a subsequent row.

If your data does contain cycles, I don't have a good suggestion, but I can describe what I do:

My database is postgresql, and it just so happens that when I run ant db-prepare, part of the output contains the commands used to create the reference constraints like:

[schemaexport] alter table app_user add constraint FK459C57298626E6B7 foreign key (icon_photo_id) references media; [schemaexport] alter table media add constraint FK62F6FE4F9617040 foreign key (uploader_id) references app_user;

I capture that and create two files (addConstraints and rmConstraints) that contain lines like:

alter table app_user add constraint FK459C57298626E6B7 foreign key (icon_photo_id) references media; alter table media add constraint FK62F6FE4F9617040 foreign key (uploader_id) references app_user;

and

alter table app_user drop constraint FK459C57298626E6B7;
alter table media drop constraint FK62F6FE4F9617040;

respectively.

Then if I want to run db-load, I execute the rmConstraints commands first, then run ant db-load, and then the addConstraints commands (look for the /i command in psql).

I would love a way to automate this, but haven't taken the time to try to find it.

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to