Re: moving to VelocityGenerator from JavaEOGenerator

From: David LeBer (dlebe..odeferous.com)
Date: Tue Jan 22 2008 - 18:09:37 EST

  • Next message: Mike Schrag: "Re: moving to VelocityGenerator from JavaEOGenerator"

    On 22-Jan-08, at 5:22 PM, Mike Schrag wrote:

    > ok Entity Modeler's fetch specs have fetchSpec.distinctBindings that
    > returns a set of EOQualifierBindings which have a name and an
    > attributePath, which returns either an EORelationshipPath or an
    > EOAttributePath. You can get the childRelationship (EORelationship)
    > or childAttribute (EOAttribute) off of this depending on what the
    > binding is a reference to.
    >
    > ms
    >
    > On Jan 22, 2008, at 4:28 PM, Mike Schrag wrote:
    >
    >> Actually as I'm fixing this in velocity, I think JavaEOGenerator is
    >> wrong here in its implementation. I believe it should be the case
    >> that binding.name is the name of the binding key used in the
    >> qualifier. In EOFetchSpecProxy in JavaEOGen this instead would end
    >> up returning the name of the attribute or relationship that is
    >> binding bound to. As long as you bind "company = $company" this
    >> will work, but if you do "company = $mycompany" I think
    >> EOFetchSpecProxy would give you the wrong thing. I think this (and
    >> how velocity eogen will impl this) should hand back some cover
    >> object whose name is the binding key and whose value is the
    >> attribute or relationship that is bound.
    >>
    >> ms

    Thanks Mike,

    So, I want my velogen templates to generate something like this:

    public NSArray fetchSomeObjectsFetchSpec(EOEditingContext ec,
    BindingOneClass bindingOne, BindingTwoClass bindingTwo) {
            ...
    }

    I get the 'bindingOne' from the EOQualifierBindings 'name', how do I
    get the 'BindingOneClass'?

    Do i need to check the attributePath and ask for a different key path
    based on the result to get at the destinations class or is there an
    easier way I'm not seeing?

    ;david

    --
    David LeBer
    Codeferous Software
    'co-def-er-ous' adj. Literally 'code-bearing'
    site:   http://codeferous.com
    blog: http://davidleber.net
    profile: http://www.linkedin.com/in/davidleber
    --
    Toronto Area Cocoa / WebObjects developers group:
    http://tacow.org
    



    This archive was generated by hypermail 2.0.0 : Tue Jan 22 2008 - 18:10:29 EST