Re: Referential Integrity
Posted by: Scott Harmon
Date: June 20, 2005 05:50PM

I noticed that this does not seem to preserve cascade on delete for foreign keys

I changed code in ReverseEngineeringAccess.java in method reverseEngineerTableFKs from:
if ((grbit & 256) == 1)
foreignKey.setUpdateRule("CASCADE");

if ((grbit & 4096) == 1)
foreignKey.setDeleteRule("CASCADE");

to

if ((grbit & 256) != 0)
foreignKey.setUpdateRule("CASCADE");

if ((grbit & 4096) != 0)
foreignKey.setDeleteRule("CASCADE");

But it still seems to not setting the constraint to cascade, I then just told it to set cascade always (no if) and it still didn't set the constraint to cascade (so maybe this is a problem in the output of the sql).

Thanks,

Scott.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.