Re: DataContext.registerNewObject() vs. entityResolver

From: Holger Hoffstätte (holge..izards.de)
Date: Mon Nov 18 2002 - 09:42:41 EST

  • Next message: Andrus Adamchik: "Re: DataContext.registerNewObject() vs. entityResolver"

    > At 01:55 PM 11/17/2002 +0100, Holger Hoffstätte wrote:
    >>Another reason might be that the assumed mapping of Class to ObjEntity
    >> might not always be true or desired. How likely are scenarios like you
    >> could have with EOF's EOGenericRecord, where you really don't care
    >> about the class but just want to use a dumb record?

    Very likely, for eample in the unit tests which you've successfully
    broken. Good work, Holger :->

    > Yeah, we kind of moved away from GenericRecord approach. Luckily not too
    > far away. Resolver still supports the names, and we may even rethink
    > the deprecation strategy to always support the names. Thanks for
    > bringing this up - gives us another reason to keep Strings around, even
    > if we wouldn't use them heavily at the moment.

    I spent the better part of the morning setting up the unit testing suite -
    creating a user & permissions in Oracle, wrestling the classpath for the
    JDBC driver, running ant from the commandline and finally am up and
    running. Inspecting the (very nice, btw) HTML report brought exactly this
    problem to my attention: CayenneDataObjectInCtxtTst has two tests in which
    CayenneDataObjects are registered; since their class is not mapped
    (_cannot_ be mapped since it will be used for many entities), registration
    without explicit entity specification fails.

    I could:
    - change the tests to use 'real' classes (Artist in this case)
    - de-deprecate the registerNewObject() method with the objEntityName
    - fix the deprecated method for now so it works again, and keep using the
    deprecated method in the test for now

    Any other ideas to this potentially messy situation are most welcome.

    -h



    This archive was generated by hypermail 2.0.0 : Mon Nov 18 2002 - 09:43:13 EST