Re: EntityModeler does not use EOModelGroup.defaultModelGroup() for SQL generation

From: Chuck Hill (chil..lobal-village.net)
Date: Wed Jun 27 2007 - 14:11:25 EDT

  • Next message: JR Ruggentaler: "RE: Unable to edit component with WOLips 4118 (stable)"

    On Jun 27, 2007, at 8:27 AM, Guido Neitzer wrote:

    > On 26.06.2007, at 23:57, Lachlan Deck wrote:
    >
    >> On 27/06/2007, at 3:32 PM, Chuck Hill wrote:
    >>
    >>> In case this saves anyone some time in the future: if you are
    >>> customizing the SQL generation be aware that the model group the
    >>> models are loaded into is _not_ EOModelGroup.defaultGroup(). If
    >>> you can get a reference to an entity, you can navigate back up to
    >>> the group.
    >>
    >> Can you elaborate on this a bit more?
    >
    > If you customize your SQL generation somehow, e.g. by providing a
    > class
    >
    > org.objectstyle.wolips.eomodeler.EOModelProcessor
    >
    > and hooking into "processModel" or "processSQL" to change the
    > default behaviour, you have to be aware, that you don't get the
    > default modelGroup. That's the case I'm aware of.
    >
    > I customize SQL generation in a way that I can set an attribute to
    > be "not null" on a subclass where the superclass does not have that
    > attribute or allows null for it. Therefor I have to "catch" the
    > generated SQL and remove the "not null" constraint.

    In my case, I am writing an extension to one of the database plugins
    to order the DROP TABLE statements for an (alleged) database that
    does not support deferred constraints. Anyone want to guess which
    vendor still does not support this in 2007?

    Chuck

    -- 
    

    Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects



    This archive was generated by hypermail 2.0.0 : Wed Jun 27 2007 - 14:12:20 EDT