Re: DbMerger and relationships

From: Andrey Razumovsky (razumovsky.andre..mail.com)
Date: Thu Oct 02 2008 - 14:22:29 EDT

  • Next message: Scott Anderson: "RE: DbMerger and relationships"

    I'm not sure about merging, but we're not using delete rules at reverse
    engineering, so I think merger isn't checking them too. If you ask about
    plain JDBC, of course getting rules is possible. You should start at
    Connection.getMetaData().getImportedKeys(...) and then use
    ResultSet.getInt("UPDATE_RULE") or ResultSet.getInt("DELETE_RULE") and
    fetched result set.
    Could you tell some more about your situation, for error message doesn't
    seem to describe it properly.

    BTW, I'd be very cautious with setting delete rules both in DB and Cayenne.
    In most cases Cayenne rule is enough i think

    2008/10/2, Scott Anderson <sanderso..irvana.com>:
    >
    > Does anyone know if it's possible to get information about existing
    > relationships' UPDATE/DELETE rules via JDBC? Looks like the DELETE rule on
    > my Derby database isn't in sync with what Cayenne thinks it is, but the
    > merger isn't checking that.
    >
    > Foreign Key 'SQL081001165758000' is invalid because 'The table cannot be
    > defined as a dependent of table APP.ACCOUNT because of delete rule
    > restrictions. (The relationship causes the table to be delete-connected to
    > the indicated table through multiple relationships and the delete rule of
    > the existing relationship is SET NULL.). '.
    > ALTER TABLE mail ADD FOREIGN KEY (sentto) REFERENCES account (id)
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Oct 02 2008 - 14:23:17 EDT