Re: missing toOne

From: Tore Halset (halse..vv.ntnu.no)
Date: Mon Jul 26 2004 - 01:41:11 EDT

  • Next message: Jonathan Carlson: "Re: Schema Evolution"

    On Jul 18, 2004, at 4:16, Andrus Adamchik wrote:

    > Back to this 2 month-old issue. This is indeed an existing problem.
    > The right solution will require some mapping redesign. So at the
    > moment if you have this issue in your code, play with "to dep pk"
    > setting. This should be a good workaround. For details see:
    >
    > http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-132
    >
    > What I did now is changing the implementation of
    > CayenneDataObject.resolveFault() from current (clearly incorrect)
    > behavior of quietly making object TRANSIENT to the one that does that,
    > but also throws a CayenneRuntimeException, so that the users are aware
    > of what's going on.

    It would be very nice to be able to just do a (if(a.getB() == null)) to
    check if a given "a" has a related toOne object of type B or not. In my
    case, a missing B is not bad enough to deserve a CRE :)

    > So if you see new CayenneRuntimeExceptions after upgrading to the
    > upcoming B2, that simply indicates an already existing problem that
    > was overlooked before.
    >
    > If you think that exception is a bad idea, you can always override
    > "resolveFault" in subclass. In addition if you want to get fancy,
    > DataContextDelegate.shouldProcessDelete() and finishedProcessDelete()
    > methods are notified right before the exception is thrown.

    Ok, I'll look into that.

    Regards,
      - Tore.



    This archive was generated by hypermail 2.0.0 : Mon Jul 26 2004 - 01:41:10 EDT