Re: Modeler and CAY-322

From: Mike Kienenberger (mkienen..laska.net)
Date: Tue Jun 14 2005 - 16:47:51 EDT

  • Next message: Mikaël Cluseau: "Re: Cayenne CRUD tester and found bugs (1.2M4)"

    Mike Kienenberger <mkienen..laska.net> wrote:
    > in (CAY-322) cgen task cannot generate classes for cross-DataMap
    > relationships, I wrote:
    > > Since both fixes modify the namespace variable of the DataMaps passed
    in,
    > this could cause problems in the modeler after class generation completes.
    >
    > In
    >
    org.objectstyle.cayenne.modeler.dialog.classgen.ClassGeneratorController.generateClasses(),

    > it appears that the DataMap is passed in "as-is". This means that
    > DefaultClassGenerator will be modifying a "live" DataMap's namespace
    > variable.
    >
    > Is this going to cause a problem? Does the modeler use the DataMap
    > namespace? Should model.getMap() be cloned in the call? And if so, how?
    >
    > DefaultClassGenerator generator = new
    > DefaultClassGenerator(model.getMap(), selected);
    >

    One possibility is to preserve and restore the namespace value before and
    after generation.
    Another might be to use the existing namespace value if it's not null
    (although this seems a bit riskier and could give inconsistent behavior
    between ant cgen and modeler cgen behavior).

    -Mike



    This archive was generated by hypermail 2.0.0 : Tue Jun 14 2005 - 16:45:17 EDT